aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-02-25 18:41:38 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-26 08:04:08 -0500
commit8656e7a2fa6afcd8682990f804a2a9674568738f (patch)
tree4577aacda59cec3e71bc0cd97c0f18c823b5743e /kernel/trace/trace.c
parentf4abfb8d0da70e436013e5799338357e1e6a0832 (diff)
tracing/core: make the per cpu trace files in per cpu directories
Impact: restructure the VFS layout of per CPU trace buffers The per cpu trace files are all in a single directory: /debug/tracing/per_cpu. In case of a large number of cpu, the content of this directory becomes messy so we create now one directory per cpu inside /debug/tracing/per_cpu which contain each their own trace_pipe and trace files. Ie: /debug/tracing$ ls -R per_cpu per_cpu: cpu0 cpu1 per_cpu/cpu0: trace trace_pipe per_cpu/cpu1: trace trace_pipe Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.c')
-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