summaryrefslogtreecommitdiffstats
path: root/tools/power/x86/turbostat/turbostat.c
diff options
context:
space:
mode:
authorPatryk Wlazlyn <patryk.wlazlyn@linux.intel.com>2024-11-13 15:48:22 +0100
committerLen Brown <len.brown@intel.com>2024-11-30 22:42:07 +0100
commit1da0daf746342dfdc114e4dc8fbf3ece28666d4f (patch)
tree85471310b8ffdb421348404aa92c5b057cd29ded /tools/power/x86/turbostat/turbostat.c
parenttools/power turbostat: Force --no-perf in --dump mode (diff)
downloadlinux-1da0daf746342dfdc114e4dc8fbf3ece28666d4f.tar.xz
linux-1da0daf746342dfdc114e4dc8fbf3ece28666d4f.zip
tools/power turbostat: Fix child's argument forwarding
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>
Diffstat (limited to '')
-rw-r--r--tools/power/x86/turbostat/turbostat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 1fed799a5537..9025c2945737 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -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;