From ce5b4191e865fe85cbbb9cf4913424d19e6bcc86 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 17 Oct 2025 16:19:51 +0200 Subject: [PATCH] 6.6-stable patches added patches: perf-test-stat-avoid-hybrid-assumption-when-virtualized.patch --- ...d-hybrid-assumption-when-virtualized.patch | 45 +++++++++++++++++++ queue-6.6/series | 1 + 2 files changed, 46 insertions(+) create mode 100644 queue-6.6/perf-test-stat-avoid-hybrid-assumption-when-virtualized.patch diff --git a/queue-6.6/perf-test-stat-avoid-hybrid-assumption-when-virtualized.patch b/queue-6.6/perf-test-stat-avoid-hybrid-assumption-when-virtualized.patch new file mode 100644 index 0000000000..55d60dc2a5 --- /dev/null +++ b/queue-6.6/perf-test-stat-avoid-hybrid-assumption-when-virtualized.patch @@ -0,0 +1,45 @@ +From f9c506fb69bdcfb9d7138281378129ff037f2aa1 Mon Sep 17 00:00:00 2001 +From: Ian Rogers +Date: Thu, 12 Dec 2024 09:33:54 -0800 +Subject: perf test stat: Avoid hybrid assumption when virtualized + +From: Ian Rogers + +commit f9c506fb69bdcfb9d7138281378129ff037f2aa1 upstream. + +The cycles event will fallback to task-clock in the hybrid test when +running virtualized. Change the test to not fail for this. + +Fixes: 65d11821910bd910 ("perf test: Add a test for default perf stat command") +Reviewed-by: James Clark +Signed-off-by: Ian Rogers +Acked-by: Namhyung Kim +Cc: Adrian Hunter +Cc: Alexander Shishkin +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Mark Rutland +Cc: Peter Zijlstra +Link: https://lore.kernel.org/r/20241212173354.9860-1-irogers@google.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/tests/shell/stat.sh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/tools/perf/tests/shell/stat.sh ++++ b/tools/perf/tests/shell/stat.sh +@@ -161,7 +161,11 @@ test_hybrid() { + # Run default Perf stat + cycles_events=$(perf stat -- true 2>&1 | grep -E "/cycles/[uH]*| cycles[:uH]* " -c) + +- if [ "$pmus" -ne "$cycles_events" ] ++ # The expectation is that default output will have a cycles events on each ++ # hybrid PMU. In situations with no cycles PMU events, like virtualized, this ++ # can fall back to task-clock and so the end count may be 0. Fail if neither ++ # condition holds. ++ if [ "$pmus" -ne "$cycles_events" ] && [ "0" -ne "$cycles_events" ] + then + echo "hybrid test [Found $pmus PMUs but $cycles_events cycles events. Failed]" + err=1 diff --git a/queue-6.6/series b/queue-6.6/series index dfc2ca96c8..558737643a 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -198,3 +198,4 @@ fs-add-initramfs_options-to-set-initramfs-mount-opti.patch cramfs-verify-inode-mode-when-loading-from-disk.patch writeback-avoid-softlockup-when-switching-many-inode.patch writeback-avoid-excessively-long-inode-switching-tim.patch +perf-test-stat-avoid-hybrid-assumption-when-virtualized.patch -- 2.47.3