-
Notifications
You must be signed in to change notification settings - Fork 265
Tracefs location #710
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
base: master
Are you sure you want to change the base?
Tracefs location #710
Conversation
…ernel/debug/tracing. The default location for tracefs has been /sys/kernel/tracing since at least linux v4.1.
…uire elevated privileges if both /sys/kernel/tracing is readable and /proc/sys/kernel/perf_event_paranoid == -1
src/recordhost.cpp
Outdated
@@ -116,7 +116,7 @@ bool privsAlreadyElevated() | |||
struct stat buf; | |||
return stat(path, &buf) == 0 && ((buf.st_mode & 07777) & required) == required; | |||
}; | |||
static const auto paths = {"/sys/kernel/debug", "/sys/kernel/debug/tracing"}; | |||
static const auto paths = {"/sys/kernel/", "/sys/kernel/tracing"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking /sys/kernel
is probably redundant here right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, yes - the old code was needed back then (Linux 3.x I think), because there tracing was mounted into debug, and thus needed to be checked separately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that said, I wouldn't mind if we could rework this code:
check first if sys/kernel/tracing
is usable, if so return early. otherwise keep backwards compat and check the two old locations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping? will you attend the review comment I gave you?
Hi,
This PR changes the file system location that is checked for
tracefs
. At least since linux v4.1 the default location has been/sys/kernel/tracing/
instead of/sys/kernel/debug/tracing/
(but the latter was kept for compatability).I also changed the tooltip of the 'off-cpu profiling' checkbox to better reflect the conditions under which it can be checked as I had to go look into the source code.
This was an issue for me when setting up rootless 'off-cpu profiling' (ie not using 'elevate privileges'). Turns out the problem was that
/sys/kernel/debug/tracing/
was not readable on my machine but/sys/kernel/tracing/
was (viatracing
group).