Open
Conversation
…perf support based on file capabilities and linux version Signed-off-by: Abena Laast <salaast@gmail.com>
…cluding checking the capabilities based on the linux version Signed-off-by: Abena Laast <salaast@gmail.com>
Xyene
reviewed
Aug 5, 2022
Xyene
reviewed
Aug 5, 2022
| if contains_cap t cap_string then has_eff t cap_string else true | ||
| ;; | ||
|
|
||
| let check_perf_support getcap linux_version = |
Member
There was a problem hiding this comment.
I think this function should probably live in perf_capabilities.ml, within supports_tracing_kernel.
Xyene
reviewed
Aug 5, 2022
| else Capability.empty | ||
| ;; | ||
|
|
||
| let has_eff t cap_string = get_cap_sets t cap_string |> Capability.effective |
Member
There was a problem hiding this comment.
Suggested change
| let has_eff t cap_string = get_cap_sets t cap_string |> Capability.effective | |
| let has_effective t cap_string = get_cap_sets t cap_string |> Capability.effective |
Nit: avoid shortened function/variable names for readability.
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.
Use capability parser to parse the output of getcap command on the perf file path; determine permission to trace kernel based on the linux version and the existence of cap_sys_admin/cap_perfmon in effective capabilities