Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Namhyung 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: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
e072b097 14bf4784

+17
+17
tools/perf/tests/shell/test_intel_pt.sh
··· 620 620 return 0 621 621 } 622 622 623 + test_pipe() 624 + { 625 + echo "--- Test with pipe mode ---" 626 + # Check if it works with pipe 627 + if ! perf_record_no_bpf -o- -e intel_pt//u uname | perf report -q -i- --itrace=i10000 ; then 628 + echo "perf record + report failed with pipe mode" 629 + return 1 630 + fi 631 + if ! perf_record_no_bpf -o- -e intel_pt//u uname | perf inject -b > /dev/null ; then 632 + echo "perf record + inject failed with pipe mode" 633 + return 1 634 + fi 635 + echo OK 636 + return 0 637 + } 638 + 623 639 count_result() 624 640 { 625 641 if [ "$1" -eq 2 ] ; then ··· 663 647 test_power_event || ret=$? ; count_result $ret ; ret=0 664 648 test_no_tnt || ret=$? ; count_result $ret ; ret=0 665 649 test_event_trace || ret=$? ; count_result $ret ; ret=0 650 + test_pipe || ret=$? ; count_result $ret ; ret=0 666 651 667 652 cleanup 668 653