Skip to content

Commit

Permalink
tools/power turbostat: make -M output pretty
Browse files Browse the repository at this point in the history
The -M option dumps the specified 64-bit MSR with every sample.

Previously it was output at the end of each line.
However, with the v2 style of printing, the lines are now staggered,
making MSR output hard to read.

So move the MSR output column to the left where things are aligned.

Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
lenb committed Sep 26, 2012
1 parent 6574a5d commit 130ff30
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ void print_header(void)
if (has_aperf)
outp += sprintf(outp, " GHz");
outp += sprintf(outp, " TSC");
if (extra_msr_offset)
outp += sprintf(outp, " MSR 0x%04X", extra_msr_offset);
if (do_nhm_cstates)
outp += sprintf(outp, " %%c1");
if (do_nhm_cstates)
Expand All @@ -239,8 +241,6 @@ void print_header(void)
outp += sprintf(outp, " %%pc6");
if (do_snb_cstates)
outp += sprintf(outp, " %%pc7");
if (extra_msr_offset)
outp += sprintf(outp, " MSR 0x%x ", extra_msr_offset);

outp += sprintf(outp, "\n");
}
Expand Down Expand Up @@ -361,6 +361,10 @@ int format_counters(struct thread_data *t, struct core_data *c,
/* TSC */
outp += sprintf(outp, "%5.2f", 1.0 * t->tsc/units/interval_float);

/* MSR */
if (extra_msr_offset)
outp += sprintf(outp, " 0x%016llx", t->extra_msr);

if (do_nhm_cstates) {
if (!skip_c1)
outp += sprintf(outp, " %6.2f", 100.0 * t->c1/t->tsc);
Expand Down Expand Up @@ -392,8 +396,6 @@ int format_counters(struct thread_data *t, struct core_data *c,
if (do_snb_cstates)
outp += sprintf(outp, " %6.2f", 100.0 * p->pc7/t->tsc);
done:
if (extra_msr_offset)
outp += sprintf(outp, " 0x%016llx", t->extra_msr);
outp += sprintf(outp, "\n");

return 0;
Expand Down

0 comments on commit 130ff30

Please sign in to comment.