From 041523ec308eda50e52b4d986eef39a137da0163 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Fri, 14 Jun 2024 05:09:23 +0300 Subject: [PATCH] linux_perf_event: exclude_idle only on x86_64 Commit 93f19d39526c68defac6860a15c77160da273606 added `exclude_idle = 1` to `linux_perf_event`. However, as reported in https://github.com/scylladb/scylladb/issues/19227#issuecomment-2165577271, `exclude_idle` is not supported on ARM platforms. This change sets `exclude_idle` only on known-to-work architectures (presently, it's only x86_64), assuming it is initialized to 0 as all other unset bitfields in `perf_event_attr`. Fixes scylladb/seastar#2298 Signed-off-by: Benny Halevy --- tests/perf/linux_perf_event.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/perf/linux_perf_event.cc b/tests/perf/linux_perf_event.cc index ff43e80bb2..16c06bb6a4 100644 --- a/tests/perf/linux_perf_event.cc +++ b/tests/perf/linux_perf_event.cc @@ -90,7 +90,11 @@ make_linux_perf_event(unsigned config, pid_t pid = 0, int cpu = -1, int group_fd .disabled = 1, .exclude_kernel = 1, .exclude_hv = 1, +#if defined(__x86_64__) + // exclude_idle is not supported on all architectures (e.g. aarch64) + // so enable it selectively only on architectures that support it. .exclude_idle = 1, +#endif }, pid, cpu, group_fd, flags); }