Commit e072b097 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

perf test: Add pipe mode test to the Intel PT test suite



The test_pipe() function will check perf report and perf inject with
pipe input.

Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20230131023350.1903992-5-namhyung@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 14bf4784
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -620,6 +620,22 @@ test_event_trace()
	return 0
}

test_pipe()
{
	echo "--- Test with pipe mode ---"
	# Check if it works with pipe
	if ! perf_record_no_bpf -o- -e intel_pt//u uname | perf report -q -i- --itrace=i10000 ; then
		echo "perf record + report failed with pipe mode"
		return 1
	fi
	if ! perf_record_no_bpf -o- -e intel_pt//u uname | perf inject -b > /dev/null ; then
		echo "perf record + inject failed with pipe mode"
		return 1
	fi
	echo OK
	return 0
}

count_result()
{
	if [ "$1" -eq 2 ] ; then
@@ -647,6 +663,7 @@ test_virtual_lbr || ret=$? ; count_result $ret ; ret=0
test_power_event			|| ret=$? ; count_result $ret ; ret=0
test_no_tnt				|| ret=$? ; count_result $ret ; ret=0
test_event_trace			|| ret=$? ; count_result $ret ; ret=0
test_pipe				|| ret=$? ; count_result $ret ; ret=0

cleanup