Commit 2c9b238e authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Ingo Molnar

trace: Change struct trace_event callbacks parameter list

Impact: API change

The trace_seq and trace_entry are in trace_iterator, where there are
more fields that may be needed by tracers, so just pass the
tracer_iterator as is already the case for struct tracer->print_line.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent c4a8e8be
...@@ -1140,10 +1140,10 @@ static struct { ...@@ -1140,10 +1140,10 @@ static struct {
[__BLK_TA_REMAP] = {{ "A", "remap" }, blk_log_remap }, [__BLK_TA_REMAP] = {{ "A", "remap" }, blk_log_remap },
}; };
static int blk_trace_event_print(struct trace_seq *s, struct trace_entry *ent, static int blk_trace_event_print(struct trace_iterator *iter, int flags)
int flags)
{ {
const struct blk_io_trace *t = (struct blk_io_trace *)ent; struct trace_seq *s = &iter->seq;
const struct blk_io_trace *t = (struct blk_io_trace *)iter->ent;
const u16 what = t->action & ((1 << BLK_TC_SHIFT) - 1); const u16 what = t->action & ((1 << BLK_TC_SHIFT) - 1);
int ret; int ret;
...@@ -1153,7 +1153,7 @@ static int blk_trace_event_print(struct trace_seq *s, struct trace_entry *ent, ...@@ -1153,7 +1153,7 @@ static int blk_trace_event_print(struct trace_seq *s, struct trace_entry *ent,
const bool long_act = !!(trace_flags & TRACE_ITER_VERBOSE); const bool long_act = !!(trace_flags & TRACE_ITER_VERBOSE);
ret = blk_log_action_seq(s, t, what2act[what].act[long_act]); ret = blk_log_action_seq(s, t, what2act[what].act[long_act]);
if (ret) if (ret)
ret = what2act[what].print(s, ent); ret = what2act[what].print(s, iter->ent);
} }
return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE; return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
......
...@@ -1388,7 +1388,7 @@ static enum print_line_t print_lat_fmt(struct trace_iterator *iter) ...@@ -1388,7 +1388,7 @@ static enum print_line_t print_lat_fmt(struct trace_iterator *iter)
} }
if (event && event->latency_trace) { if (event && event->latency_trace) {
ret = event->latency_trace(s, entry, sym_flags); ret = event->latency_trace(iter, sym_flags);
if (ret) if (ret)
return ret; return ret;
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
...@@ -1419,7 +1419,7 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter) ...@@ -1419,7 +1419,7 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
} }
if (event && event->trace) { if (event && event->trace) {
ret = event->trace(s, entry, sym_flags); ret = event->trace(iter, sym_flags);
if (ret) if (ret)
return ret; return ret;
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
...@@ -1449,7 +1449,7 @@ static enum print_line_t print_raw_fmt(struct trace_iterator *iter) ...@@ -1449,7 +1449,7 @@ static enum print_line_t print_raw_fmt(struct trace_iterator *iter)
event = ftrace_find_event(entry->type); event = ftrace_find_event(entry->type);
if (event && event->raw) { if (event && event->raw) {
ret = event->raw(s, entry, 0); ret = event->raw(iter, 0);
if (ret) if (ret)
return ret; return ret;
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
...@@ -1478,7 +1478,7 @@ static enum print_line_t print_hex_fmt(struct trace_iterator *iter) ...@@ -1478,7 +1478,7 @@ static enum print_line_t print_hex_fmt(struct trace_iterator *iter)
event = ftrace_find_event(entry->type); event = ftrace_find_event(entry->type);
if (event && event->hex) if (event && event->hex)
event->hex(s, entry, 0); event->hex(iter, 0);
SEQ_PUT_FIELD_RET(s, newline); SEQ_PUT_FIELD_RET(s, newline);
...@@ -1517,7 +1517,7 @@ static enum print_line_t print_bin_fmt(struct trace_iterator *iter) ...@@ -1517,7 +1517,7 @@ static enum print_line_t print_bin_fmt(struct trace_iterator *iter)
event = ftrace_find_event(entry->type); event = ftrace_find_event(entry->type);
if (event && event->binary) if (event && event->binary)
event->binary(s, entry, 0); event->binary(iter, 0);
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
} }
......
...@@ -160,14 +160,13 @@ trace_print_print(struct trace_seq *s, struct trace_entry *entry, int flags) ...@@ -160,14 +160,13 @@ trace_print_print(struct trace_seq *s, struct trace_entry *entry, int flags)
return TRACE_TYPE_PARTIAL_LINE; return TRACE_TYPE_PARTIAL_LINE;
} }
static int static int trace_branch_print(struct trace_iterator *iter, int flags)
trace_branch_print(struct trace_seq *s, struct trace_entry *entry, int flags)
{ {
struct trace_branch *field; struct trace_branch *field;
trace_assign_type(field, entry); trace_assign_type(field, iter->ent);
if (trace_seq_printf(s, "[%s] %s:%s:%d\n", if (trace_seq_printf(&iter->seq, "[%s] %s:%s:%d\n",
field->correct ? " ok " : " MISS ", field->correct ? " ok " : " MISS ",
field->func, field->func,
field->file, field->file,
......
This diff is collapsed.
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
#include "trace.h" #include "trace.h"
typedef int (*trace_print_func)(struct trace_seq *s, struct trace_entry *entry, typedef int (*trace_print_func)(struct trace_iterator *iter, int flags);
int flags);
struct trace_event { struct trace_event {
struct hlist_node node; struct hlist_node node;
...@@ -40,8 +39,7 @@ struct trace_event *ftrace_find_event(int type); ...@@ -40,8 +39,7 @@ struct trace_event *ftrace_find_event(int type);
int register_ftrace_event(struct trace_event *event); int register_ftrace_event(struct trace_event *event);
int unregister_ftrace_event(struct trace_event *event); int unregister_ftrace_event(struct trace_event *event);
int int trace_nop_print(struct trace_iterator *iter, int flags);
trace_nop_print(struct trace_seq *s, struct trace_entry *entry, int flags);
#define MAX_MEMHEX_BYTES 8 #define MAX_MEMHEX_BYTES 8
#define HEX_CHARS (MAX_MEMHEX_BYTES*2 + 1) #define HEX_CHARS (MAX_MEMHEX_BYTES*2 + 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment