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

Configure Feed

Select the types of activity you want to include in your feed.

perf intel-pt: Add a test for pause / resume

Add a simple sub-test to the "Miscellaneous Intel PT testing" test to
check pause / resume.

Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20241216070244.14450-8-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
4c7f9ee2 f8b301e0

+28
+28
tools/perf/tests/shell/test_intel_pt.sh
··· 644 644 return 0 645 645 } 646 646 647 + test_pause_resume() 648 + { 649 + echo "--- Test with pause / resume ---" 650 + if ! perf_record_no_decode -o "${perfdatafile}" -e intel_pt/aux-action=start-paused/u uname ; then 651 + echo "SKIP: pause / resume is not supported" 652 + return 2 653 + fi 654 + if ! perf_record_no_bpf -o "${perfdatafile}" \ 655 + -e intel_pt/aux-action=start-paused/u \ 656 + -e instructions/period=50000,aux-action=resume,name=Resume/u \ 657 + -e instructions/period=100000,aux-action=pause,name=Pause/u uname ; then 658 + echo "perf record with pause / resume failed" 659 + return 1 660 + fi 661 + if ! perf script -i "${perfdatafile}" --itrace=b -Fperiod,event | \ 662 + awk 'BEGIN {paused=1;branches=0} 663 + /Resume/ {paused=0} 664 + /branches/ {if (paused) exit 1;branches=1} 665 + /Pause/ {paused=1} 666 + END {if (!branches) exit 1}' ; then 667 + echo "perf record with pause / resume failed" 668 + return 1 669 + fi 670 + echo OK 671 + return 0 672 + } 673 + 647 674 count_result() 648 675 { 649 676 if [ "$1" -eq 2 ] ; then ··· 699 672 test_no_tnt || ret=$? ; count_result $ret ; ret=0 700 673 test_event_trace || ret=$? ; count_result $ret ; ret=0 701 674 test_pipe || ret=$? ; count_result $ret ; ret=0 675 + test_pause_resume || ret=$? ; count_result $ret ; ret=0 702 676 703 677 cleanup 704 678