diff options
| author | Namhyung Kim <namhyung@kernel.org> | 2024-10-15 23:23:51 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2024-10-22 09:51:22 -0700 |
| commit | bb6e7cb11d97ce1957894d30d13bfad3e8bfefe9 (patch) | |
| tree | 91860b952bba7a7772d9c74cbc36b6777f01bb88 /tools/perf/tests | |
| parent | 3e2d4df574fc6bbd00b422f2f1ce5c1ac251feae (diff) | |
perf tools: Add fallback for exclude_guest
Commit 7b100989b4f6bce70 ("perf evlist: Remove __evlist__add_default")
changed to parse "cycles:P" event instead of creating a new cycles
event for perf record. But it also changed the way how modifiers are
handled so it doesn't set the exclude_guest bit by default.
It seems Apple M1 PMU requires exclude_guest set and returns EOPNOTSUPP
if not. Let's add a fallback so that it can work with default events.
Also update perf stat hybrid tests to handle possible u or H modifiers.
Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Reviewed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Acked-by: Kan Liang <kan.liang@linux.intel.com>
Cc: James Clark <james.clark@arm.com>
Cc: Atish Patra <atishp@atishpatra.org>
Cc: Mingwei Zhang <mizhang@google.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20241016062359.264929-2-namhyung@kernel.org
Fixes: 7b100989b4f6bce70 ("perf evlist: Remove __evlist__add_default")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/tests')
| -rwxr-xr-x | tools/perf/tests/shell/stat.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/tests/shell/stat.sh b/tools/perf/tests/shell/stat.sh index f25ef468b8fc..7a8adf81e4b3 100755 --- a/tools/perf/tests/shell/stat.sh +++ b/tools/perf/tests/shell/stat.sh @@ -185,7 +185,7 @@ test_hybrid() { fi # Run default Perf stat - cycles_events=$(perf stat -- true 2>&1 | grep -E "/cycles/| cycles " | wc -l) + cycles_events=$(perf stat -- true 2>&1 | grep -E "/cycles/[uH]*| cycles[:uH]* " -c) if [ "$pmus" -ne "$cycles_events" ] then |
