Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf utils: Add perf_quiet_option()

The perf_quiet_option() is to suppress all messages. It's intended to
be called just after parsing options.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170217081742.17417-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
80df1988 483635a9

+18
+17
tools/perf/util/debug.c
··· 203 203 v = (v < 0) || (v > 10) ? 0 : v; 204 204 } 205 205 206 + if (quiet) 207 + v = -1; 208 + 206 209 *var->ptr = v; 207 210 free(s); 211 + return 0; 212 + } 213 + 214 + int perf_quiet_option(void) 215 + { 216 + struct debug_variable *var = &debug_variables[0]; 217 + 218 + /* disable all debug messages */ 219 + while (var->name) { 220 + *var->ptr = -1; 221 + var++; 222 + } 223 + 224 + quiet = true; 208 225 return 0; 209 226 } 210 227
+1
tools/perf/util/debug.h
··· 54 54 55 55 int perf_debug_option(const char *str); 56 56 void perf_debug_setup(void); 57 + int perf_quiet_option(void); 57 58 58 59 #endif /* __PERF_DEBUG_H */