diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2010-05-24 04:24:28 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-06-28 17:12:52 -0400 |
commit | c9d932cf8a1c608b676021aef0189376ba6ef151 (patch) | |
tree | b12777124aad80e266c937dbad33be7706aafe7f | |
parent | 210f766915207636acccba7bec42248bfe882998 (diff) |
tracing: Remove test of NULL define_fields callback
Every event (or event class) has it's define_fields callback,
so the test is redundant.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4BFA37BC.8080707@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/trace/trace_events.c | 28 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 9 |
2 files changed, 13 insertions, 24 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index d3b4bdf00b39..5bad9cbbf974 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -987,23 +987,21 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events, | |||
987 | id); | 987 | id); |
988 | #endif | 988 | #endif |
989 | 989 | ||
990 | if (call->class->define_fields) { | 990 | /* |
991 | /* | 991 | * Other events may have the same class. Only update |
992 | * Other events may have the same class. Only update | 992 | * the fields if they are not already defined. |
993 | * the fields if they are not already defined. | 993 | */ |
994 | */ | 994 | head = trace_get_fields(call); |
995 | head = trace_get_fields(call); | 995 | if (list_empty(head)) { |
996 | if (list_empty(head)) { | 996 | ret = call->class->define_fields(call); |
997 | ret = call->class->define_fields(call); | 997 | if (ret < 0) { |
998 | if (ret < 0) { | 998 | pr_warning("Could not initialize trace point" |
999 | pr_warning("Could not initialize trace point" | 999 | " events/%s\n", call->name); |
1000 | " events/%s\n", call->name); | 1000 | return ret; |
1001 | return ret; | ||
1002 | } | ||
1003 | } | 1001 | } |
1004 | trace_create_file("filter", 0644, call->dir, call, | ||
1005 | filter); | ||
1006 | } | 1002 | } |
1003 | trace_create_file("filter", 0644, call->dir, call, | ||
1004 | filter); | ||
1007 | 1005 | ||
1008 | trace_create_file("format", 0444, call->dir, call, | 1006 | trace_create_file("format", 0444, call->dir, call, |
1009 | format); | 1007 | format); |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 330fefd1de1c..36d40104b17f 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -639,9 +639,6 @@ static int init_subsystem_preds(struct event_subsystem *system) | |||
639 | int err; | 639 | int err; |
640 | 640 | ||
641 | list_for_each_entry(call, &ftrace_events, list) { | 641 | list_for_each_entry(call, &ftrace_events, list) { |
642 | if (!call->class || !call->class->define_fields) | ||
643 | continue; | ||
644 | |||
645 | if (strcmp(call->class->system, system->name) != 0) | 642 | if (strcmp(call->class->system, system->name) != 0) |
646 | continue; | 643 | continue; |
647 | 644 | ||
@@ -658,9 +655,6 @@ static void filter_free_subsystem_preds(struct event_subsystem *system) | |||
658 | struct ftrace_event_call *call; | 655 | struct ftrace_event_call *call; |
659 | 656 | ||
660 | list_for_each_entry(call, &ftrace_events, list) { | 657 | list_for_each_entry(call, &ftrace_events, list) { |
661 | if (!call->class || !call->class->define_fields) | ||
662 | continue; | ||
663 | |||
664 | if (strcmp(call->class->system, system->name) != 0) | 658 | if (strcmp(call->class->system, system->name) != 0) |
665 | continue; | 659 | continue; |
666 | 660 | ||
@@ -1263,9 +1257,6 @@ static int replace_system_preds(struct event_subsystem *system, | |||
1263 | list_for_each_entry(call, &ftrace_events, list) { | 1257 | list_for_each_entry(call, &ftrace_events, list) { |
1264 | struct event_filter *filter = call->filter; | 1258 | struct event_filter *filter = call->filter; |
1265 | 1259 | ||
1266 | if (!call->class || !call->class->define_fields) | ||
1267 | continue; | ||
1268 | |||
1269 | if (strcmp(call->class->system, system->name) != 0) | 1260 | if (strcmp(call->class->system, system->name) != 0) |
1270 | continue; | 1261 | continue; |
1271 | 1262 | ||