diff options
author | Namhyung Kim <namhyung@kernel.org> | 2022-10-20 20:26:41 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-10-27 22:37:26 +0300 |
commit | c8c935677487ba6f7dd18d48e39ab30bbb4cb5d9 (patch) | |
tree | 08f8e19ac0c25dfefaec9b36183365c8fb616321 /tools/perf/tests/shell | |
parent | 2cadf2c7b99a980455500c34571a540300c49c72 (diff) | |
download | linux-c8c935677487ba6f7dd18d48e39ab30bbb4cb5d9.tar.xz |
perf test: Add target workload test in 'perf record' tests
Add a subtest which profiles the given workload on the command line.
As it's a minimal requirement, the test should run ok so it doesn't skip
the test even if it failed to run the 'perf record' command.
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Ian Rogers <irogers@google.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/20221020172643.3458767-7-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/shell')
-rwxr-xr-x | tools/perf/tests/shell/record.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh index 345764afb745..c59d1459c960 100755 --- a/tools/perf/tests/shell/record.sh +++ b/tools/perf/tests/shell/record.sh @@ -174,11 +174,29 @@ test_system_wide() { echo "Basic --system-wide mode test [Success]" } +test_workload() { + echo "Basic target workload test" + if ! perf record -o "${perfdata}" ${testprog} 2> /dev/null + then + echo "Workload record [Failed record]" + err=1 + return + fi + if ! perf report -i "${perfdata}" -q | grep -q "${testsym}" + then + echo "Workload record [Failed missing output]" + err=1 + return + fi + echo "Basic target workload test [Success]" +} + build_test_program test_per_thread test_register_capture test_system_wide +test_workload cleanup exit $err |