aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--kernel-shark.c18
-rw-r--r--trace-graph.c9
-rw-r--r--trace-view-store.c3
-rw-r--r--trace-view.c1
4 files changed, 18 insertions, 13 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);
diff --git a/trace-graph.c b/trace-graph.c
index af7600f..b1217d0 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -32,7 +32,7 @@
32#include "trace-hash.h" 32#include "trace-hash.h"
33#include "trace-filter.h" 33#include "trace-filter.h"
34 34
35#define DEBUG_LEVEL 2 35#define DEBUG_LEVEL 0
36#if DEBUG_LEVEL > 0 36#if DEBUG_LEVEL > 0
37# define dprintf(l, x...) \ 37# define dprintf(l, x...) \
38 do { \ 38 do { \
@@ -40,7 +40,7 @@
40 printf(x); \ 40 printf(x); \
41 } while (0) 41 } while (0)
42#else 42#else
43# define dprintf(x...) do { } while (0) 43# define dprintf(l, x...) do { if (0) printf(x); } while (0)
44#endif 44#endif
45 45
46#define MAX_WIDTH 10000 46#define MAX_WIDTH 10000
@@ -1325,12 +1325,7 @@ static void set_color_by_pid(GtkWidget *widget, GdkGC *gc, gint pid)
1325{ 1325{
1326 GdkColor color; 1326 GdkColor color;
1327 gint hash = hash_pid(pid); 1327 gint hash = hash_pid(pid);
1328 static gint last_pid = -1;
1329 1328
1330 if (!(hash & 0xffffff) && last_pid != pid) {
1331 last_pid = pid;
1332 dprintf(2, "pid=%d is black\n", pid);
1333 }
1334 color.red = (hash & 0xff)*(65535/255); 1329 color.red = (hash & 0xff)*(65535/255);
1335 color.blue = ((hash >> 8) & 0xff)*(65535/255); 1330 color.blue = ((hash >> 8) & 0xff)*(65535/255);
1336 color.green = ((hash >> 16) & 0xff)*(65535/255); 1331 color.green = ((hash >> 16) & 0xff)*(65535/255);
diff --git a/trace-view-store.c b/trace-view-store.c
index ff964cf..a25c698 100644
--- a/trace-view-store.c
+++ b/trace-view-store.c
@@ -1187,9 +1187,6 @@ search_for_record_by_timestamp(TraceViewStore *store, guint64 ts)
1187 1187
1188 rec = *prec; 1188 rec = *prec;
1189 1189
1190 if (rec)
1191 printf("found row rec for %ld at %ld\n",
1192 ts, rec->timestamp);
1193 return rec; 1190 return rec;
1194} 1191}
1195 1192
diff --git a/trace-view.c b/trace-view.c
index 90c01c7..1f5b7d6 100644
--- a/trace-view.c
+++ b/trace-view.c
@@ -360,7 +360,6 @@ void trace_view_select(GtkWidget *treeview, guint64 time)
360 /* Select the event */ 360 /* Select the event */
361 row = trace_view_store_get_timestamp_visible_row(TRACE_VIEW_STORE(model), time); 361 row = trace_view_store_get_timestamp_visible_row(TRACE_VIEW_STORE(model), time);
362 snprintf(buf, 100, "%d", row); 362 snprintf(buf, 100, "%d", row);
363 printf("row = %s\n", buf);
364 path = gtk_tree_path_new_from_string(buf); 363 path = gtk_tree_path_new_from_string(buf);
365 select_row_from_path(tree, path); 364 select_row_from_path(tree, path);
366 gtk_tree_path_free(path); 365 gtk_tree_path_free(path);