Commit c8c93567 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

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: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarIan 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 2cadf2c7
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment