Skip to contentSkip to conversation

tools/power/turbostat: fix unrecognized option '-P'

PATCH In review David Arcari 2 participants 2 messages Apr 21 Turbostat utility

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/power/turbostat: fix unrecognized option '-P'

The '-P' short option (shorthand for --no-perf) is not present in the optstring of the second call to getopt_long_only(). This results in the "unrecognized option" error when the tool reaches the main parsing loop.

Add 'P' to the second getopt_long_only() call to ensure it is consistently recognized.

---
 tools/power/x86/turbostat/turbostat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/x86/turbostat/turbostat.c +1 -1
index f1b8059a4eec..5c3b455dc1ff 100644
@@ -11441,7 +11441,7 @@ void cmdline(int argc, char **argv)
 	}
 	optind = 0;
 
-	while ((opt = getopt_long_only(argc, argv, "+C:c:Dde:hi:Jn:N:o:qMST:v", long_options, &option_index)) != -1) {
+	while ((opt = getopt_long_only(argc, argv, "+C:c:Dde:hi:Jn:N:o:qMPST:v", long_options, &option_index)) != -1) {
 		switch (opt) {
 		case 'a':
 			parse_add_command(optarg);
Signature · 1 line
2.53.0
maintainer
#1 lore raw

Applied - thanks!

-Len Brown, Intel Open Source Technology Center