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 test: Refactor brstack test

check_branches() will be used by other tests in a later commit so make
it a function. And the any_call filters are duplicated and will also
be extended in a later commit, so move them to a variable.

No functional changes intended.

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: James Clark <james.clark@linaro.org>
Cc: Adam Young <admiyo@os.amperecomputing.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

James Clark and committed by
Arnaldo Carvalho de Melo
f15548b2 b91917c0

+13 -8
+13 -8
tools/perf/tests/shell/test_brstack.sh
··· 34 34 } 35 35 trap trap_cleanup EXIT TERM INT 36 36 37 + check_branches() { 38 + if ! tr -s ' ' '\n' < "$TMPDIR/perf.script" | grep -E -m1 -q "$1"; then 39 + echo "Branches missing $1" 40 + err=1 41 + fi 42 + } 43 + 37 44 test_user_branches() { 38 45 echo "Testing user branch stack sampling" 39 46 ··· 62 55 ) 63 56 for x in "${expected[@]}" 64 57 do 65 - if ! tr -s ' ' '\n' < "$TMPDIR/perf.script" | grep -E -m1 -q "$x" 66 - then 67 - echo "Branches missing $x" 68 - err=1 69 - fi 58 + check_branches "$x" 70 59 done 71 60 # some branch types are still not being tested: 72 61 # IND COND_CALL COND_RET SYSCALL SYSRET IRQ SERROR NO_TX ··· 104 101 105 102 test_user_branches 106 103 107 - test_filter "any_call" "CALL|IND_CALL|COND_CALL|SYSCALL|IRQ" 104 + any_call="CALL|IND_CALL|COND_CALL|SYSCALL|IRQ" 105 + 106 + test_filter "any_call" "$any_call" 108 107 test_filter "call" "CALL|SYSCALL" 109 108 test_filter "cond" "COND" 110 109 test_filter "any_ret" "RET|COND_RET|SYSRET|ERET" 111 110 112 111 test_filter "call,cond" "CALL|SYSCALL|COND" 113 - test_filter "any_call,cond" "CALL|IND_CALL|COND_CALL|IRQ|SYSCALL|COND" 114 - test_filter "cond,any_call,any_ret" "COND|CALL|IND_CALL|COND_CALL|SYSCALL|IRQ|RET|COND_RET|SYSRET|ERET" 112 + test_filter "any_call,cond" "$any_call|COND" 113 + test_filter "any_call,cond,any_ret" "$any_call|COND|RET|COND_RET" 115 114 116 115 cleanup 117 116 exit $err