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/trace_stack.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/trace_stack.c')
-rw-r--r-- | kernel/trace/trace_stack.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index c750f65f9661..1796f00524e1 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c | |||
@@ -352,19 +352,14 @@ __setup("stacktrace", enable_stacktrace); | |||
352 | static __init int stack_trace_init(void) | 352 | static __init int stack_trace_init(void) |
353 | { | 353 | { |
354 | struct dentry *d_tracer; | 354 | struct dentry *d_tracer; |
355 | struct dentry *entry; | ||
356 | 355 | ||
357 | d_tracer = tracing_init_dentry(); | 356 | d_tracer = tracing_init_dentry(); |
358 | 357 | ||
359 | entry = debugfs_create_file("stack_max_size", 0644, d_tracer, | 358 | trace_create_file("stack_max_size", 0644, d_tracer, |
360 | &max_stack_size, &stack_max_size_fops); | 359 | &max_stack_size, &stack_max_size_fops); |
361 | if (!entry) | ||
362 | pr_warning("Could not create debugfs 'stack_max_size' entry\n"); | ||
363 | 360 | ||
364 | entry = debugfs_create_file("stack_trace", 0444, d_tracer, | 361 | trace_create_file("stack_trace", 0444, d_tracer, |
365 | NULL, &stack_trace_fops); | 362 | NULL, &stack_trace_fops); |
366 | if (!entry) | ||
367 | pr_warning("Could not create debugfs 'stack_trace' entry\n"); | ||
368 | 363 | ||
369 | if (stack_tracer_enabled) | 364 | if (stack_tracer_enabled) |
370 | register_ftrace_function(&trace_ops); | 365 | register_ftrace_function(&trace_ops); |