Commit 40aafc7d authored by Prarit Bhargava's avatar Prarit Bhargava Committed by Len Brown
Browse files

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: default avatarPrarit Bhargava <prarit@redhat.com>
Cc: linux-pm@vger.kernel.org
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 9c085817
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}