Skip to content

Commit 1da0daf

Browse files
Patryk Wlazlynlenb
authored andcommitted
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: 3e40484 ("tools/power turbostat: Add --no-msr option") Signed-off-by: Patryk Wlazlyn <[email protected]> Signed-off-by: Len Brown <[email protected]>
1 parent bcfab87 commit 1da0daf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9873,7 +9873,7 @@ void cmdline(int argc, char **argv)
98739873
* Parse some options early, because they may make other options invalid,
98749874
* like adding the MSR counter with --add and at the same time using --no-msr.
98759875
*/
9876-
while ((opt = getopt_long_only(argc, argv, "MPn:", long_options, &option_index)) != -1) {
9876+
while ((opt = getopt_long_only(argc, argv, "+MPn:", long_options, &option_index)) != -1) {
98779877
switch (opt) {
98789878
case 'M':
98799879
no_msr = 1;

0 commit comments

Comments
 (0)