Skip to content

Commit 6b39862

Browse files
sumeetpawnikarlenb
authored andcommitted
tools/power turbostat: print power values upto three decimal
Print power values upto three decimal places in watts. Suggested-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent f52ba93 commit 6b39862

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/power/x86/turbostat/turbostat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4703,7 +4703,7 @@ int print_thermal(struct thread_data *t, struct core_data *c, struct pkg_data *p
47034703

47044704
void print_power_limit_msr(int cpu, unsigned long long msr, char *label)
47054705
{
4706-
fprintf(outf, "cpu%d: %s: %sabled (%f Watts, %f sec, clamp %sabled)\n",
4706+
fprintf(outf, "cpu%d: %s: %sabled (%0.3f Watts, %f sec, clamp %sabled)\n",
47074707
cpu, label,
47084708
((msr >> 15) & 1) ? "EN" : "DIS",
47094709
((msr >> 0) & 0x7FFF) * rapl_power_units,
@@ -4767,7 +4767,7 @@ int print_rapl(struct thread_data *t, struct core_data *c, struct pkg_data *p)
47674767
cpu, msr, (msr >> 63) & 1 ? "" : "UN");
47684768

47694769
print_power_limit_msr(cpu, msr, "PKG Limit #1");
4770-
fprintf(outf, "cpu%d: PKG Limit #2: %sabled (%f Watts, %f* sec, clamp %sabled)\n",
4770+
fprintf(outf, "cpu%d: PKG Limit #2: %sabled (%0.3f Watts, %f* sec, clamp %sabled)\n",
47714771
cpu,
47724772
((msr >> 47) & 1) ? "EN" : "DIS",
47734773
((msr >> 32) & 0x7FFF) * rapl_power_units,

0 commit comments

Comments
 (0)