Namhyung Kim
246122a856
perf test: Do not fail Intel-PT misc test w/o libpython
...
The virtual LBR test uses a python script to check the max size of
branch stack in the Intel-PT generated LBR. But it didn't check whether
python scripting is available (as it's optional).
Let's skip the test if the python support is not available.
Fixes: f77811a0f6 ("perf test: test_intel_pt.sh: Add 9 tests")
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ian Rogers <irogers@google.com >
Cc: Ammy Yi <ammy.yi@intel.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: https://lore.kernel.org/r/20221021181055.60183-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-25 17:40:48 -03:00
Ammy Yi
f77811a0f6
perf test: test_intel_pt.sh: Add 9 tests
...
Add tests:
Test with MTC and TSC disabled
Test with branches disabled
Test with/without CYC
Test recording with sample mode
Test with kernel trace
Test virtual LBR
Test power events
Test with TNT packets disabled
Test with event_trace
These tests mostly check that perf record works with the corresponding
Intel PT config terms, sometimes also checking that certain packets do or
do not appear in the resulting trace as appropriate.
The "Test virtual LBR" is slightly trickier, using a Python script to
check that branch stacks are actually synthesized.
Signed-off-by: Ammy Yi <ammy.yi@intel.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20221014170905.64069-8-adrian.hunter@intel.com
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-15 10:13:16 -03:00
Adrian Hunter
973db24079
perf test: test_intel_pt.sh: Add jitdump test
...
Add a test for decoding self-modifying code using a jitdump file.
The test creates a workload that uses self-modifying code and generates its
own jitdump file. The result is processed with perf inject --jit and
checked for decoding errors.
Note the test will fail without patch "perf inject: Fix GEN_ELF_TEXT_OFFSET
for jit" applied.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20221014170905.64069-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-15 10:13:16 -03:00
Adrian Hunter
40053a4b7e
perf test: test_intel_pt.sh: Tidy some alignment
...
Tidy alignment of test function lines to make them more readable.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20221014170905.64069-5-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-15 10:13:16 -03:00
Adrian Hunter
9637bf8ff0
perf test: test_intel_pt.sh: Print a message when skipping kernel tracing
...
Messages display with the perf test -v option. Add a message to show when
skipping a test because the user cannot do kernel tracing.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20221014170905.64069-4-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-15 10:13:16 -03:00
Adrian Hunter
5021d82bca
perf test: test_intel_pt.sh: Tidy some perf record options
...
When not decoding, the options "-B -N --no-bpf-event" speed up perf record.
Make a common function for them.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20221014170905.64069-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-15 10:13:16 -03:00
Adrian Hunter
e408049287
perf test: test_intel_pt.sh: Fix return checking again
...
count_result() does not always reset ret=0 which means the value can spill
into the next test result.
Fix by explicitly setting it to zero between tests.
Committer testing:
# perf test "Miscellaneous Intel PT testing"
110: Miscellaneous Intel PT testing : Ok
#
Tested as well with:
# perf test -v "Miscellaneous Intel PT testing"
Fixes: fd9b45e39c ("perf test: test_intel_pt.sh: Fix return checking")
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20221014170905.64069-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-15 10:13:16 -03:00
Adrian Hunter
5ebcdf07f7
perf test: test_intel_pt.sh: Move helper functions for waiting
...
Move helper functions for waiting to a separate file so they can be
shared.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220914080150.5888-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
fea753f8e3
perf test: test_intel_pt.sh: Add per-thread test
...
When tracing the kernel with Intel PT, text_poke events are recorded
per-cpu. In per-thread mode that results in a mixture of per-thread and
per-cpu events and mmaps. Check that happens correctly.
The debug output from perf record -vvv is recorded and then awk used to
process the debug messages that indicate what file descriptors were
opened and whether they were mmapped or set-output.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: http://lore.kernel.org/lkml/20220912083412.7058-12-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
2c1c9e351a
perf test: test_intel_pt.sh: Add more output in preparation for more tests
...
When there are more tests it won't be obvious which test failed. Add more
output so that it is.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-10-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
fd9b45e39c
perf test: test_intel_pt.sh: Fix return checking
...
The use of set -e will cause a function that returns non-zero to terminate
the script unless the result is consumed by || for example. That is OK if
there is only 1 test function, but not if there are more. Prepare for more
by using ||.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-9-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
5d7aac2bf8
perf test: test_intel_pt.sh: Use quotes around variable expansion
...
As suggested by shellcheck, use quotes around variable expansion.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-8-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
711949e2f0
perf test: test_intel_pt.sh: Use grep -c instead of grep plus wc -l
...
As suggested by shellcheck, use grep -c instead of grep plus wc -l
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-7-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
1aaff2bac6
perf test: test_intel_pt.sh: Stop using backticks
...
As suggested by shellcheck, stop using backticks.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
202d039413
perf test: test_intel_pt.sh: Stop using expr
...
As suggested by shellcheck, stop using expr.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-5-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
3f79fff8bd
perf test: test_intel_pt.sh: Fix redirection
...
As reported by shellcheck, 2>&1 must come after >/dev/null
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-4-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
170ac70f16
perf test: test_intel_pt.sh: Use a temp directory
...
Create a directory for temporary files so that mktemp needs to be used
only once. It also enables more temp files to be added without having to
add them also to the cleanup.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
19af23df66
perf test: test_intel_pt.sh: Add cleanup function
...
Add a cleanup function that will still clean up if the script is
terminated prematurely.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: https://lore.kernel.org/r/20220912083412.7058-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-10-04 08:55:23 -03:00
Adrian Hunter
1097b38fb7
perf intel-pt: Add a test for system-wide side band
...
Add a test for system-wide side band even when tracing selected CPUs.
The test fails before the patches up to "perf tools: Allow system-wide
events to keep their own CPUs" are applied, passes afterwards.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Tested-by: Ian Rogers <irogers@google.com >
Acked-by: Ian Rogers <irogers@google.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Leo Yan <leo.yan@linaro.org >
Link: https://lore.kernel.org/r/20220524075436.29144-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-05-26 12:36:56 -03:00