Commit 4e4e1e7c authored by Len Brown's avatar Len Brown

tools/power turbostat: move --Package and --processor into the --cpu option

--Package is now "--cpu package",
which will display just the 1st CPU in each package

--processor is not "--cpu core"
which will display just the 1st CPU in each core
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent da67e2b9
...@@ -52,7 +52,7 @@ name as necessary to disambiguate it from others is necessary. Note that option ...@@ -52,7 +52,7 @@ name as necessary to disambiguate it from others is necessary. Note that option
as the column header. as the column header.
.fi .fi
.PP .PP
\fB--cpu cpu-set\fP limit output to system summary plus the specified cpu-set. cpu-set is a comma delimited list of cpu ranges. cpu ranges can be individual cpu numbers or start and end numbers, separated by ".." or '-'. eg. 1,2,8,14..17,21-44 \fB--cpu cpu-set\fP limit output to system summary plus the specified cpu-set. If cpu-set is the string "core", then the system summary plus the first CPU in each core are printed -- eg. subsequent HT siblings are not printed. Or if cpu-set is the string "package", then the system summary plus the first CPU in each package is printed. Otherwise, the system summary plus the specified set of CPUs are printed. The cpu-set is ordered from low to high, comma delimited with ".." and "-" permitted to denote a range. eg. 1,2,8,14..17,21-44
.PP .PP
\fB--hide column\fP do not show the specified columns. May be invoked multiple times, or with a comma-separated list of column names. Use "--hide sysfs" to hide the sysfs statistics columns as a group. \fB--hide column\fP do not show the specified columns. May be invoked multiple times, or with a comma-separated list of column names. Use "--hide sysfs" to hide the sysfs statistics columns as a group.
.PP .PP
...@@ -71,12 +71,8 @@ The file is truncated if it already exists, and it is created if it does not exi ...@@ -71,12 +71,8 @@ The file is truncated if it already exists, and it is created if it does not exi
.PP .PP
\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts. \fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
.PP .PP
\fB--Package\fP limits output to the system summary plus the 1st thread in each Package.
.PP
\fB--list\fP display column header names available for use by --show and --hide, then exit. \fB--list\fP display column header names available for use by --show and --hide, then exit.
.PP .PP
\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.
.PP
\fB--Summary\fP limits output to a 1-line System Summary for each interval. \fB--Summary\fP limits output to a 1-line System Summary for each interval.
.PP .PP
\fB--TCC temperature\fP sets the Thermal Control Circuit temperature for systems which do not export that value. This is used for making sense of the Digital Thermal Sensor outputs, as they return degrees Celsius below the TCC activation temperature. \fB--TCC temperature\fP sets the Thermal Control Circuit temperature for systems which do not export that value. This is used for making sense of the Digital Thermal Sensor outputs, as they return degrees Celsius below the TCC activation temperature.
......
...@@ -4153,7 +4153,8 @@ void help() ...@@ -4153,7 +4153,8 @@ void help()
"to print statistics, until interrupted.\n" "to print statistics, until interrupted.\n"
"--add add a counter\n" "--add add a counter\n"
" eg. --add msr0x10,u64,cpu,delta,MY_TSC\n" " eg. --add msr0x10,u64,cpu,delta,MY_TSC\n"
"--cpu cpu-set limit output to summary plus cpu-set cpu-set\n" "--cpu cpu-set limit output to summary plus cpu-set:\n"
" {core | package | j,k,l..m,n-p }\n"
"--quiet skip decoding system configuration header\n" "--quiet skip decoding system configuration header\n"
"--interval sec Override default 5-second measurement interval\n" "--interval sec Override default 5-second measurement interval\n"
"--help print this help message\n" "--help print this help message\n"
...@@ -4756,6 +4757,21 @@ void parse_cpu_command(char *optarg) ...@@ -4756,6 +4757,21 @@ void parse_cpu_command(char *optarg)
unsigned int start, end; unsigned int start, end;
char *next; char *next;
if (!strcmp(optarg, "core")) {
if (cpu_subset)
goto error;
show_core_only++;
return;
}
if (!strcmp(optarg, "package")) {
if (cpu_subset)
goto error;
show_pkg_only++;
return;
}
if (show_core_only || show_pkg_only)
goto error;
cpu_subset = CPU_ALLOC(CPU_SUBSET_MAXCPUS); cpu_subset = CPU_ALLOC(CPU_SUBSET_MAXCPUS);
if (cpu_subset == NULL) if (cpu_subset == NULL)
err(3, "CPU_ALLOC"); err(3, "CPU_ALLOC");
...@@ -4813,7 +4829,8 @@ void parse_cpu_command(char *optarg) ...@@ -4813,7 +4829,8 @@ void parse_cpu_command(char *optarg)
return; return;
error: error:
fprintf(stderr, "'--cpu %s' malformed\n", optarg); fprintf(stderr, "\"--cpu %s\" malformed\n", optarg);
help();
exit(-1); exit(-1);
} }
...@@ -4867,8 +4884,6 @@ void cmdline(int argc, char **argv) ...@@ -4867,8 +4884,6 @@ void cmdline(int argc, char **argv)
{"Joules", no_argument, 0, 'J'}, {"Joules", no_argument, 0, 'J'},
{"list", no_argument, 0, 'l'}, {"list", no_argument, 0, 'l'},
{"out", required_argument, 0, 'o'}, {"out", required_argument, 0, 'o'},
{"Package", no_argument, 0, 'p'},
{"processor", no_argument, 0, 'p'},
{"quiet", no_argument, 0, 'q'}, {"quiet", no_argument, 0, 'q'},
{"show", required_argument, 0, 's'}, {"show", required_argument, 0, 's'},
{"Summary", no_argument, 0, 'S'}, {"Summary", no_argument, 0, 'S'},
...@@ -4879,7 +4894,7 @@ void cmdline(int argc, char **argv) ...@@ -4879,7 +4894,7 @@ void cmdline(int argc, char **argv)
progname = argv[0]; progname = argv[0];
while ((opt = getopt_long_only(argc, argv, "+C:c:Ddhi:JM:m:o:PpqST:v", while ((opt = getopt_long_only(argc, argv, "+C:c:Ddhi:JM:m:o:qST:v",
long_options, &option_index)) != -1) { long_options, &option_index)) != -1) {
switch (opt) { switch (opt) {
case 'a': case 'a':
...@@ -4925,12 +4940,6 @@ void cmdline(int argc, char **argv) ...@@ -4925,12 +4940,6 @@ void cmdline(int argc, char **argv)
case 'o': case 'o':
outf = fopen_or_die(optarg, "w"); outf = fopen_or_die(optarg, "w");
break; break;
case 'P':
show_pkg_only++;
break;
case 'p':
show_core_only++;
break;
case 'q': case 'q':
quiet = 1; quiet = 1;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment