mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
tools/power turbostat: Allow multiple --cpu on cmdline
If --cpu is on the cmdline more than once, previous invocations are forgotten (and their cpu_set is leaked). Allow multiple invocations of --cpu on the cmdline. OR them together, reusing the same cpu_set. Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
d895f1596d
commit
1a0bd1bfad
|
|
@ -92,7 +92,7 @@ name as necessary to disambiguate it from others is necessary. Note that option
|
|||
'%x' hex identifier of the PMT MMIO region.
|
||||
.fi
|
||||
.PP
|
||||
\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
|
||||
\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 Multiple invocations of --cpu are OR'd together.
|
||||
.PP
|
||||
\fB--hide column\fP do not show the specified built-in columns. May be invoked multiple times, or with a comma-separated list of column names.
|
||||
.PP
|
||||
|
|
|
|||
|
|
@ -11552,16 +11552,18 @@ void parse_cpu_command(char *optarg)
|
|||
if (show_core_only || show_pkg_only)
|
||||
goto error;
|
||||
|
||||
cpu_subset = CPU_ALLOC(topo.max_cpu_num + 1);
|
||||
if (cpu_subset == NULL)
|
||||
err(3, "CPU_ALLOC");
|
||||
if (!cpu_subset) {
|
||||
cpu_subset = CPU_ALLOC(topo.max_cpu_num + 1);
|
||||
if (cpu_subset == NULL)
|
||||
err(3, "CPU_ALLOC");
|
||||
|
||||
CPU_ZERO_S(cpu_setsize, cpu_subset);
|
||||
CPU_ZERO_S(cpu_setsize, cpu_subset);
|
||||
}
|
||||
|
||||
if (parse_cpu_str(optarg, cpu_subset, cpu_setsize))
|
||||
goto error;
|
||||
if (debug)
|
||||
print_cpu_set("cpu subsetset", cpu_subset);
|
||||
print_cpu_set("--cpu", cpu_subset);
|
||||
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user