diff options
author | Len Brown <len.brown@intel.com> | 2012-10-06 15:26:31 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-10-06 15:26:31 -0400 |
commit | f9240813e61cb3e5838c9ab0237af831c61df7cf (patch) | |
tree | 8408a94902f3247f7feeca042a9283f6c5280e34 /tools | |
parent | 8e180f3cb6b7510a3bdf14e16ce87c9f5d86f102 (diff) |
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 'tools')
-rw-r--r-- | tools/power/x86/turbostat/turbostat.8 | 12 | ||||
-rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 23 |
2 files changed, 20 insertions, 15 deletions
diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8 index 0fc7a11f300e..e4d0690cccf9 100644 --- a/tools/power/x86/turbostat/turbostat.8 +++ b/tools/power/x86/turbostat/turbostat.8 | |||
@@ -23,17 +23,19 @@ supports an "invariant" TSC, plus the APERF and MPERF MSRs. | |||
23 | on processors that additionally support C-state residency counters. | 23 | on processors that additionally support C-state residency counters. |
24 | 24 | ||
25 | .SS Options | 25 | .SS Options |
26 | The \fB-s\fP option limits output to a 1-line system summary for each interval. | 26 | The \fB-p\fP option limits output to the 1st thread in 1st core of each package. |
27 | .PP | 27 | .PP |
28 | The \fB-c\fP option limits output to the 1st thread in each core. | 28 | The \fB-P\fP option limits output to the 1st thread in each Package. |
29 | .PP | 29 | .PP |
30 | The \fB-p\fP option limits output to the 1st thread in each package. | 30 | The \fB-S\fP option limits output to a 1-line System Summary for each interval. |
31 | .PP | 31 | .PP |
32 | The \fB-v\fP option increases verbosity. | 32 | The \fB-v\fP option increases verbosity. |
33 | .PP | 33 | .PP |
34 | The \fB-d MSR#\fP option includes the delta of the specified 32-bit MSR counter. | 34 | The \fB-s\fP option prints the SMI counter, equivalent to "-c 0x34" |
35 | .PP | 35 | .PP |
36 | The \fB-D MSR#\fP option includes the delta of the specified 64-bit MSR counter. | 36 | The \fB-c MSR#\fP option includes the delta of the specified 32-bit MSR counter. |
37 | .PP | ||
38 | The \fB-C MSR#\fP option includes the delta of the specified 64-bit MSR counter. | ||
37 | .PP | 39 | .PP |
38 | The \fB-m MSR#\fP option includes the the specified 32-bit MSR value. | 40 | The \fB-m MSR#\fP option includes the the specified 32-bit MSR value. |
39 | .PP | 41 | .PP |
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) | |||
230 | outp += sprintf(outp, " GHz"); | 230 | outp += sprintf(outp, " GHz"); |
231 | outp += sprintf(outp, " TSC"); | 231 | outp += sprintf(outp, " TSC"); |
232 | if (extra_delta_offset32) | 232 | if (extra_delta_offset32) |
233 | outp += sprintf(outp, " delta 0x%03X", extra_delta_offset32); | 233 | outp += sprintf(outp, " count 0x%03X", extra_delta_offset32); |
234 | if (extra_delta_offset64) | 234 | if (extra_delta_offset64) |
235 | outp += sprintf(outp, " DELTA 0x%03X", extra_delta_offset64); | 235 | outp += sprintf(outp, " COUNT 0x%03X", extra_delta_offset64); |
236 | if (extra_msr_offset32) | 236 | if (extra_msr_offset32) |
237 | outp += sprintf(outp, " MSR 0x%03X", extra_msr_offset32); | 237 | outp += sprintf(outp, " MSR 0x%03X", extra_msr_offset32); |
238 | if (extra_msr_offset64) | 238 | if (extra_msr_offset64) |
@@ -1304,7 +1304,7 @@ void check_cpuid() | |||
1304 | 1304 | ||
1305 | void usage() | 1305 | void usage() |
1306 | { | 1306 | { |
1307 | fprintf(stderr, "%s: [-v][-d MSR#][-D MSR#][-m MSR#][-M MSR#][-i interval_sec | command ...]\n", | 1307 | fprintf(stderr, "%s: [-v][-p|-P|-S][-c MSR# | -s]][-C MSR#][-m MSR#][-M MSR#][-i interval_sec | command ...]\n", |
1308 | progname); | 1308 | progname); |
1309 | exit(1); | 1309 | exit(1); |
1310 | } | 1310 | } |
@@ -1594,15 +1594,15 @@ void cmdline(int argc, char **argv) | |||
1594 | 1594 | ||
1595 | progname = argv[0]; | 1595 | progname = argv[0]; |
1596 | 1596 | ||
1597 | while ((opt = getopt(argc, argv, "+cpsvid:D:m:M:")) != -1) { | 1597 | while ((opt = getopt(argc, argv, "+pPSvisc:sC:m:M:")) != -1) { |
1598 | switch (opt) { | 1598 | switch (opt) { |
1599 | case 'c': | 1599 | case 'p': |
1600 | show_core_only++; | 1600 | show_core_only++; |
1601 | break; | 1601 | break; |
1602 | case 'p': | 1602 | case 'P': |
1603 | show_pkg_only++; | 1603 | show_pkg_only++; |
1604 | break; | 1604 | break; |
1605 | case 's': | 1605 | case 'S': |
1606 | summary_only++; | 1606 | summary_only++; |
1607 | break; | 1607 | break; |
1608 | case 'v': | 1608 | case 'v': |
@@ -1611,10 +1611,13 @@ void cmdline(int argc, char **argv) | |||
1611 | case 'i': | 1611 | case 'i': |
1612 | interval_sec = atoi(optarg); | 1612 | interval_sec = atoi(optarg); |
1613 | break; | 1613 | break; |
1614 | case 'd': | 1614 | case 'c': |
1615 | sscanf(optarg, "%x", &extra_delta_offset32); | 1615 | sscanf(optarg, "%x", &extra_delta_offset32); |
1616 | break; | 1616 | break; |
1617 | case 'D': | 1617 | case 's': |
1618 | extra_delta_offset32 = 0x34; /* SMI counter */ | ||
1619 | break; | ||
1620 | case 'C': | ||
1618 | sscanf(optarg, "%x", &extra_delta_offset64); | 1621 | sscanf(optarg, "%x", &extra_delta_offset64); |
1619 | break; | 1622 | break; |
1620 | case 'm': | 1623 | case 'm': |
@@ -1634,7 +1637,7 @@ int main(int argc, char **argv) | |||
1634 | cmdline(argc, argv); | 1637 | cmdline(argc, argv); |
1635 | 1638 | ||
1636 | if (verbose > 1) | 1639 | if (verbose > 1) |
1637 | fprintf(stderr, "turbostat v2.0 May 16, 2012" | 1640 | fprintf(stderr, "turbostat v2.1 October 6, 2012" |
1638 | " - Len Brown <lenb@kernel.org>\n"); | 1641 | " - Len Brown <lenb@kernel.org>\n"); |
1639 | 1642 | ||
1640 | turbostat_init(); | 1643 | turbostat_init(); |