summaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/debug.c17
-rw-r--r--tools/perf/util/debug.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index c1838b643108..03eb81f30d0d 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -203,11 +203,28 @@ int perf_debug_option(const char *str)
203 v = (v < 0) || (v > 10) ? 0 : v; 203 v = (v < 0) || (v > 10) ? 0 : v;
204 } 204 }
205 205
206 if (quiet)
207 v = -1;
208
206 *var->ptr = v; 209 *var->ptr = v;
207 free(s); 210 free(s);
208 return 0; 211 return 0;
209} 212}
210 213
214int 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;
225 return 0;
226}
227
211#define DEBUG_WRAPPER(__n, __l) \ 228#define DEBUG_WRAPPER(__n, __l) \
212static int pr_ ## __n ## _wrapper(const char *fmt, ...) \ 229static int pr_ ## __n ## _wrapper(const char *fmt, ...) \
213{ \ 230{ \
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h
index d242adc3d5a2..98832f5531d3 100644
--- a/tools/perf/util/debug.h
+++ b/tools/perf/util/debug.h
@@ -54,5 +54,6 @@ int veprintf(int level, int var, const char *fmt, va_list args);
54 54
55int perf_debug_option(const char *str); 55int perf_debug_option(const char *str);
56void perf_debug_setup(void); 56void perf_debug_setup(void);
57int perf_quiet_option(void);
57 58
58#endif /* __PERF_DEBUG_H */ 59#endif /* __PERF_DEBUG_H */