Skip to content

Commit 6886fee

Browse files
committed
tools/power turbostat: remove obsolete -M, -m, -C, -c options
The new --add option has replaced the -M, -m, -C, -c options Eg. -M 0x10 is now --add msr0x10,raw -m 0x10 is now --add msr0x10,raw,u32 -C 0x10 is now --add msr0x10,delta -c 0x10 is now --add msr0x10,delta,u32 The --add option can be repeated to add any number of counters, while the previous options were limited to adding one of each type. In addition, the --add option can accept a column label, and can also display a counter as a percentage of elapsed cycles. Eg. --add msr0x3fe,core,percent,MY_CC3 Signed-off-by: Len Brown <[email protected]>
1 parent 388e9c8 commit 6886fee

File tree

2 files changed

+2
-110
lines changed

2 files changed

+2
-110
lines changed

tools/power/x86/turbostat/turbostat.8

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ name as necessary to disambiguate it from others is necessary. Note that option
4747
default: delta
4848
.fi
4949
.PP
50-
\fB--Counter MSR#\fP shows the delta of the specified 64-bit MSR counter.
51-
.PP
52-
\fB--counter MSR#\fP shows the delta of the specified 32-bit MSR counter.
53-
.PP
5450
\fB--Dump\fP displays the raw counter values.
5551
.PP
5652
\fB--debug\fP displays additional system configuration information. Invoking this parameter
@@ -65,10 +61,6 @@ The file is truncated if it already exists, and it is created if it does not exi
6561
.PP
6662
\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
6763
.PP
68-
\fB--MSR MSR#\fP shows the specified 64-bit MSR value.
69-
.PP
70-
\fB--msr MSR#\fP shows the specified 32-bit MSR value.
71-
.PP
7264
\fB--Package\fP limits output to the system summary plus the 1st thread in each Package.
7365
.PP
7466
\fB--processor\fP limits output to the system summary plus the 1st thread in each processor of each package. Ie. it skips hyper-threaded siblings.

tools/power/x86/turbostat/turbostat.c

