Skip to content

Commit d6322e8

Browse files
committed
perf debug: Set debug_peo_args and redirect_to_stderr variable to correct values in perf_quiet_option()
jira LE-2815 Rebuild_History Non-Buildable kernel-4.18.0-553.50.1.el8_10 commit-author Yang Jihong <[email protected]> commit 188ac72 When perf uses quiet mode, perf_quiet_option() sets the 'debug_peo_args' variable to -1, and display_attr() incorrectly determines the value of 'debug_peo_args'. As a result, unexpected information is displayed. Before: # perf record --quiet -- ls > /dev/null ------------------------------------------------------------ perf_event_attr: size 128 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|PERIOD read_format ID|LOST disabled 1 inherit 1 mmap 1 comm 1 freq 1 enable_on_exec 1 task 1 precise_ip 3 sample_id_all 1 exclude_guest 1 mmap2 1 comm_exec 1 ksymbol 1 bpf_event 1 ------------------------------------------------------------ ... After: # perf record --quiet -- ls > /dev/null # redirect_to_stderr is a similar problem. Fixes: f78eaef ("perf tools: Allow to force redirect pr_debug to stderr.") Fixes: ccd2674 ("perf tool: Provide an option to print perf_event_open args and return value") Suggested-by: Adrian Hunter <[email protected]> Reviewed-by: Adrian Hunter <[email protected]> Signed-off-by: Yang Jihong <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Carsten Haitzler <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: [email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: Ravi Bangoria <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> (cherry picked from commit 188ac72) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 9b9d574 commit d6322e8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/perf/util/debug.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ int perf_quiet_option(void)
241241
opt++;
242242
}
243243

244+
/* For debug variables that are used as bool types, set to 0. */
245+
redirect_to_stderr = 0;
246+
debug_peo_args = 0;
247+
244248
return 0;
245249
}
246250

0 commit comments

Comments
 (0)