]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/power turbostat: Fix unrecognized option '-P'
authorDavid Arcari <darcari@redhat.com>
Tue, 21 Apr 2026 14:32:17 +0000 (10:32 -0400)
committerLen Brown <len.brown@intel.com>
Wed, 22 Apr 2026 15:26:33 +0000 (11:26 -0400)
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.

Fixes: a0e86c90b83c ("tools/power turbostat: Add --no-perf option")
Signed-off-by: David Arcari <darcari@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c

index bea574d7aa68a53188d5042b363279a5c49948d4..d6b4fd17c5f37df0ed771af75578fa268887d92d 100644 (file)
@@ -11449,7 +11449,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);