summaryrefslogtreecommitdiffstats
path: root/tools/power/x86
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2017-02-21 22:33:42 -0500
committerLen Brown <len.brown@intel.com>2017-03-01 00:14:24 -0500
commit4e4e1e7c6eaf387f8ec803f37f154fdd60e303c0 (patch)
treed4c5d001c7ba8ea77d921506a285dc6d0715ceae /tools/power/x86
parentda67e2b9fd1d846a41978690da0a899d8e4378ec (diff)
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: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools/power/x86')
-rw-r--r--tools/power/x86/turbostat/turbostat.86
-rw-r--r--tools/power/x86/turbostat/turbostat.c31
2 files changed, 21 insertions, 16 deletions
diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
index b1b1ab80102c..5189d9d982fe 100644
--- a/tools/power/x86/turbostat/turbostat.8
+++ b/tools/power/x86/turbostat/turbostat.8
@@ -52,7 +52,7 @@ name as necessary to disambiguate it from others is necessary. Note that option
52 as the column header. 52 as the column header.
53.fi 53.fi
54.PP 54.PP
55\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 55\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
56.PP 56.PP
57\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. 57\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.
58.PP 58.PP
@@ -71,12 +71,8 @@ The file is truncated if it already exists, and it is created if it does not exi
71.PP 71.PP
72\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts. 72\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
73.PP 73.PP
74\fB--Package\fP limits output to the system summary plus the 1st thread in each Package.
75.PP
76\fB--list\fP display column header names available for use by --show and --hide, then exit. 74\fB--list\fP display column header names available for use by --show and --hide, then exit.
77.PP 75.PP
78\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.
79.PP
80\fB--Summary\fP limits output to a 1-line System Summary for each interval. 76\fB--Summary\fP limits output to a 1-line System Summary for each interval.
81.PP 77.PP
82\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. 78\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.
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 851eaf06f358..c005d9052679 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -4153,7 +4153,8 @@ void help()
4153 "to print statistics, until interrupted.\n" 4153 "to print statistics, until interrupted.\n"
4154 "--add add a counter\n" 4154 "--add add a counter\n"
4155 " eg. --add msr0x10,u64,cpu,delta,MY_TSC\n" 4155 " eg. --add msr0x10,u64,cpu,delta,MY_TSC\n"
4156 "--cpu cpu-set limit output to summary plus cpu-set cpu-set\n" 4156 "--cpu cpu-set limit output to summary plus cpu-set:\n"
4157 " {core | package | j,k,l..m,n-p }\n"
4157 "--quiet skip decoding system configuration header\n" 4158 "--quiet skip decoding system configuration header\n"
4158 "--interval sec Override default 5-second measurement interval\n" 4159 "--interval sec Override default 5-second measurement interval\n"
4159 "--help print this help message\n" 4160 "--help print this help message\n"
@@ -4756,6 +4757,21 @@ void parse_cpu_command(char *optarg)
4756 unsigned int start, end; 4757 unsigned int start, end;
4757 char *next; 4758 char *next;
4758 4759
4760 if (!strcmp(optarg, "core")) {
4761 if (cpu_subset)
4762 goto error;
4763 show_core_only++;
4764 return;
4765 }
4766 if (!strcmp(optarg, "package")) {
4767 if (cpu_subset)
4768 goto error;
4769 show_pkg_only++;
4770 return;
4771 }
4772 if (show_core_only || show_pkg_only)
4773 goto error;
4774
4759 cpu_subset = CPU_ALLOC(CPU_SUBSET_MAXCPUS); 4775 cpu_subset = CPU_ALLOC(CPU_SUBSET_MAXCPUS);
4760 if (cpu_subset == NULL) 4776 if (cpu_subset == NULL)
4761 err(3, "CPU_ALLOC"); 4777 err(3, "CPU_ALLOC");
@@ -4813,7 +4829,8 @@ void parse_cpu_command(char *optarg)
4813 return; 4829 return;
4814 4830
4815error: 4831error:
4816 fprintf(stderr, "'--cpu %s' malformed\n", optarg); 4832 fprintf(stderr, "\"--cpu %s\" malformed\n", optarg);
4833 help();
4817 exit(-1); 4834 exit(-1);
4818} 4835}
4819 4836
@@ -4867,8 +4884,6 @@ void cmdline(int argc, char **argv)
4867 {"Joules", no_argument, 0, 'J'}, 4884 {"Joules", no_argument, 0, 'J'},
4868 {"list", no_argument, 0, 'l'}, 4885 {"list", no_argument, 0, 'l'},
4869 {"out", required_argument, 0, 'o'}, 4886 {"out", required_argument, 0, 'o'},
4870 {"Package", no_argument, 0, 'p'},
4871 {"processor", no_argument, 0, 'p'},
4872 {"quiet", no_argument, 0, 'q'}, 4887 {"quiet", no_argument, 0, 'q'},
4873 {"show", required_argument, 0, 's'}, 4888 {"show", required_argument, 0, 's'},
4874 {"Summary", no_argument, 0, 'S'}, 4889 {"Summary", no_argument, 0, 'S'},
@@ -4879,7 +4894,7 @@ void cmdline(int argc, char **argv)
4879 4894
4880 progname = argv[0]; 4895 progname = argv[0];
4881 4896
4882 while ((opt = getopt_long_only(argc, argv, "+C:c:Ddhi:JM:m:o:PpqST:v", 4897 while ((opt = getopt_long_only(argc, argv, "+C:c:Ddhi:JM:m:o:qST:v",
4883 long_options, &option_index)) != -1) { 4898 long_options, &option_index)) != -1) {
4884 switch (opt) { 4899 switch (opt) {
4885 case 'a': 4900 case 'a':
@@ -4925,12 +4940,6 @@ void cmdline(int argc, char **argv)
4925 case 'o': 4940 case 'o':
4926 outf = fopen_or_die(optarg, "w"); 4941 outf = fopen_or_die(optarg, "w");
4927 break; 4942 break;
4928 case 'P':
4929 show_pkg_only++;
4930 break;
4931 case 'p':
4932 show_core_only++;
4933 break;
4934 case 'q': 4943 case 'q':
4935 quiet = 1; 4944 quiet = 1;
4936 break; 4945 break;