aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/debug.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-08-12 04:03:49 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-08-12 06:02:38 -0400
commitcd84c2ac6d6425dd4d1b80a2231e534b9b03df18 (patch)
tree943332327f02f7a056dc87c64e72e340c484ede6 /tools/perf/util/debug.c
parent9f8666971185b86615a074bcac67c90fdf8af8bc (diff)
perf tools: Factorize high level dso helpers
Factorize multiple definitions of high level dso helpers into the symbol source file. The side effect is a general export of the verbose and eprintf debugging helpers into a new file dedicated to debugging purposes. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Brice Goglin <Brice.Goglin@inria.fr>
Diffstat (limited to 'tools/perf/util/debug.c')
-rw-r--r--tools/perf/util/debug.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
new file mode 100644
index 00000000000..7cb8464abe6
--- /dev/null
+++ b/tools/perf/util/debug.c
@@ -0,0 +1,22 @@
1/* For general debugging purposes */
2
3#include "../perf.h"
4#include <string.h>
5#include <stdarg.h>
6#include <stdio.h>
7
8int verbose = 0;
9
10int eprintf(const char *fmt, ...)
11{
12 va_list args;
13 int ret = 0;
14
15 if (verbose) {
16 va_start(args, fmt);
17 ret = vfprintf(stderr, fmt, args);
18 va_end(args);
19 }
20
21 return ret;
22}