]> www.infradead.org Git - nvme.git/commitdiff
tools/power turbostat: Fix child's argument forwarding
authorPatryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Wed, 13 Nov 2024 14:48:22 +0000 (15:48 +0100)
committerLen Brown <len.brown@intel.com>
Sat, 30 Nov 2024 21:42:07 +0000 (16:42 -0500)
Add '+' to optstring when early scanning for --no-msr and --no-perf.
It causes option processing to stop as soon as a nonoption argument is
encountered, effectively skipping child's arguments.

Fixes: 3e4048466c39 ("tools/power turbostat: Add --no-msr option")
Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c

index 1fed799a55379e3f1d9e2813f07b2e4a1695701d..9025c294573708947002a96c287cf9fa17f4435f 100644 (file)
@@ -9873,7 +9873,7 @@ void cmdline(int argc, char **argv)
         * Parse some options early, because they may make other options invalid,
         * like adding the MSR counter with --add and at the same time using --no-msr.
         */
-       while ((opt = getopt_long_only(argc, argv, "MPn:", long_options, &option_index)) != -1) {
+       while ((opt = getopt_long_only(argc, argv, "+MPn:", long_options, &option_index)) != -1) {
                switch (opt) {
                case 'M':
                        no_msr = 1;