Skip to content

Commit 40aafc7

Browse files
praritlenb
authored andcommitted
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 <[email protected]> Cc: [email protected] Signed-off-by: Len Brown <[email protected]>
1 parent 9c08581 commit 40aafc7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/power/x86/turbostat/turbostat.8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ Alternatively, non-root users can be enabled to run turbostat this way:
344344

345345
# chmod +r /dev/cpu/*/msr
346346

347+
# chmod +r /dev/cpu_dma_latency
348+
347349
.B "turbostat "
348350
reads hardware counters, but doesn't write them.
349351
So it will not interfere with the OS or other programs, including

tools/power/x86/turbostat/turbostat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5482,7 +5482,7 @@ void print_dev_latency(void)
54825482

54835483
retval = read(fd, (void *)&value, sizeof(int));
54845484
if (retval != sizeof(int)) {
5485-
warn("read %s\n", path);
5485+
warn("read failed %s\n", path);
54865486
close(fd);
54875487
return;
54885488
}

0 commit comments

Comments
 (0)