The mem-loads-aux event exists on hybrid systems but the "cpu" PMU
does not. This causes an event parsing error which erroneously makes
the test look like it is failing. Avoid naming the PMU to avoid
this. Rather than cleaning up perf.data in the directory the test is
run, explicitly send the 'perf record' output to /dev/null and avoid
any cleanup scripts.
Fixes: fc9c17b22352 ("perf test: Add a perf event fallback test")
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
ok_cnt=0
err_cnt=0
-cleanup()
-{
- rm -f perf.data
- rm -f perf.data.old
- trap - EXIT TERM INT
-}
-
-trap_cleanup()
-{
- cleanup
- exit 1
-}
-
-trap trap_cleanup EXIT TERM INT
-
perf_record()
{
- perf record "$@" -- true 1>/dev/null 2>&1
+ perf record -o /dev/null "$@" -- true 1>/dev/null 2>&1
}
test_decrease_precise_ip()
perf list pmu | grep -q 'mem-loads-aux' || return 2
- if ! perf_record -e '{cpu/mem-loads-aux/S,cpu/mem-loads/PS}'; then
+ if ! perf_record -e '{mem-loads-aux:S,mem-loads:PS}'; then
return 1
fi
return 0