tracing/filters: move preds into event_filter object
PATCH 1/3 tracing/filters: move preds into event_filter object
Create a new event_filter object, and move the pred-related members out of the call and subsystem objects and into the filter object - the details of the filter implementation don't need to be exposed in the call and subsystem in any case, and it will also help make the new parser implementation a little cleaner.
--- include/linux/ftrace_event.h | 4 +- kernel/trace/trace.h | 10 ++- kernel/trace/trace_events.c | 3 +- kernel/trace/trace_events_filter.c | 107 ++++++++++++++++++++++-------------- 4 files changed, 76 insertions(+), 48 deletions(-)
include/linux/ftrace_event.h +2 -2
@@ -101,8 +101,8 @@ struct ftrace_event_call {int (*show_format)(struct trace_seq *s);int (*define_fields)(void );struct list_head fields; -int n_preds; -struct filter_pred **preds; +int filter_active; +void *filter;void *mod;#ifdef CONFIG_EVENT_PROFILE
kernel/trace/trace.h +7 -3
@@ -733,12 +733,16 @@ struct ftrace_event_field {int size; }; +struct event_filter { +int n_preds; +struct filter_pred **preds; +}; +struct event_subsystem {struct list_head list;const char *name;struct dentry *entry; -int n_preds; -struct filter_pred **preds; +void *filter; };struct filter_pred ;
@@ -776,7 +780,7 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,struct ring_buffer *buffer, struct ring_buffer_event *event) { - if (unlikely(call->n_preds) && !filter_match_preds(call, rec)) { + if (unlikely(call->filter_active) && !filter_match_preds(call, rec)) {ring_buffer_discard_commit (buffer ,event );return 1 ; }
kernel/trace/trace_events.c +1 -2
@@ -757,8 +757,7 @@ event_subsystem_dir(const char *name, struct dentry *d_events)list_add (&system->list, &event_subsystems); - system->preds =NULL ; - system->n_preds =0 ; + system->filter =NULL ; entry =debugfs_create_file ("filter" ,0644 , system->entry, system, &ftrace_subsystem_filter_fops);
kernel/trace/trace_events_filter.c +66 -41
228 lines not on this page · raw message
Signature · 1 line
1.5.6.3
Commit-ID: 7161bb1b07b2236fc32745b548bb5c7f7153f9bc Gitweb: http://git.kernel.org/tip/7161bb1b07b2236fc32745b548bb5c7f7153f9bc Author: Tom Zanussi <[email protected]> AuthorDate: Tue, 28 Apr 2009 03:04:47 -0500 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 29 Apr 2009 12:37:54 +0200
tracing/filters: move preds into event_filter object
Create a new event_filter object, and move the pred-related members out of the call and subsystem objects and into the filter object - the details of the filter implementation don't need to be exposed in the call and subsystem in any case, and it will also help make the new parser implementation a little cleaner.
[ Impact: refactor trace-filter code to prepare for new features ]
LKML-Reference: <1240905887.6416.119.camel@tropicana>
--- include/linux/ftrace_event.h | 4 +- kernel/trace/trace.h | 10 ++- kernel/trace/trace_events.c | 3 +- kernel/trace/trace_events_filter.c | 107 ++++++++++++++++++++++-------------- 4 files changed, 76 insertions(+), 48 deletions(-)
include/linux/ftrace_event.h +2 -2
@@ -101,8 +101,8 @@ struct ftrace_event_call {int (*show_format)(struct trace_seq *s);int (*define_fields)(void );struct list_head fields; -int n_preds; -struct filter_pred **preds; +int filter_active; +void *filter;void *mod;#ifdef CONFIG_EVENT_PROFILE
kernel/trace/trace.h +7 -3
@@ -731,12 +731,16 @@ struct ftrace_event_field {int size; }; +struct event_filter { +int n_preds; +struct filter_pred **preds; +}; +struct event_subsystem {struct list_head list;const char *name;struct dentry *entry; -int n_preds; -struct filter_pred **preds; +void *filter; };struct filter_pred ;
@@ -774,7 +778,7 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,struct ring_buffer *buffer, struct ring_buffer_event *event) { - if (unlikely(call->n_preds) && !filter_match_preds(call, rec)) { + if (unlikely(call->filter_active) && !filter_match_preds(call, rec)) {ring_buffer_discard_commit (buffer ,event );return 1 ; }
kernel/trace/trace_events.c +1 -2
@@ -757,8 +757,7 @@ event_subsystem_dir(const char *name, struct dentry *d_events)list_add (&system->list, &event_subsystems); - system->preds =NULL ; - system->n_preds =0 ; + system->filter =NULL ; entry =debugfs_create_file ("filter" ,0644 , system->entry, system, &ftrace_subsystem_filter_fops);
kernel/trace/trace_events_filter.c +66 -41
228 lines not on this page · raw message
Commit-ID: 30e673b230f9d556eb81ef68a7b1a08c8b3b142c Gitweb: http://git.kernel.org/tip/30e673b230f9d556eb81ef68a7b1a08c8b3b142c Author: Tom Zanussi <[email protected]> AuthorDate: Tue, 28 Apr 2009 03:04:47 -0500 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 29 Apr 2009 14:05:54 +0200
tracing/filters: move preds into event_filter object
Create a new event_filter object, and move the pred-related members out of the call and subsystem objects and into the filter object - the details of the filter implementation don't need to be exposed in the call and subsystem in any case, and it will also help make the new parser implementation a little cleaner.
[ Impact: refactor trace-filter code to prepare for new features ]
LKML-Reference: <1240905887.6416.119.camel@tropicana>
--- include/linux/ftrace_event.h | 4 +- kernel/trace/trace.h | 10 ++- kernel/trace/trace_events.c | 3 +- kernel/trace/trace_events_filter.c | 107 ++++++++++++++++++++++-------------- 4 files changed, 76 insertions(+), 48 deletions(-)
include/linux/ftrace_event.h +2 -2
@@ -101,8 +101,8 @@ struct ftrace_event_call {int (*show_format)(struct trace_seq *s);int (*define_fields)(void );struct list_head fields; -int n_preds; -struct filter_pred **preds; +int filter_active; +void *filter;void *mod;#ifdef CONFIG_EVENT_PROFILE
kernel/trace/trace.h +7 -3
@@ -731,12 +731,16 @@ struct ftrace_event_field {int size; }; +struct event_filter { +int n_preds; +struct filter_pred **preds; +}; +struct event_subsystem {struct list_head list;const char *name;struct dentry *entry; -int n_preds; -struct filter_pred **preds; +void *filter; };struct filter_pred ;
@@ -774,7 +778,7 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,struct ring_buffer *buffer, struct ring_buffer_event *event) { - if (unlikely(call->n_preds) && !filter_match_preds(call, rec)) { + if (unlikely(call->filter_active) && !filter_match_preds(call, rec)) {ring_buffer_discard_commit (buffer ,event );return 1 ; }
kernel/trace/trace_events.c +1 -2
@@ -757,8 +757,7 @@ event_subsystem_dir(const char *name, struct dentry *d_events)list_add (&system->list, &event_subsystems); - system->preds =NULL ; - system->n_preds =0 ; + system->filter =NULL ; entry =debugfs_create_file ("filter" ,0644 , system->entry, system, &ftrace_subsystem_filter_fops);
kernel/trace/trace_events_filter.c +66 -41
228 lines not on this page · raw message