diff options
Diffstat (limited to 'kernel/trace/trace_stack.c')
-rw-r--r-- | kernel/trace/trace_stack.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index d0871bc0aca5..c750f65f9661 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c | |||
@@ -245,16 +245,31 @@ 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; |
251 | int size; | 262 | int size; |
252 | 263 | ||
253 | if (v == SEQ_START_TOKEN) { | 264 | if (v == SEQ_START_TOKEN) { |
254 | seq_printf(m, " Depth Size Location" | 265 | seq_printf(m, " Depth Size Location" |
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 | ||