diff options
author | Len Brown <len.brown@intel.com> | 2012-09-21 22:56:06 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-09-26 18:17:21 -0400 |
commit | 130ff304f6d31484fc73bb337bc635cba1ffe04c (patch) | |
tree | 16d9cd992fc4b39c2907dd3564352400b70efc75 /tools | |
parent | 6574a5d5053cd3b8e7c088900b80a9ff51895450 (diff) |
tools/power turbostat: make -M output pretty
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 <len.brown@intel.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 5db4addbe1d9..5ce88dd8c95a 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c | |||
@@ -223,6 +223,8 @@ void print_header(void) | |||
223 | if (has_aperf) | 223 | if (has_aperf) |
224 | outp += sprintf(outp, " GHz"); | 224 | outp += sprintf(outp, " GHz"); |
225 | outp += sprintf(outp, " TSC"); | 225 | outp += sprintf(outp, " TSC"); |
226 | if (extra_msr_offset) | ||
227 | outp += sprintf(outp, " MSR 0x%04X", extra_msr_offset); | ||
226 | if (do_nhm_cstates) | 228 | if (do_nhm_cstates) |
227 | outp += sprintf(outp, " %%c1"); | 229 | outp += sprintf(outp, " %%c1"); |
228 | if (do_nhm_cstates) | 230 | if (do_nhm_cstates) |
@@ -239,8 +241,6 @@ void print_header(void) | |||
239 | outp += sprintf(outp, " %%pc6"); | 241 | outp += sprintf(outp, " %%pc6"); |
240 | if (do_snb_cstates) | 242 | if (do_snb_cstates) |
241 | outp += sprintf(outp, " %%pc7"); | 243 | outp += sprintf(outp, " %%pc7"); |
242 | if (extra_msr_offset) | ||
243 | outp += sprintf(outp, " MSR 0x%x ", extra_msr_offset); | ||
244 | 244 | ||
245 | outp += sprintf(outp, "\n"); | 245 | outp += sprintf(outp, "\n"); |
246 | } | 246 | } |
@@ -361,6 +361,10 @@ int format_counters(struct thread_data *t, struct core_data *c, | |||
361 | /* TSC */ | 361 | /* TSC */ |
362 | outp += sprintf(outp, "%5.2f", 1.0 * t->tsc/units/interval_float); | 362 | outp += sprintf(outp, "%5.2f", 1.0 * t->tsc/units/interval_float); |
363 | 363 | ||
364 | /* MSR */ | ||
365 | if (extra_msr_offset) | ||
366 | outp += sprintf(outp, " 0x%016llx", t->extra_msr); | ||
367 | |||
364 | if (do_nhm_cstates) { | 368 | if (do_nhm_cstates) { |
365 | if (!skip_c1) | 369 | if (!skip_c1) |
366 | outp += sprintf(outp, " %6.2f", 100.0 * t->c1/t->tsc); | 370 | outp += sprintf(outp, " %6.2f", 100.0 * t->c1/t->tsc); |
@@ -392,8 +396,6 @@ int format_counters(struct thread_data *t, struct core_data *c, | |||
392 | if (do_snb_cstates) | 396 | if (do_snb_cstates) |
393 | outp += sprintf(outp, " %6.2f", 100.0 * p->pc7/t->tsc); | 397 | outp += sprintf(outp, " %6.2f", 100.0 * p->pc7/t->tsc); |
394 | done: | 398 | done: |
395 | if (extra_msr_offset) | ||
396 | outp += sprintf(outp, " 0x%016llx", t->extra_msr); | ||
397 | outp += sprintf(outp, "\n"); | 399 | outp += sprintf(outp, "\n"); |
398 | 400 | ||
399 | return 0; | 401 | return 0; |