2012-05-19 10:22:14

by Namhyung Kim

[permalink] [raw]
Subject: [tip:perf/core] tracing: Check return value of tracing_dentry_percpu()

Commit-ID: 0a3d7ce7e6caa8c39cb5184bd9047a01a40abc2a
Gitweb: http://git.kernel.org/tip/0a3d7ce7e6caa8c39cb5184bd9047a01a40abc2a
Author: Namhyung Kim <[email protected]>
AuthorDate: Mon, 23 Apr 2012 10:11:57 +0900
Committer: Steven Rostedt <[email protected]>
CommitDate: Wed, 16 May 2012 19:50:37 -0400

tracing: Check return value of tracing_dentry_percpu()

If tracing_dentry_percpu() failed, tracing_init_debugfs_percpu()
will try to create each cpu directories on debugfs' root directory
as d_percpu is NULL.

Link: http://lkml.kernel.org/r/[email protected]

Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
---
kernel/trace/trace.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index dfbd86c..0ed4df0 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4474,6 +4474,9 @@ static void tracing_init_debugfs_percpu(long cpu)
struct dentry *d_cpu;
char cpu_dir[30]; /* 30 characters should be more than enough */

+ if (!d_percpu)
+ return;
+
snprintf(cpu_dir, 30, "cpu%ld", cpu);
d_cpu = debugfs_create_dir(cpu_dir, d_percpu);
if (!d_cpu) {