summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-08-16 22:05:48 +0200
committerIngo Molnar <mingo@elte.hu>2009-08-16 23:06:45 +0200
commit8f28827a162fd1e8da4e96bed69b06d2606e8322 (patch)
treeb57a24ca7819a1b347374aa62dd90444740811f8 /tools/perf/builtin-report.c
parent0d3a5c885971de1e3124d85bfadf818abac9ba12 (diff)
perf tools: Librarize trace_event() helper
Librarize trace_event() helper so that perf trace can use it too. Also clean up the debug.h includes a bit. It's not good to have it included in perf.h because it doesn't make it flexible against other headers it may need (headers that can also depend on perf.h and then create a recursive header dependency). Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Mike Galbraith <efault@gmx.de> LKML-Reference: <1250453149-664-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c6326deb163..1e3ad22d53d 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -20,6 +20,7 @@
#include "util/values.h"
#include "perf.h"
+#include "util/debug.h"
#include "util/header.h"
#include "util/parse-options.h"
@@ -39,8 +40,6 @@ static char *field_sep;
static int input;
static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
-#define cdprintf(x...) do { if (dump_trace) color_fprintf(stdout, color, x); } while (0)
-
static int full_paths;
static int show_nr_samples;
@@ -1285,42 +1284,6 @@ process_lost_event(event_t *event, unsigned long offset, unsigned long head)
return 0;
}
-static void trace_event(event_t *event)
-{
- unsigned char *raw_event = (void *)event;
- const char *color = PERF_COLOR_BLUE;
- int i, j;
-
- if (!dump_trace)
- return;
-
- dump_printf(".");
- cdprintf("\n. ... raw event: size %d bytes\n", event->header.size);
-
- for (i = 0; i < event->header.size; i++) {
- if ((i & 15) == 0) {
- dump_printf(".");
- cdprintf(" %04x: ", i);
- }
-
- cdprintf(" %02x", raw_event[i]);
-
- if (((i & 15) == 15) || i == event->header.size-1) {
- cdprintf(" ");
- for (j = 0; j < 15-(i & 15); j++)
- cdprintf(" ");
- for (j = 0; j < (i & 15); j++) {
- if (isprint(raw_event[i-15+j]))
- cdprintf("%c", raw_event[i-15+j]);
- else
- cdprintf(".");
- }
- cdprintf("\n");
- }
- }
- dump_printf(".\n");
-}
-
static int
process_read_event(event_t *event, unsigned long offset, unsigned long head)
{