summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2022-12-15 18:18:16 +0300
committerLen Brown <len.brown@intel.com>2023-03-17 18:23:38 +0300
commit40aafc7d58d3544f152a863a0e9863014b6d5d8c (patch)
treecd13fff24b6b11fc2b7d93011b431f5f2c994ed9 /tools
parent9c08581728ccadc6b9e4135b7b8d31948e814f6f (diff)
downloadlinux-40aafc7d58d3544f152a863a0e9863014b6d5d8c.tar.xz
tools/power turbostat: Fix /dev/cpu_dma_latency warnings
When running as non-root the following error is seen in turbostat: turbostat: fopen /dev/cpu_dma_latency : Permission denied turbostat and the man page have information on how to avoid other permission errors, so these can be fixed the same way. Provide better /dev/cpu_dma_latency warnings that provide instructions on how to avoid the error, and update the man page. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Cc: linux-pm@vger.kernel.org Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/power/x86/turbostat/turbostat.82
-rw-r--r--tools/power/x86/turbostat/turbostat.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
index 7dcb4f4f3d55..8f08c3fd498d 100644
--- a/tools/power/x86/turbostat/turbostat.8
+++ b/tools/power/x86/turbostat/turbostat.8
@@ -344,6 +344,8 @@ Alternatively, non-root users can be enabled to run turbostat this way:
# chmod +r /dev/cpu/*/msr
+# chmod +r /dev/cpu_dma_latency
+
.B "turbostat "
reads hardware counters, but doesn't write them.
So it will not interfere with the OS or other programs, including
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index d246ef6153dc..9aed2620a2d2 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -5482,7 +5482,7 @@ void print_dev_latency(void)
retval = read(fd, (void *)&value, sizeof(int));
if (retval != sizeof(int)) {
- warn("read %s\n", path);
+ warn("read failed %s\n", path);
close(fd);
return;
}