summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/debug.c
diff options
context:
space:
mode:
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 0000000..7cb8464
--- /dev/null
+++ b/tools/perf/util/debug.c
@@ -0,0 +1,22 @@
+/* For general debugging purposes */
+
+#include "../perf.h"
+#include <string.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+int verbose = 0;
+
+int eprintf(const char *fmt, ...)
+{
+ va_list args;
+ int ret = 0;
+
+ if (verbose) {
+ va_start(args, fmt);
+ ret = vfprintf(stderr, fmt, args);
+ va_end(args);
+ }
+
+ return ret;
+}
OpenPOWER on IntegriCloud