Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (38 sloc) 1.084 kb
8637c09 [PATCH] lockdep: stacktrace subsystem, core
Ingo Molnar authored
1 /*
2 * kernel/stacktrace.c
3 *
4 * Stack trace management functions
5 *
6 * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
7 */
8 #include <linux/sched.h>
9212ddb stacktrace: provide save_stack_trace_tsk() weak alias
Ingo Molnar authored
9 #include <linux/kernel.h>
9984de1 kernel: Map most files to use export.h instead of module.h
Paul Gortmaker authored
10 #include <linux/export.h>
8637c09 [PATCH] lockdep: stacktrace subsystem, core
Ingo Molnar authored
11 #include <linux/kallsyms.h>
12 #include <linux/stacktrace.h>
13
14 void print_stack_trace(struct stack_trace *trace, int spaces)
15 {
a5a242d @vegard stacktrace: print_stack_trace() cleanup
vegard authored
16 int i;
8637c09 [PATCH] lockdep: stacktrace subsystem, core
Ingo Molnar authored
17
bfeeeeb @jmberg stacktrace: don't crash on invalid stack trace structs
jmberg authored
18 if (WARN_ON(!trace->entries))
19 return;
20
8637c09 [PATCH] lockdep: stacktrace subsystem, core
Ingo Molnar authored
21 for (i = 0; i < trace->nr_entries; i++) {
a5a242d @vegard stacktrace: print_stack_trace() cleanup
vegard authored
22 printk("%*c", 1 + spaces, ' ');
23 print_ip_sym(trace->entries[i]);
8637c09 [PATCH] lockdep: stacktrace subsystem, core
Ingo Molnar authored
24 }
25 }
8594698 stacktrace: fix modular build, export print_stack_trace and save_stack_t...
Ingo Molnar authored
26 EXPORT_SYMBOL_GPL(print_stack_trace);
8637c09 [PATCH] lockdep: stacktrace subsystem, core
Ingo Molnar authored
27
9212ddb stacktrace: provide save_stack_trace_tsk() weak alias
Ingo Molnar authored
28 /*
c624d33 @mhiramathitachi stack_trace: Add weak save_stack_trace_regs()
mhiramathitachi authored
29 * Architectures that do not implement save_stack_trace_tsk or
30 * save_stack_trace_regs get this weak alias and a once-per-bootup warning
31 * (whenever this facility is utilized - for example by procfs):
9212ddb stacktrace: provide save_stack_trace_tsk() weak alias
Ingo Molnar authored
32 */
33 __weak void
34 save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
35 {
36 WARN_ONCE(1, KERN_INFO "save_stack_trace_tsk() not implemented yet.\n");
37 }
c624d33 @mhiramathitachi stack_trace: Add weak save_stack_trace_regs()
mhiramathitachi authored
38
39 __weak void
40 save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace)
41 {
42 WARN_ONCE(1, KERN_INFO "save_stack_trace_regs() not implemented yet.\n");
43 }
Something went wrong with that request. Please try again.