diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-03-12 19:42:29 -0400 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-12 21:15:01 -0400 |
commit | e447e1df2e568cd43d1918963c9f09fae85aea57 (patch) | |
tree | a73edfcc1b603a921ed7e332ce614e1345385100 /kernel/trace/trace_stack.c | |
parent | 2da03ecee6308ea174e8a02b92a3c4ec92e886c8 (diff) |
tracing: explain why stack tracer is empty
If the stack tracing is disabled (by default) the stack_trace file
will only contain the header:
# cat /debug/tracing/stack_trace
Depth Size Location (0 entries)
----- ---- --------
This can be frustrating to a developer that does not realize that the
stack tracer is disabled. This patch adds the following text:
# cat /debug/tracing/stack_trace
Depth Size Location (0 entries)
----- ---- --------
#
# Stack tracer disabled
#
# To enable the stack tracer, either add 'stacktrace' to the
# kernel command line
# or 'echo 1 > /proc/sys/kernel/stack_tracer_enabled'
#
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/trace_stack.c')
-rw-r--r-- | kernel/trace/trace_stack.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index 4564fd94b0cd..91ccbf396c9a 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c | |||
@@ -245,6 +245,17 @@ static int trace_lookup_stack(struct seq_file *m, long i) | |||
245 | #endif | 245 | #endif |
246 | } | 246 | } |
247 | 247 | ||
248 | static void print_disabled(struct seq_file *m) | ||
249 | { | ||
250 | seq_puts(m, "#\n" | ||
251 | "# Stack tracer disabled\n" | ||
252 | "#\n" | ||
253 | "# To enable the stack tracer, either add 'stacktrace' to the\n" | ||
254 | "# kernel command line\n" | ||
255 | "# or 'echo 1 > /proc/sys/kernel/stack_tracer_enabled'\n" | ||
256 | "#\n"); | ||
257 | } | ||
258 | |||
248 | static int t_show(struct seq_file *m, void *v) | 259 | static int t_show(struct seq_file *m, void *v) |
249 | { | 260 | { |
250 | long i; | 261 | long i; |
@@ -255,6 +266,10 @@ static int t_show(struct seq_file *m, void *v) | |||
255 | " (%d entries)\n" | 266 | " (%d entries)\n" |
256 | " ----- ---- --------\n", | 267 | " ----- ---- --------\n", |
257 | max_stack_trace.nr_entries); | 268 | max_stack_trace.nr_entries); |
269 | |||
270 | if (!stack_tracer_enabled && !max_stack_size) | ||
271 | print_disabled(m); | ||
272 | |||
258 | return 0; | 273 | return 0; |
259 | } | 274 | } |
260 | 275 | ||