summaryrefslogtreecommitdiff
path: root/tools/power
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2024-01-19 21:25:42 +0300
committerLen Brown <len.brown@intel.com>2024-04-02 19:50:04 +0300
commitb6fe938317eed58e8c687bd5965a956e15fb5828 (patch)
tree284d1b8cf54ab150abfda6a84144e1b7b2bfaaf6 /tools/power
parent538d505fde20393bce1e6fb95cec82b56cdd22ef (diff)
downloadlinux-b6fe938317eed58e8c687bd5965a956e15fb5828.tar.xz
tools/power turbostat: Fix warning upon failed /dev/cpu_dma_latency read
Previously a failed read of /dev/cpu_dma_latency erroneously complained turbostat: capget(CAP_SYS_ADMIN) failed, try "# setcap cap_sys_admin=ep ./turbostat This went unnoticed because this file is typically visible to root, and turbostat was typically run as root. Going forward, when a non-root user can run turbostat... Complain about failed read access to this file only if --debug is used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/x86/turbostat/turbostat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index c35c48b6a99a..531f37e5f92a 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -5545,7 +5545,8 @@ void print_dev_latency(void)
fd = open(path, O_RDONLY);
if (fd < 0) {
- warnx("capget(CAP_SYS_ADMIN) failed, try \"# setcap cap_sys_admin=ep %s\"", progname);
+ if (debug)
+ warnx("Read %s failed", path);
return;
}