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

Switch to SwCpuClock on ENOENT error #70

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Conversation

rkd-msw
Copy link
Contributor

@rkd-msw rkd-msw commented Sep 4, 2023

The perf_event_open manpage (https://www.man7.org/linux/man-pages/man2/perf_event_open.2.html) says that ENOENT is "Returned if the type setting is not valid.". Prior to this fix, samply only switched to SwCpuClick on an EPERM error. This fix means that we try it speculatively whatever the error, unless it's a EPERM that can be fixed by changing the paranoia level.

(I've seen an ENOENT error when running samply on WSL2, where hardware counters aren't available.)

The `perf_event_open` manpage says that ENOENT is "Returned if the type
setting is not valid.". Prior to this fix, samply only switched to
SwCpuClick on an EPERM error. This fix means that we try it
speculatively whatever the error, unless it's a EPERM that can be fixed
by changing the paranoia level.
@mstange
Copy link
Owner

mstange commented Sep 11, 2023

Thanks!

@mstange mstange merged commit 422530a into mstange:main Sep 11, 2023
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.

None yet

2 participants