aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate-data.c
diff options
context:
space:
mode:
authorIan Rogers <[email protected]>2024-08-06 22:06:14 +0000
committerArnaldo Carvalho de Melo <[email protected]>2024-08-20 20:53:12 +0000
commite25ebda78e230283bf707ae3e9655270ff40a7f9 (patch)
tree74d714be33a29f0e33bdfcc9f9030207d972318e /tools/perf/util/annotate-data.c
parentperf annotate-data: Set bitfield member offset and size properly (diff)
downloadkernel-e25ebda78e230283bf707ae3e9655270ff40a7f9.tar.gz
kernel-e25ebda78e230283bf707ae3e9655270ff40a7f9.zip
perf cap: Tidy up and improve capability testing
Remove dependence on libcap. libcap is only used to query whether a capability is supported, which is just 1 capget system call. If the capget system call fails, fall back on root permission checking. Previously if libcap fails then the permission is assumed not present which may be pessimistic/wrong. Add a used_root out argument to perf_cap__capable to say whether the fall back root check was used. This allows the correct error message, "root" vs "users with the CAP_PERFMON or CAP_SYS_ADMIN capability", to be selected. Tidy uses of perf_cap__capable so that tests aren't repeated if capget isn't supported. Signed-off-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Changbin Du <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Oliver Upton <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate-data.c')
0 files changed, 0 insertions, 0 deletions