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