Skip to content

Commit

Permalink
linux_perf_event: exclude_idle only on x86_64
Browse files Browse the repository at this point in the history
Commit 93f19d3
added `exclude_idle = 1` to `linux_perf_event`.
However, as reported in
scylladb/scylladb#19227 (comment),
`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#2298

Signed-off-by: Benny Halevy <[email protected]>
  • Loading branch information
bhalevy committed Jul 1, 2024
1 parent 9d4e8ff commit 041523e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/perf/linux_perf_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 041523e

Please sign in to comment.