aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-03-25 21:58:35 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-03-25 21:58:35 -0400
commit2bcbd70566311bba78b1d9347e82096207f14412 (patch)
tree4b71e7278a4f9959f606c32f99782593e69c166e
parentf612c17c7d23fc719991833de1f1a9d86a9ace53 (diff)
parse-events: Add raw format for printing events
Add print_raw field to pevent that will cause the pretty_print function to output the entries by their raw data in the fields, and will ignore the print formats. When set, each field will show its data. So instead of this: sched_switch: task swapper:0 [140] (R) ==> trace-cmd:31807 [140] We have: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=140 prev_state=0 next_comm=trace-cmd next_pid=31807 next_prio=140 Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--parse-events.c23
-rw-r--r--parse-events.h2
2 files changed, 12 insertions, 13 deletions
diff --git a/parse-events.c b/parse-events.c
index 6c3a7ab..c1415db 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -3737,11 +3737,16 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event,
3737{ 3737{
3738 int print_pretty = 1; 3738 int print_pretty = 1;
3739 3739
3740 if (event->handler) 3740 if (event->pevent->print_raw)
3741 print_pretty = event->handler(s, record, event); 3741 print_event_fields(s, record->data, record->size, event);
3742 else {
3742 3743
3743 if (print_pretty) 3744 if (event->handler)
3744 pretty_print(s, record->data, record->size, event); 3745 print_pretty = event->handler(s, record, event);
3746
3747 if (print_pretty)
3748 pretty_print(s, record->data, record->size, event);
3749 }
3745 3750
3746 trace_seq_terminate(s); 3751 trace_seq_terminate(s);
3747} 3752}
@@ -3755,8 +3760,6 @@ void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
3755 unsigned long usecs; 3760 unsigned long usecs;
3756 const char *comm; 3761 const char *comm;
3757 void *data = record->data; 3762 void *data = record->data;
3758 int size = record->size;
3759 int print_pretty = 1;
3760 int type; 3763 int type;
3761 int pid; 3764 int pid;
3762 int len; 3765 int len;
@@ -3789,14 +3792,8 @@ void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
3789 len = strlen(event->name); 3792 len = strlen(event->name);
3790 if (len < 20) 3793 if (len < 20)
3791 trace_seq_printf(s, "%.*s", 20 - len, spaces); 3794 trace_seq_printf(s, "%.*s", 20 - len, spaces);
3792
3793 if (event->handler)
3794 print_pretty = event->handler(s, record, event);
3795
3796 if (print_pretty)
3797 pretty_print(s, data, size, event);
3798 3795
3799 trace_seq_terminate(s); 3796 pevent_event_info(s, event, record);
3800} 3797}
3801 3798
3802static int events_id_cmp(const void *a, const void *b) 3799static int events_id_cmp(const void *a, const void *b)
diff --git a/parse-events.h b/parse-events.h
index 33a5b70..ba4ef73 100644
--- a/parse-events.h
+++ b/parse-events.h
@@ -326,6 +326,8 @@ struct pevent {
326 int ld_offset; 326 int ld_offset;
327 int ld_size; 327 int ld_size;
328 328
329 int print_raw;
330
329 struct format_field *bprint_ip_field; 331 struct format_field *bprint_ip_field;
330 struct format_field *bprint_fmt_field; 332 struct format_field *bprint_fmt_field;
331 struct format_field *bprint_buf_field; 333 struct format_field *bprint_buf_field;