Skip to content

Switch to SwCpuClock on ENOENT error#70

Merged
mstange merged 1 commit into
mstange:mainfrom
rkday-pro:handle-eperm
Sep 11, 2023
Merged

Switch to SwCpuClock on ENOENT error#70
mstange merged 1 commit into
mstange:mainfrom
rkday-pro:handle-eperm

Conversation

@rkday-pro

Copy link
Copy Markdown
Contributor

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

mstange commented Sep 11, 2023

Copy link
Copy Markdown
Owner

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.

2 participants