diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-24 09:27:41 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-24 09:27:41 -0400 |
commit | f3f3f0092477d0165f3f1bf0fd518550b2abd097 (patch) | |
tree | 5ce5a880fd86e7e865e6a5155ab404e106125f8e /kernel/trace | |
parent | 737f453fd115ea0c9642ed6b30e37e296a4e3ed7 (diff) |
tracing/event: Cleanup the useless dentry variable
Cleanup the useless dentry variable while creating a kernel
event set of files. trace_create_file() warns if it fails to
create the file anyway, and we don't store the dentry anywhere.
v2: Fix a small conflict in kernel/trace/trace_events.c
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_events.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 56c260b83a9c..8c91b7c8f047 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -898,9 +898,9 @@ event_subsystem_dir(const char *name, struct dentry *d_events) | |||
898 | "'%s/filter' entry\n", name); | 898 | "'%s/filter' entry\n", name); |
899 | } | 899 | } |
900 | 900 | ||
901 | entry = trace_create_file("enable", 0644, system->entry, | 901 | trace_create_file("enable", 0644, system->entry, |
902 | (void *)system->name, | 902 | (void *)system->name, |
903 | &ftrace_system_enable_fops); | 903 | &ftrace_system_enable_fops); |
904 | 904 | ||
905 | return system->entry; | 905 | return system->entry; |
906 | } | 906 | } |
@@ -912,7 +912,6 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events, | |||
912 | const struct file_operations *filter, | 912 | const struct file_operations *filter, |
913 | const struct file_operations *format) | 913 | const struct file_operations *format) |
914 | { | 914 | { |
915 | struct dentry *entry; | ||
916 | int ret; | 915 | int ret; |
917 | 916 | ||
918 | /* | 917 | /* |
@@ -930,12 +929,12 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events, | |||
930 | } | 929 | } |
931 | 930 | ||
932 | if (call->regfunc) | 931 | if (call->regfunc) |
933 | entry = trace_create_file("enable", 0644, call->dir, call, | 932 | trace_create_file("enable", 0644, call->dir, call, |
934 | enable); | 933 | enable); |
935 | 934 | ||
936 | if (call->id && call->profile_enable) | 935 | if (call->id && call->profile_enable) |
937 | entry = trace_create_file("id", 0444, call->dir, call, | 936 | trace_create_file("id", 0444, call->dir, call, |
938 | id); | 937 | id); |
939 | 938 | ||
940 | if (call->define_fields) { | 939 | if (call->define_fields) { |
941 | ret = call->define_fields(call); | 940 | ret = call->define_fields(call); |
@@ -944,16 +943,16 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events, | |||
944 | " events/%s\n", call->name); | 943 | " events/%s\n", call->name); |
945 | return ret; | 944 | return ret; |
946 | } | 945 | } |
947 | entry = trace_create_file("filter", 0644, call->dir, call, | 946 | trace_create_file("filter", 0644, call->dir, call, |
948 | filter); | 947 | filter); |
949 | } | 948 | } |
950 | 949 | ||
951 | /* A trace may not want to export its format */ | 950 | /* A trace may not want to export its format */ |
952 | if (!call->show_format) | 951 | if (!call->show_format) |
953 | return 0; | 952 | return 0; |
954 | 953 | ||
955 | entry = trace_create_file("format", 0444, call->dir, call, | 954 | trace_create_file("format", 0444, call->dir, call, |
956 | format); | 955 | format); |
957 | 956 | ||
958 | return 0; | 957 | return 0; |
959 | } | 958 | } |