diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-03-26 19:25:38 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-07 08:43:07 -0400 |
commit | 5452af664f6fba26b80eb2c8c4ceae2999d5cf56 (patch) | |
tree | 08fb64bfc3242ad96b65719a55424db729585f17 /kernel/trace/ftrace.c | |
parent | a5dec5573f3c7e63f2f9b5852b9759ea342a5ff9 (diff) |
tracing/ftrace: factorize the tracing files creation
Impact: cleanup
Most of the tracing files creation follow the same pattern:
ret = debugfs_create_file(...)
if (!ret)
pr_warning("Couldn't create ... entry\n")
Unify it!
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1238109938-11840-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 678e3d6caf85..6ea5a1ae6a98 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2698,38 +2698,23 @@ static const struct file_operations ftrace_graph_fops = { | |||
2698 | 2698 | ||
2699 | static __init int ftrace_init_dyn_debugfs(struct dentry *d_tracer) | 2699 | static __init int ftrace_init_dyn_debugfs(struct dentry *d_tracer) |
2700 | { | 2700 | { |
2701 | struct dentry *entry; | ||
2702 | 2701 | ||
2703 | entry = debugfs_create_file("available_filter_functions", 0444, | 2702 | trace_create_file("available_filter_functions", 0444, |
2704 | d_tracer, NULL, &ftrace_avail_fops); | 2703 | d_tracer, NULL, &ftrace_avail_fops); |
2705 | if (!entry) | ||
2706 | pr_warning("Could not create debugfs " | ||
2707 | "'available_filter_functions' entry\n"); | ||
2708 | 2704 | ||
2709 | entry = debugfs_create_file("failures", 0444, | 2705 | trace_create_file("failures", 0444, |
2710 | d_tracer, NULL, &ftrace_failures_fops); | 2706 | d_tracer, NULL, &ftrace_failures_fops); |
2711 | if (!entry) | ||
2712 | pr_warning("Could not create debugfs 'failures' entry\n"); | ||
2713 | 2707 | ||
2714 | entry = debugfs_create_file("set_ftrace_filter", 0644, d_tracer, | 2708 | trace_create_file("set_ftrace_filter", 0644, d_tracer, |
2715 | NULL, &ftrace_filter_fops); | 2709 | NULL, &ftrace_filter_fops); |
2716 | if (!entry) | ||
2717 | pr_warning("Could not create debugfs " | ||
2718 | "'set_ftrace_filter' entry\n"); | ||
2719 | 2710 | ||
2720 | entry = debugfs_create_file("set_ftrace_notrace", 0644, d_tracer, | 2711 | trace_create_file("set_ftrace_notrace", 0644, d_tracer, |
2721 | NULL, &ftrace_notrace_fops); | 2712 | NULL, &ftrace_notrace_fops); |
2722 | if (!entry) | ||
2723 | pr_warning("Could not create debugfs " | ||
2724 | "'set_ftrace_notrace' entry\n"); | ||
2725 | 2713 | ||
2726 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 2714 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
2727 | entry = debugfs_create_file("set_graph_function", 0444, d_tracer, | 2715 | trace_create_file("set_graph_function", 0444, d_tracer, |
2728 | NULL, | 2716 | NULL, |
2729 | &ftrace_graph_fops); | 2717 | &ftrace_graph_fops); |
2730 | if (!entry) | ||
2731 | pr_warning("Could not create debugfs " | ||
2732 | "'set_graph_function' entry\n"); | ||
2733 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 2718 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
2734 | 2719 | ||
2735 | return 0; | 2720 | return 0; |
@@ -2987,7 +2972,6 @@ static const struct file_operations ftrace_pid_fops = { | |||
2987 | static __init int ftrace_init_debugfs(void) | 2972 | static __init int ftrace_init_debugfs(void) |
2988 | { | 2973 | { |
2989 | struct dentry *d_tracer; | 2974 | struct dentry *d_tracer; |
2990 | struct dentry *entry; | ||
2991 | 2975 | ||
2992 | d_tracer = tracing_init_dentry(); | 2976 | d_tracer = tracing_init_dentry(); |
2993 | if (!d_tracer) | 2977 | if (!d_tracer) |
@@ -2995,11 +2979,8 @@ static __init int ftrace_init_debugfs(void) | |||
2995 | 2979 | ||
2996 | ftrace_init_dyn_debugfs(d_tracer); | 2980 | ftrace_init_dyn_debugfs(d_tracer); |
2997 | 2981 | ||
2998 | entry = debugfs_create_file("set_ftrace_pid", 0644, d_tracer, | 2982 | trace_create_file("set_ftrace_pid", 0644, d_tracer, |
2999 | NULL, &ftrace_pid_fops); | 2983 | NULL, &ftrace_pid_fops); |
3000 | if (!entry) | ||
3001 | pr_warning("Could not create debugfs " | ||
3002 | "'set_ftrace_pid' entry\n"); | ||
3003 | 2984 | ||
3004 | ftrace_profile_debugfs(d_tracer); | 2985 | ftrace_profile_debugfs(d_tracer); |
3005 | 2986 | ||