-
Notifications
You must be signed in to change notification settings - Fork 59
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
perf_event: Eliminate paranoia error for check_exclude_guest() #257
Conversation
Hello @willowec, what error are you getting when you do not have |
@Treece-Burgess I apologize for excluding that information previously. Without the fix introduced in this PR, the error occurs for nearly every test invoked by
This occurs on my machine running Debian 6.7.12-1~bpo12+1, kernel 6.7.12+bpo-amd64 with |
@willowec I tested the proposed changes on a machine where my paranoid level is set to 4 and I still get the output of
I am on an Ubuntu machine with a kernel version of 5.15.0-87-generic. I do think that the error makes sense if you have a paranoid level that does not permit you to access any hardware counters. However, the message could be a bit more explicit stating that you need to have your paranoid level set < 2. |
@Treece-Burgess Interesting! The same thing happens for me on my Debian machine with
It also looks like some distros like Debian and Ubuntu include patches that add an extra level that disallows all use of Since paranoia level 2 only disallows kernel profiling for unprivileged users, from my understanding shouldn't |
@willowec On a system where my I think adding your suggested change and updating the error message would probably be the best course of action. Let me speak with another team member about it more. |
@willowec Could you rebase your branch before I merge? |
… paranoid kernel On systems with perf_event_paranoid>=2, userspace calls to perf_event_open() must set attr.exclude_kernel=1. Set exclude_kernel=1 in check_exclude_guest() to allow the function to execute successfully on systems with perf_event_paranoid>=2;
bb6616a
to
1bce2af
Compare
@Treece-Burgess Sorry for the delay, re-based! |
Pull Request Description
On systems with the kernel setting
perf_event_paranoid
>=2, userspace calls toperf_event_open()
must setattr.exclude_kernel=1
. Setexclude_kernel=1
incheck_exclude_guest()
to allow the function to execute successfully on systems withperf_event_paranoid
>=2;Author Checklist
Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
Commits are self contained and only do one thing
Commits have a header of the form:
module: short description
Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
The PR needs to pass all the tests