Open
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
adamtassier
commented
Apr 16, 2025
src/recordhost.cpp
Outdated
| 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"}; |
Author
There was a problem hiding this comment.
Checking /sys/kernel is probably redundant here right?
Collaborator
There was a problem hiding this comment.
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
Collaborator
There was a problem hiding this comment.
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?
milianw
requested changes
May 7, 2025
Collaborator
milianw
left a comment
There was a problem hiding this comment.
ping? will you attend the review comment I gave you?
Author
milianw
requested changes
May 8, 2025
milianw
reviewed
May 8, 2025
milianw
approved these changes
May 29, 2025
Contributor
|
Looks like a rebase may fix the failing checks, sounds like a good change to get in! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (viatracinggroup).