Lines changed: 2 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ unsigned int units = 1000000; /* MHz etc */
7171
unsigned int genuine_intel;
7272
unsigned int has_invariant_tsc;
7373
unsigned int do_nhm_platform_info;
74-
unsigned int extra_msr_offset32;
75-
unsigned int extra_msr_offset64;
76-
unsigned int extra_delta_offset32;
77-
unsigned int extra_delta_offset64;
7874
unsigned int aperf_mperf_multiplier = 1;
7975
int do_irq = 1;
8076
int do_smi;
@@ -164,10 +160,6 @@ struct thread_data {
164160
unsigned long long aperf;
165161
unsigned long long mperf;
166162
unsigned long long c1;
167-
unsigned long long extra_msr64;
168-
unsigned long long extra_delta64;
169-
unsigned long long extra_msr32;
170-
unsigned long long extra_delta32;
171163
unsigned int irq_count;
172164
unsigned int smi_count;
173165
unsigned int cpu_id;
@@ -372,15 +364,6 @@ void print_header(void)
372364
outp += sprintf(outp, "\tBzy_MHz");
373365
outp += sprintf(outp, "\tTSC_MHz");
374366

375-
if (extra_delta_offset32)
376-
outp += sprintf(outp, "\tcount 0x%03X", extra_delta_offset32);
377-
if (extra_delta_offset64)
378-
outp += sprintf(outp, "\tCOUNT 0x%03X", extra_delta_offset64);
379-
if (extra_msr_offset32)
380-
outp += sprintf(outp, "\t MSR 0x%03X", extra_msr_offset32);
381-
if (extra_msr_offset64)
382-
outp += sprintf(outp, "\tMSR 0x%03X", extra_msr_offset64);
383-
384367
if (!debug)
385368
goto done;
386369

@@ -510,14 +493,7 @@ int dump_counters(struct thread_data *t, struct core_data *c,
510493
outp += sprintf(outp, "aperf: %016llX\n", t->aperf);
511494
outp += sprintf(outp, "mperf: %016llX\n", t->mperf);
512495
outp += sprintf(outp, "c1: %016llX\n", t->c1);
513-
outp += sprintf(outp, "msr0x%x: %08llX\n",
514-
extra_delta_offset32, t->extra_delta32);
515-
outp += sprintf(outp, "msr0x%x: %016llX\n",
516-
extra_delta_offset64, t->extra_delta64);
517-
outp += sprintf(outp, "msr0x%x: %08llX\n",
518-
extra_msr_offset32, t->extra_msr32);
519-
outp += sprintf(outp, "msr0x%x: %016llX\n",
520-
extra_msr_offset64, t->extra_msr64);
496+
521497
if (do_irq)
522498
outp += sprintf(outp, "IRQ: %08X\n", t->irq_count);
523499
if (do_smi)
@@ -648,21 +624,6 @@ int format_counters(struct thread_data *t, struct core_data *c,
648624
/* TSC_MHz */
649625
outp += sprintf(outp, "\t%.0f", 1.0 * t->tsc/units/interval_float);
650626

651-
/* delta */
652-
if (extra_delta_offset32)
653-
outp += sprintf(outp, "\t%11llu", t->extra_delta32);
654-
655-
/* DELTA */
656-
if (extra_delta_offset64)
657-
outp += sprintf(outp, "\t%11llu", t->extra_delta64);
658-
/* msr */
659-
if (extra_msr_offset32)
660-
outp += sprintf(outp, "\t0x%08llx", t->extra_msr32);
661-
662-
/* MSR */
663-
if (extra_msr_offset64)
664-
outp += sprintf(outp, "\t0x%016llx", t->extra_msr64);
665-
666627
if (!debug)
667628
goto done;
668629

@@ -991,17 +952,6 @@ delta_thread(struct thread_data *new, struct thread_data *old,
991952
old->mperf = 1; /* divide by 0 protection */
992953
}
993954

994-
old->extra_delta32 = new->extra_delta32 - old->extra_delta32;
995-
old->extra_delta32 &= 0xFFFFFFFF;
996-
997-
old->extra_delta64 = new->extra_delta64 - old->extra_delta64;
998-
999-
/*
1000-
* Extra MSR is just a snapshot, simply copy latest w/o subtracting
1001-
*/
1002-
old->extra_msr32 = new->extra_msr32;
1003-
old->extra_msr64 = new->extra_msr64;
1004-
1005955
if (do_irq)
1006956
old->irq_count = new->irq_count - old->irq_count;
1007957

@@ -1049,9 +999,6 @@ void clear_counters(struct thread_data *t, struct core_data *c, struct pkg_data
1049999
t->mperf = 0;
10501000
t->c1 = 0;
10511001

1052-
t->extra_delta32 = 0;
1053-
t->extra_delta64 = 0;
1054-
10551002
t->irq_count = 0;
10561003
t->smi_count = 0;
10571004

@@ -1110,9 +1057,6 @@ int sum_counters(struct thread_data *t, struct core_data *c,
11101057
average.threads.mperf += t->mperf;
11111058
average.threads.c1 += t->c1;
11121059

1113-
average.threads.extra_delta32 += t->extra_delta32;
1114-
average.threads.extra_delta64 += t->extra_delta64;
1115-
11161060
average.threads.irq_count += t->irq_count;
11171061
average.threads.smi_count += t->smi_count;
11181062

@@ -1199,11 +1143,6 @@ void compute_average(struct thread_data *t, struct core_data *c,
11991143
average.threads.mperf /= topo.num_cpus;
12001144
average.threads.c1 /= topo.num_cpus;
12011145

1202-
average.threads.extra_delta32 /= topo.num_cpus;
1203-
average.threads.extra_delta32 &= 0xFFFFFFFF;
1204-
1205-
average.threads.extra_delta64 /= topo.num_cpus;
1206-
12071146
average.cores.c3 /= topo.num_cores;
12081147
average.cores.c6 /= topo.num_cores;
12091148
average.cores.c7 /= topo.num_cores;
@@ -1337,25 +1276,6 @@ int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
13371276
return -5;
13381277
t->smi_count = msr & 0xFFFFFFFF;
13391278
}
1340-
if (extra_delta_offset32) {
1341-
if (get_msr(cpu, extra_delta_offset32, &msr))
1342-
return -5;
1343-
t->extra_delta32 = msr & 0xFFFFFFFF;
1344-
}
1345-
1346-
if (extra_delta_offset64)
1347-
if (get_msr(cpu, extra_delta_offset64, &t->extra_delta64))
1348-
return -5;
1349-
1350-
if (extra_msr_offset32) {
1351-
if (get_msr(cpu, extra_msr_offset32, &msr))
1352-
return -5;
1353-
t->extra_msr32 = msr & 0xFFFFFFFF;
1354-
}
1355-
1356-
if (extra_msr_offset64)
1357-
if (get_msr(cpu, extra_msr_offset64, &t->extra_msr64))
1358-
return -5;
13591279

13601280
if (use_c1_residency_msr) {
13611281
if (get_msr(cpu, MSR_CORE_C1_RES, &t->c1))
@@ -3619,11 +3539,7 @@ void help()
36193539
"--debug run in \"debug\" mode\n"
36203540
"--interval sec Override default 5-second measurement interval\n"
36213541
"--help print this help message\n"
3622-
"--counter msr print 32-bit counter at address \"msr\"\n"
3623-
"--Counter msr print 64-bit Counter at address \"msr\"\n"
36243542
"--out file create or truncate \"file\" for all output\n"
3625-
"--msr msr print 32-bit value at address \"msr\"\n"
3626-
"--MSR msr print 64-bit Value at address \"msr\"\n"
36273543
"--version print version information\n"
36283544
"\n"
36293545
"For more help, run \"man turbostat\"\n");
@@ -3960,7 +3876,7 @@ int get_and_dump_counters(void)
39603876
}
39613877

39623878
void print_version() {
3963-
fprintf(outf, "turbostat version 4.15 21 Dec 2016"
3879+
fprintf(outf, "turbostat version 4.16 24 Dec 2016"
39643880
" - Len Brown <[email protected]>\n");
39653881
}
39663882

@@ -4119,15 +4035,11 @@ void cmdline(int argc, char **argv)
41194035
int option_index = 0;
41204036
static struct option long_options[] = {
41214037
{"add", required_argument, 0, 'a'},
4122-
{"Counter", required_argument, 0, 'C'},
4123-
{"counter", required_argument, 0, 'c'},
41244038
{"Dump", no_argument, 0, 'D'},
41254039
{"debug", no_argument, 0, 'd'},
41264040
{"interval", required_argument, 0, 'i'},
41274041
{"help", no_argument, 0, 'h'},
41284042
{"Joules", no_argument, 0, 'J'},
4129-
{"MSR", required_argument, 0, 'M'},
4130-
{"msr", required_argument, 0, 'm'},
41314043
{"out", required_argument, 0, 'o'},
41324044
{"Package", no_argument, 0, 'p'},
41334045
{"processor", no_argument, 0, 'p'},
@@ -4145,12 +4057,6 @@ void cmdline(int argc, char **argv)
41454057
case 'a':
41464058
parse_add_command(optarg);
41474059
break;
4148-
case 'C':
4149-
sscanf(optarg, "%x", &extra_delta_offset64);
4150-
break;
4151-
case 'c':
4152-
sscanf(optarg, "%x", &extra_delta_offset32);
4153-
break;
41544060
case 'D':
41554061
dump_only++;
41564062
break;
@@ -4178,12 +4084,6 @@ void cmdline(int argc, char **argv)
41784084
case 'J':
41794085
rapl_joules++;
41804086
break;
4181-
case 'M':
4182-
sscanf(optarg, "%x", &extra_msr_offset64);
4183-
break;
4184-
case 'm':
4185-
sscanf(optarg, "%x", &extra_msr_offset32);
4186-
break;
41874087
case 'o':
41884088
outf = fopen_or_die(optarg, "w");
41894089
break;

0 commit comments

Comments
 (0)