aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d8d899f3bd6f..bdaf60d3d337 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3061,28 +3061,31 @@ struct dentry *tracing_dentry_percpu(void)
3061static void tracing_init_debugfs_percpu(long cpu) 3061static void tracing_init_debugfs_percpu(long cpu)
3062{ 3062{
3063 struct dentry *d_percpu = tracing_dentry_percpu(); 3063 struct dentry *d_percpu = tracing_dentry_percpu();
3064 struct dentry *entry; 3064 struct dentry *entry, *d_cpu;
3065 /* strlen(trace_pipe) + MAX(log10(cpu)) + '\0' */ 3065 /* strlen(cpu) + MAX(log10(cpu)) + '\0' */
3066 char filename[17]; 3066 char cpu_dir[7];
3067 3067
3068 if (cpu > 999 || cpu < 0) 3068 if (cpu > 999 || cpu < 0)
3069 return; 3069 return;
3070 3070
3071 /* per cpu trace_pipe */ 3071 sprintf(cpu_dir, "cpu%ld", cpu);
3072 sprintf(filename, "trace_pipe%ld", cpu); 3072 d_cpu = debugfs_create_dir(cpu_dir, d_percpu);
3073 if (!d_cpu) {
3074 pr_warning("Could not create debugfs '%s' entry\n", cpu_dir);
3075 return;
3076 }
3073 3077
3074 entry = debugfs_create_file(filename, 0444, d_percpu, 3078 /* per cpu trace_pipe */
3079 entry = debugfs_create_file("trace_pipe", 0444, d_cpu,
3075 (void *) cpu, &tracing_pipe_fops); 3080 (void *) cpu, &tracing_pipe_fops);
3076 if (!entry) 3081 if (!entry)
3077 pr_warning("Could not create debugfs '%s' entry\n", filename); 3082 pr_warning("Could not create debugfs 'trace_pipe' entry\n");
3078 3083
3079 /* per cpu trace */ 3084 /* per cpu trace */
3080 sprintf(filename, "trace%ld", cpu); 3085 entry = debugfs_create_file("trace", 0444, d_cpu,
3081
3082 entry = debugfs_create_file(filename, 0444, d_percpu,
3083 (void *) cpu, &tracing_fops); 3086 (void *) cpu, &tracing_fops);
3084 if (!entry) 3087 if (!entry)
3085 pr_warning("Could not create debugfs '%s' entry\n", filename); 3088 pr_warning("Could not create debugfs 'trace' entry\n");
3086} 3089}
3087 3090
3088#ifdef CONFIG_FTRACE_SELFTEST 3091#ifdef CONFIG_FTRACE_SELFTEST