aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/x86/turbostat/turbostat.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2012-10-06 15:26:31 -0400
committerLen Brown <len.brown@intel.com>2012-10-06 15:26:31 -0400
commitf9240813e61cb3e5838c9ab0237af831c61df7cf (patch)
tree8408a94902f3247f7feeca042a9283f6c5280e34 /tools/power/x86/turbostat/turbostat.c
parenttools/power turbostat: add [-d MSR#][-D MSR#] options to print counter deltas (diff)
downloadlinux-dev-f9240813e61cb3e5838c9ab0237af831c61df7cf.tar.xz
linux-dev-f9240813e61cb3e5838c9ab0237af831c61df7cf.zip
tools/power/turbostat: add option to count SMIs, re-name some options
Counting SMIs is popular, so add a dedicated "-s" option to do it, and juggle some of the other option letters. -S is now system summary (was -s) -c is 32 bit counter (was -d) -C is 64-bit counter (was -D) -p is 1st thread in core (was -c) -P is 1st thread in package (was -p) bump the minor version number Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to '')
-rw-r--r--tools/power/x86/turbostat/turbostat.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index e38976c0b0a2..2655ae9a3ad8 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -230,9 +230,9 @@ void print_header(void)
outp += sprintf(outp, " GHz");
outp += sprintf(outp, " TSC");
if (extra_delta_offset32)
- outp += sprintf(outp, " delta 0x%03X", extra_delta_offset32);
+ outp += sprintf(outp, " count 0x%03X", extra_delta_offset32);
if (extra_delta_offset64)
- outp += sprintf(outp, " DELTA 0x%03X", extra_delta_offset64);
+ outp += sprintf(outp, " COUNT 0x%03X", extra_delta_offset64);
if (extra_msr_offset32)
outp += sprintf(outp, " MSR 0x%03X", extra_msr_offset32);
if (extra_msr_offset64)
@@ -1304,7 +1304,7 @@ void check_cpuid()
void usage()
{
- fprintf(stderr, "%s: [-v][-d MSR#][-D MSR#][-m MSR#][-M MSR#][-i interval_sec | command ...]\n",
+ fprintf(stderr, "%s: [-v][-p|-P|-S][-c MSR# | -s]][-C MSR#][-m MSR#][-M MSR#][-i interval_sec | command ...]\n",
progname);
exit(1);
}
@@ -1594,15 +1594,15 @@ void cmdline(int argc, char **argv)
progname = argv[0];
- while ((opt = getopt(argc, argv, "+cpsvid:D:m:M:")) != -1) {
+ while ((opt = getopt(argc, argv, "+pPSvisc:sC:m:M:")) != -1) {
switch (opt) {
- case 'c':
+ case 'p':
show_core_only++;
break;
- case 'p':
+ case 'P':
show_pkg_only++;
break;
- case 's':
+ case 'S':
summary_only++;
break;
case 'v':
@@ -1611,10 +1611,13 @@ void cmdline(int argc, char **argv)
case 'i':
interval_sec = atoi(optarg);
break;
- case 'd':
+ case 'c':
sscanf(optarg, "%x", &extra_delta_offset32);
break;
- case 'D':
+ case 's':
+ extra_delta_offset32 = 0x34; /* SMI counter */
+ break;
+ case 'C':
sscanf(optarg, "%x", &extra_delta_offset64);
break;
case 'm':
@@ -1634,7 +1637,7 @@ int main(int argc, char **argv)
cmdline(argc, argv);
if (verbose > 1)
- fprintf(stderr, "turbostat v2.0 May 16, 2012"
+ fprintf(stderr, "turbostat v2.1 October 6, 2012"
" - Len Brown <lenb@kernel.org>\n");
turbostat_init();