Skip to content

Commit

Permalink
tools/power turbostat: Print /dev/cpu_dma_latency
Browse files Browse the repository at this point in the history
Users are puzzled when they use tuned performance and all their
C-states vanish.  Dump /dev/cpu_dma_latency and state
whether the value is default, or constraining,
to explain this situation.

Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
lenb committed Sep 3, 2020
1 parent e00b62f commit d76bb7a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -4698,6 +4698,32 @@ unsigned int intel_model_duplicates(unsigned int model)
}
return model;
}

void print_dev_latency(void)
{
char *path = "/dev/cpu_dma_latency";
int fd;
int value;
int retval;

fd = open(path, O_RDONLY);
if (fd < 0) {
warn("fopen %s\n", path);
return;
}

retval = read(fd, (void *)&value, sizeof(int));
if (retval != sizeof(int)) {
warn("read %s\n", path);
close(fd);
return;
}
fprintf(outf, "/dev/cpu_dma_latency: %d usec (%s)\n",
value, value == 2000000000 ? "default" : "constrained");

close(fd);
}

void process_cpuid()
{
unsigned int eax, ebx, ecx, edx;
Expand Down Expand Up @@ -4966,6 +4992,8 @@ void process_cpuid()
if (!quiet)
dump_cstate_pstate_config_info(family, model);

if (!quiet)
print_dev_latency();
if (!quiet)
dump_sysfs_cstate_config();
if (!quiet)
Expand Down

0 comments on commit d76bb7a

Please sign in to comment.