-
Notifications
You must be signed in to change notification settings - Fork 95
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 capability check #254
base: master
Are you sure you want to change the base?
Perf capability check #254
Conversation
…perf support based on file capabilities and linux version Signed-off-by: Abena Laast <[email protected]>
…cluding checking the capabilities based on the linux version Signed-off-by: Abena Laast <[email protected]>
if contains_cap t cap_string then has_eff t cap_string else true | ||
;; | ||
|
||
let check_perf_support getcap linux_version = |
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 this function should probably live in perf_capabilities.ml
, within supports_tracing_kernel
.
else Capability.empty | ||
;; | ||
|
||
let has_eff t cap_string = get_cap_sets t cap_string |> Capability.effective |
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.
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.
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