.. | .. |
---|
17 | 17 | #include <linux/types.h> |
---|
18 | 18 | #include <linux/sched.h> |
---|
19 | 19 | #include <linux/sched/debug.h> |
---|
| 20 | +#include <linux/sched/task.h> |
---|
20 | 21 | #include <linux/mm_types.h> |
---|
21 | 22 | #include <linux/kernel.h> |
---|
22 | 23 | #include <linux/errno.h> |
---|
.. | .. |
---|
110 | 111 | dump(fp); |
---|
111 | 112 | |
---|
112 | 113 | spin_unlock_irq(&die_lock); |
---|
113 | | - do_exit(SIGSEGV); |
---|
| 114 | + make_task_dead(SIGSEGV); |
---|
114 | 115 | } |
---|
115 | 116 | |
---|
116 | 117 | static int kstack_depth_to_print = 24; |
---|
117 | 118 | |
---|
118 | | -void show_stack(struct task_struct *task, unsigned long *esp) |
---|
| 119 | +void show_stack(struct task_struct *task, unsigned long *esp, const char *loglvl) |
---|
119 | 120 | { |
---|
120 | 121 | unsigned long *stack, addr; |
---|
121 | 122 | int i; |
---|
.. | .. |
---|
125 | 126 | |
---|
126 | 127 | stack = esp; |
---|
127 | 128 | |
---|
128 | | - pr_info("Stack from %08lx:", (unsigned long)stack); |
---|
| 129 | + printk("%sStack from %08lx:", loglvl, (unsigned long)stack); |
---|
129 | 130 | for (i = 0; i < kstack_depth_to_print; i++) { |
---|
130 | 131 | if (((unsigned long)stack & (THREAD_SIZE - 1)) >= |
---|
131 | 132 | THREAD_SIZE-4) |
---|
132 | 133 | break; |
---|
133 | 134 | if (i % 8 == 0) |
---|
134 | | - pr_info(" "); |
---|
| 135 | + printk("%s ", loglvl); |
---|
135 | 136 | pr_cont(" %08lx", *stack++); |
---|
136 | 137 | } |
---|
137 | 138 | |
---|
138 | | - pr_info("\nCall Trace:\n"); |
---|
| 139 | + printk("%s\nCall Trace:\n", loglvl); |
---|
139 | 140 | i = 0; |
---|
140 | 141 | stack = esp; |
---|
141 | 142 | while (((unsigned long)stack & (THREAD_SIZE - 1)) < THREAD_SIZE-4) { |
---|
.. | .. |
---|
150 | 151 | */ |
---|
151 | 152 | if (check_kernel_text(addr)) { |
---|
152 | 153 | if (i % 4 == 0) |
---|
153 | | - pr_info(" "); |
---|
| 154 | + printk("%s ", loglvl); |
---|
154 | 155 | pr_cont(" [<%08lx>]", addr); |
---|
155 | 156 | i++; |
---|
156 | 157 | } |
---|
157 | 158 | } |
---|
158 | | - pr_info("\n"); |
---|
| 159 | + printk("%s\n", loglvl); |
---|
159 | 160 | } |
---|