提交 60ba7702 编写于 作者: S Steven Rostedt 提交者: Steven Rostedt

tracing: add filter event logic to special, mmiotrace and boot tracers

Now that the pluging tracers use macros to create the structures and
automate the exporting of their formats to the format files, they also
automatically get a filter file.

This patch adds the code to implement the filter logic in the trace
recordings.
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 51df5fcb
...@@ -1206,6 +1206,7 @@ ftrace_trace_special(void *__tr, ...@@ -1206,6 +1206,7 @@ ftrace_trace_special(void *__tr,
unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg1, unsigned long arg2, unsigned long arg3,
int pc) int pc)
{ {
struct ftrace_event_call *call = &event_special;
struct ring_buffer_event *event; struct ring_buffer_event *event;
struct trace_array *tr = __tr; struct trace_array *tr = __tr;
struct ring_buffer *buffer = tr->buffer; struct ring_buffer *buffer = tr->buffer;
...@@ -1219,6 +1220,8 @@ ftrace_trace_special(void *__tr, ...@@ -1219,6 +1220,8 @@ ftrace_trace_special(void *__tr,
entry->arg1 = arg1; entry->arg1 = arg1;
entry->arg2 = arg2; entry->arg2 = arg2;
entry->arg3 = arg3; entry->arg3 = arg3;
if (!filter_check_discard(call, entry, buffer, event))
trace_buffer_unlock_commit(buffer, event, 0, pc); trace_buffer_unlock_commit(buffer, event, 0, pc);
} }
......
...@@ -129,6 +129,7 @@ struct tracer boot_tracer __read_mostly = ...@@ -129,6 +129,7 @@ struct tracer boot_tracer __read_mostly =
void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) void trace_boot_call(struct boot_trace_call *bt, initcall_t fn)
{ {
struct ftrace_event_call *call = &event_boot_call;
struct ring_buffer_event *event; struct ring_buffer_event *event;
struct ring_buffer *buffer; struct ring_buffer *buffer;
struct trace_boot_call *entry; struct trace_boot_call *entry;
...@@ -150,6 +151,7 @@ void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) ...@@ -150,6 +151,7 @@ void trace_boot_call(struct boot_trace_call *bt, initcall_t fn)
goto out; goto out;
entry = ring_buffer_event_data(event); entry = ring_buffer_event_data(event);
entry->boot_call = *bt; entry->boot_call = *bt;
if (!filter_check_discard(call, entry, buffer, event))
trace_buffer_unlock_commit(buffer, event, 0, 0); trace_buffer_unlock_commit(buffer, event, 0, 0);
out: out:
preempt_enable(); preempt_enable();
...@@ -157,6 +159,7 @@ void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) ...@@ -157,6 +159,7 @@ void trace_boot_call(struct boot_trace_call *bt, initcall_t fn)
void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn) void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn)
{ {
struct ftrace_event_call *call = &event_boot_ret;
struct ring_buffer_event *event; struct ring_buffer_event *event;
struct ring_buffer *buffer; struct ring_buffer *buffer;
struct trace_boot_ret *entry; struct trace_boot_ret *entry;
...@@ -175,6 +178,7 @@ void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn) ...@@ -175,6 +178,7 @@ void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn)
goto out; goto out;
entry = ring_buffer_event_data(event); entry = ring_buffer_event_data(event);
entry->boot_ret = *bt; entry->boot_ret = *bt;
if (!filter_check_discard(call, entry, buffer, event))
trace_buffer_unlock_commit(buffer, event, 0, 0); trace_buffer_unlock_commit(buffer, event, 0, 0);
out: out:
preempt_enable(); preempt_enable();
......
...@@ -307,6 +307,7 @@ static void __trace_mmiotrace_rw(struct trace_array *tr, ...@@ -307,6 +307,7 @@ static void __trace_mmiotrace_rw(struct trace_array *tr,
struct trace_array_cpu *data, struct trace_array_cpu *data,
struct mmiotrace_rw *rw) struct mmiotrace_rw *rw)
{ {
struct ftrace_event_call *call = &event_mmiotrace_rw;
struct ring_buffer *buffer = tr->buffer; struct ring_buffer *buffer = tr->buffer;
struct ring_buffer_event *event; struct ring_buffer_event *event;
struct trace_mmiotrace_rw *entry; struct trace_mmiotrace_rw *entry;
...@@ -320,6 +321,8 @@ static void __trace_mmiotrace_rw(struct trace_array *tr, ...@@ -320,6 +321,8 @@ static void __trace_mmiotrace_rw(struct trace_array *tr,
} }
entry = ring_buffer_event_data(event); entry = ring_buffer_event_data(event);
entry->rw = *rw; entry->rw = *rw;
if (!filter_check_discard(call, entry, buffer, event))
trace_buffer_unlock_commit(buffer, event, 0, pc); trace_buffer_unlock_commit(buffer, event, 0, pc);
} }
...@@ -334,6 +337,7 @@ static void __trace_mmiotrace_map(struct trace_array *tr, ...@@ -334,6 +337,7 @@ static void __trace_mmiotrace_map(struct trace_array *tr,
struct trace_array_cpu *data, struct trace_array_cpu *data,
struct mmiotrace_map *map) struct mmiotrace_map *map)
{ {
struct ftrace_event_call *call = &event_mmiotrace_map;
struct ring_buffer *buffer = tr->buffer; struct ring_buffer *buffer = tr->buffer;
struct ring_buffer_event *event; struct ring_buffer_event *event;
struct trace_mmiotrace_map *entry; struct trace_mmiotrace_map *entry;
...@@ -347,6 +351,8 @@ static void __trace_mmiotrace_map(struct trace_array *tr, ...@@ -347,6 +351,8 @@ static void __trace_mmiotrace_map(struct trace_array *tr,
} }
entry = ring_buffer_event_data(event); entry = ring_buffer_event_data(event);
entry->map = *map; entry->map = *map;
if (!filter_check_discard(call, entry, buffer, event))
trace_buffer_unlock_commit(buffer, event, 0, pc); trace_buffer_unlock_commit(buffer, event, 0, pc);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册