Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux_perf_event: exclude_idle only on x86_64 #2295

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bhalevy
Copy link
Member

@bhalevy bhalevy commented Jun 14, 2024

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 #2298

@bhalevy bhalevy requested a review from michoecho June 14, 2024 02:56
@bhalevy
Copy link
Member Author

bhalevy commented Jun 16, 2024

@scylladb/seastar-maint please consider merging

@avikivity
Copy link
Member

Doesn't it fix an open bug?

.exclude_idle = 1,
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is it documented? Perhaps we should opt-in where it is supported?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, need some comment, it looks completely obscure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

       EPERM  Returned on many (but not all) architectures when an
              unsupported exclude_hv, exclude_idle, exclude_user, or
              exclude_kernel setting is specified.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we've lived without it until 93f19d3 we can opt-in and include it only on x86_64 where we know it works (and add a comment about that)

@bhalevy
Copy link
Member Author

bhalevy commented Jun 16, 2024

Doesn't it fix an open bug?

The bug was opened in scylladb (scylladb/scylladb#19227) so updating the seastar submodule should be marked as fixing it.
I can open a corresponding seastar bug if you think it's needed.

Edit: opened #2298

@bhalevy bhalevy force-pushed the perf-exclude_idle-not-supported-on-arm branch from 89ce5f7 to 916ade0 Compare June 18, 2024 06:49
@bhalevy bhalevy changed the title linux_perf_event: do not exclude_idle on aarch64 linux_perf_event: exclude_idle only on x86_64 Jun 18, 2024
@bhalevy bhalevy force-pushed the perf-exclude_idle-not-supported-on-arm branch from 916ade0 to 08041ad Compare June 18, 2024 06:56
Refactor the common code making linux_perf_event out of
`user_instructions_retired` and `user_cpu_cycles_retired`.

Signed-off-by: Benny Halevy <[email protected]>
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]>
@bhalevy bhalevy force-pushed the perf-exclude_idle-not-supported-on-arm branch from 08041ad to 041523e Compare July 1, 2024 06:09
@bhalevy
Copy link
Member Author

bhalevy commented Jul 1, 2024

  • rebased (checkheaders issue seems to be fixed already in latest master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linux_perf_event fails on aarch64 since exclude_idle is set
3 participants