Commit addd116d authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Andy Shevchenko

tools/power/x86/intel-speed-select: Enhance help

Enhance help message which adds some example. The changes include:
- Print help when options are not recognized.
- For CLX, display only options which are applicable.
- Sort options in alphatical order.
- Disply help() instead of error:
"Feature name and|or command not specified"
- Remove duplicate display of
Intel(R) Speed Select Technology
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent f362cdcc
...@@ -2368,11 +2368,18 @@ void process_command(int argc, char **argv, ...@@ -2368,11 +2368,18 @@ void process_command(int argc, char **argv,
static void usage(void) static void usage(void)
{ {
printf("Intel(R) Speed Select Technology\n"); if (is_clx_n_platform()) {
fprintf(stderr, "\nThere is limited support of Intel Speed Select features on this platform.\n");
fprintf(stderr, "Everything is pre-configured using BIOS options, this tool can't enable any feature in the hardware.\n\n");
}
printf("\nUsage:\n"); printf("\nUsage:\n");
printf("intel-speed-select [OPTIONS] FEATURE COMMAND COMMAND_ARGUMENTS\n"); printf("intel-speed-select [OPTIONS] FEATURE COMMAND COMMAND_ARGUMENTS\n");
printf("\nUse this tool to enumerate and control the Intel Speed Select Technology features,\n"); printf("\nUse this tool to enumerate and control the Intel Speed Select Technology features:\n");
printf("\nFEATURE : [perf-profile|base-freq|turbo-freq|core-power]\n"); if (is_clx_n_platform())
printf("\nFEATURE : [perf-profile|base-freq]\n");
else
printf("\nFEATURE : [perf-profile|base-freq|turbo-freq|core-power]\n");
printf("\nFor help on each feature, use -h|--help\n"); printf("\nFor help on each feature, use -h|--help\n");
printf("\tFor example: intel-speed-select perf-profile -h\n"); printf("\tFor example: intel-speed-select perf-profile -h\n");
...@@ -2385,17 +2392,29 @@ static void usage(void) ...@@ -2385,17 +2392,29 @@ static void usage(void)
printf("\t\tDefault: Die scoped for all dies in the system with multiple dies/package\n"); printf("\t\tDefault: Die scoped for all dies in the system with multiple dies/package\n");
printf("\t\t\t Or Package scoped for all Packages when each package contains one die\n"); printf("\t\t\t Or Package scoped for all Packages when each package contains one die\n");
printf("\t[-d|--debug] : Debug mode\n"); printf("\t[-d|--debug] : Debug mode\n");
printf("\t[-f|--format] : output format [json|text]. Default: text\n");
printf("\t[-h|--help] : Print help\n"); printf("\t[-h|--help] : Print help\n");
printf("\t[-i|--info] : Print platform information\n"); printf("\t[-i|--info] : Print platform information\n");
printf("\t[-o|--out] : Output file\n"); printf("\t[-o|--out] : Output file\n");
printf("\t\t\tDefault : stderr\n"); printf("\t\t\tDefault : stderr\n");
printf("\t[-f|--format] : output format [json|text]. Default: text\n");
printf("\t[-v|--version] : Print version\n"); printf("\t[-v|--version] : Print version\n");
printf("\nResult format\n"); printf("\nResult format\n");
printf("\tResult display uses a common format for each command:\n"); printf("\tResult display uses a common format for each command:\n");
printf("\tResults are formatted in text/JSON with\n"); printf("\tResults are formatted in text/JSON with\n");
printf("\t\tPackage, Die, CPU, and command specific results.\n"); printf("\t\tPackage, Die, CPU, and command specific results.\n");
printf("\nExamples\n");
printf("\tTo get platform information:\n");
printf("\t\tintel-speed-select --info\n");
printf("\tTo get full perf-profile information dump:\n");
printf("\t\tintel-speed-select perf-profile info\n");
printf("\tTo get full base-freq information dump:\n");
printf("\t\tintel-speed-select base-freq info -l 0\n");
if (!is_clx_n_platform()) {
printf("\tTo get full turbo-freq information dump:\n");
printf("\t\tintel-speed-select turbo-freq info -l 0\n");
}
exit(1); exit(1);
} }
...@@ -2482,7 +2501,7 @@ static void cmdline(int argc, char **argv) ...@@ -2482,7 +2501,7 @@ static void cmdline(int argc, char **argv)
} }
if (optind > (argc - 2)) { if (optind > (argc - 2)) {
fprintf(stderr, "Feature name and|or command not specified\n"); usage();
exit(0); exit(0);
} }
set_max_cpu_num(); set_max_cpu_num();
......
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