From 36f9ea18b58d7db2714651f324d95e841a8ef41c Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Fri, 18 Dec 2009 10:52:15 -0500 Subject: trace-cmd: Pass in record to pevent functions Instead of passing in the data, size and timestamp to the pevent parsing routines, pass in the record itself. This allows the pevent parsing routines to have a bit more control and facilitates the need of future work where we need to know more about the record in the parser. Signed-off-by: Steven Rostedt --- plugin_sched_switch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugin_sched_switch.c') diff --git a/plugin_sched_switch.c b/plugin_sched_switch.c index 4690f2f..3cec83c 100644 --- a/plugin_sched_switch.c +++ b/plugin_sched_switch.c @@ -47,12 +47,12 @@ static void write_state(struct trace_seq *s, int val) trace_seq_putc(s, 'R'); } -static int sched_wakeup_handler(struct trace_seq *s, void *data, int size, - struct event_format *event, int cpu, - unsigned long long nsecs) +static int sched_wakeup_handler(struct trace_seq *s, struct record *record, + struct event_format *event, int cpu) { struct format_field *field; unsigned long long val; + void *data = record->data; if (get_field_val(s, data, event, "common_pid", &val, 1)) return trace_seq_putc(s, '!'); @@ -102,12 +102,12 @@ static int sched_wakeup_handler(struct trace_seq *s, void *data, int size, return 0; } -static int sched_switch_handler(struct trace_seq *s, void *data, int size, - struct event_format *event, int cpu, - unsigned long long nsecs) +static int sched_switch_handler(struct trace_seq *s, struct record *record, + struct event_format *event, int cpu) { struct format_field *field; unsigned long long val; + void *data = record->data; if (get_field_val(s, data, event, "prev_pid", &val, 1)) return trace_seq_putc(s, '!'); -- cgit v1.2.2 From 91dc34ce6bb3cc86d1e522c61bffaee6bc6bf23d Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Fri, 18 Dec 2009 11:54:28 -0500 Subject: trace-cmd/pevent: Remove passing of cpu to pevent prasing functions Now that the struct record holds the cpu information, there's no need to pass the cpu number to the pevent parsing routines. Signed-off-by: Steven Rostedt --- plugin_sched_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugin_sched_switch.c') diff --git a/plugin_sched_switch.c b/plugin_sched_switch.c index 3cec83c..0f3b857 100644 --- a/plugin_sched_switch.c +++ b/plugin_sched_switch.c @@ -48,7 +48,7 @@ static void write_state(struct trace_seq *s, int val) } static int sched_wakeup_handler(struct trace_seq *s, struct record *record, - struct event_format *event, int cpu) + struct event_format *event) { struct format_field *field; unsigned long long val; @@ -103,7 +103,7 @@ static int sched_wakeup_handler(struct trace_seq *s, struct record *record, } static int sched_switch_handler(struct trace_seq *s, struct record *record, - struct event_format *event, int cpu) + struct event_format *event) { struct format_field *field; unsigned long long val; -- cgit v1.2.2