aboutsummaryrefslogtreecommitdiffstats
path: root/kernel-shark.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-01-08 14:35:30 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-08 14:35:30 -0500
commit1c220f61773e19f5a8aaefcff365dde738228a4e (patch)
treeb9b6e4e6a5abea0ae50d67bc14239586938f5557 /kernel-shark.c
parentf2b06ad754770cf8bf2a395c286c925d4a2c0f30 (diff)
kernel-shark: Remove a bunch of debug printing
Remove the debug printing, or at least hide it. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel-shark.c')
-rw-r--r--kernel-shark.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/kernel-shark.c b/kernel-shark.c
index b0d2a19..533a8af 100644
--- a/kernel-shark.c
+++ b/kernel-shark.c
@@ -34,6 +34,17 @@
34 34
35#define version "0.1.1" 35#define version "0.1.1"
36 36
37#define DEBUG_LEVEL 0
38#if DEBUG_LEVEL > 0
39# define dprintf(l, x...) \
40 do { \
41 if (l <= DEBUG_LEVEL) \
42 printf(x); \
43 } while (0)
44#else
45# define dprintf(l, x...) do { if (0) printf(x); } while (0)
46#endif
47
37#define TRACE_WIDTH 800 48#define TRACE_WIDTH 800
38#define TRACE_HEIGHT 600 49#define TRACE_HEIGHT 600
39 50
@@ -64,6 +75,9 @@ static void print_time(unsigned long long time)
64{ 75{
65 unsigned long sec, usec; 76 unsigned long sec, usec;
66 77
78 if (!DEBUG_LEVEL)
79 return;
80
67 convert_nano(time, &sec, &usec); 81 convert_nano(time, &sec, &usec);
68 printf("%lu.%06lu", sec, usec); 82 printf("%lu.%06lu", sec, usec);
69} 83}
@@ -73,9 +87,9 @@ static void ks_graph_select(struct graph_info *ginfo, guint64 cursor)
73 struct graph_callbacks *cbs; 87 struct graph_callbacks *cbs;
74 struct shark_info *info; 88 struct shark_info *info;
75 89
76 printf("Cursor: "); 90 dprintf(1, "Cursor: ");
77 print_time(cursor); 91 print_time(cursor);
78 printf(" selected\n"); 92 dprintf(1, " selected\n");
79 93
80 cbs = trace_graph_get_callbacks(ginfo); 94 cbs = trace_graph_get_callbacks(ginfo);
81 info = container_of(cbs, struct shark_info, graph_cbs); 95 info = container_of(cbs, struct shark_info, graph_cbs);