xref: /linux/tools/perf/tests/shell/base_report/setup.sh (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1*61f87151SVeronika Molnarova#!/bin/bash
2*61f87151SVeronika Molnarova
3*61f87151SVeronika Molnarova# SPDX-License-Identifier: GPL-2.0
4*61f87151SVeronika Molnarova
5*61f87151SVeronika Molnarova#
6*61f87151SVeronika Molnarova#	setup.sh of perf report test
7*61f87151SVeronika Molnarova#	Author: Michael Petlan <mpetlan@redhat.com>
8*61f87151SVeronika Molnarova#
9*61f87151SVeronika Molnarova#	Description:
10*61f87151SVeronika Molnarova#
11*61f87151SVeronika Molnarova#		We need some sample data for perf-report testing
12*61f87151SVeronika Molnarova#
13*61f87151SVeronika Molnarova#
14*61f87151SVeronika Molnarova
15*61f87151SVeronika Molnarova# include working environment
16*61f87151SVeronika Molnarova. ../common/init.sh
17*61f87151SVeronika Molnarova
18*61f87151SVeronika Molnarovatest -d "$HEADER_TAR_DIR" || mkdir -p "$HEADER_TAR_DIR"
19*61f87151SVeronika Molnarova
20*61f87151SVeronika MolnarovaSW_EVENT="cpu-clock"
21*61f87151SVeronika Molnarova
22*61f87151SVeronika Molnarova$CMD_PERF record -asdg -e $SW_EVENT -o $CURRENT_TEST_DIR/perf.data -- $CMD_LONGER_SLEEP 2> $LOGS_DIR/setup.log
23*61f87151SVeronika MolnarovaPERF_EXIT_CODE=$?
24*61f87151SVeronika Molnarova
25*61f87151SVeronika Molnarova../common/check_all_patterns_found.pl "$RE_LINE_RECORD1" "$RE_LINE_RECORD2" < $LOGS_DIR/setup.log
26*61f87151SVeronika MolnarovaCHECK_EXIT_CODE=$?
27*61f87151SVeronika Molnarova
28*61f87151SVeronika Molnarovaprint_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "prepare the perf.data file"
29*61f87151SVeronika MolnarovaTEST_RESULT=$?
30*61f87151SVeronika Molnarova
31*61f87151SVeronika Molnarovaprint_overall_results $TEST_RESULT
32*61f87151SVeronika Molnarovaexit $?
33