Commit | Line | Data |
---|---|---|
867e359b CM |
1 | /* |
2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or | |
5 | * modify it under the terms of the GNU General Public License | |
6 | * as published by the Free Software Foundation, version 2. | |
7 | * | |
8 | * This program is distributed in the hope that it will be useful, but | |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | |
11 | * NON INFRINGEMENT. See the GNU General Public License for | |
12 | * more details. | |
13 | */ | |
14 | ||
15 | #include <linux/sched.h> | |
16 | #include <linux/kernel.h> | |
17 | #include <linux/kprobes.h> | |
18 | #include <linux/module.h> | |
19 | #include <linux/pfn.h> | |
20 | #include <linux/kallsyms.h> | |
21 | #include <linux/stacktrace.h> | |
22 | #include <linux/uaccess.h> | |
23 | #include <linux/mmzone.h> | |
5f639fdc CM |
24 | #include <linux/dcache.h> |
25 | #include <linux/fs.h> | |
867e359b CM |
26 | #include <asm/backtrace.h> |
27 | #include <asm/page.h> | |
867e359b | 28 | #include <asm/ucontext.h> |
34f2c0ac | 29 | #include <asm/switch_to.h> |
867e359b CM |
30 | #include <asm/sigframe.h> |
31 | #include <asm/stack.h> | |
32 | #include <arch/abi.h> | |
33 | #include <arch/interrupts.h> | |
34 | ||
dabe98c9 CM |
35 | #define KBT_ONGOING 0 /* Backtrace still ongoing */ |
36 | #define KBT_DONE 1 /* Backtrace cleanly completed */ | |
37 | #define KBT_RUNNING 2 /* Can't run backtrace on a running task */ | |
38 | #define KBT_LOOP 3 /* Backtrace entered a loop */ | |
867e359b CM |
39 | |
40 | /* Is address on the specified kernel stack? */ | |
93013a0f | 41 | static int in_kernel_stack(struct KBacktraceIterator *kbt, unsigned long sp) |
867e359b CM |
42 | { |
43 | ulong kstack_base = (ulong) kbt->task->stack; | |
44 | if (kstack_base == 0) /* corrupt task pointer; just follow stack... */ | |
45 | return sp >= PAGE_OFFSET && sp < (unsigned long)high_memory; | |
46 | return sp >= kstack_base && sp < kstack_base + THREAD_SIZE; | |
47 | } | |
48 | ||
867e359b | 49 | /* Callback for backtracer; basically a glorified memcpy */ |
93013a0f | 50 | static bool read_memory_func(void *result, unsigned long address, |
867e359b CM |
51 | unsigned int size, void *vkbt) |
52 | { | |
53 | int retval; | |
54 | struct KBacktraceIterator *kbt = (struct KBacktraceIterator *)vkbt; | |
5f639fdc CM |
55 | |
56 | if (address == 0) | |
57 | return 0; | |
3cebbafd | 58 | if (__kernel_text_address(address)) { |
867e359b CM |
59 | /* OK to read kernel code. */ |
60 | } else if (address >= PAGE_OFFSET) { | |
61 | /* We only tolerate kernel-space reads of this task's stack */ | |
62 | if (!in_kernel_stack(kbt, address)) | |
63 | return 0; | |
5f639fdc CM |
64 | } else if (!kbt->is_current) { |
65 | return 0; /* can't read from other user address spaces */ | |
867e359b CM |
66 | } |
67 | pagefault_disable(); | |
0707ad30 CM |
68 | retval = __copy_from_user_inatomic(result, |
69 | (void __user __force *)address, | |
867e359b CM |
70 | size); |
71 | pagefault_enable(); | |
72 | return (retval == 0); | |
73 | } | |
74 | ||
75 | /* Return a pt_regs pointer for a valid fault handler frame */ | |
76 | static struct pt_regs *valid_fault_handler(struct KBacktraceIterator* kbt) | |
77 | { | |
867e359b CM |
78 | const char *fault = NULL; /* happy compiler */ |
79 | char fault_buf[64]; | |
93013a0f | 80 | unsigned long sp = kbt->it.sp; |
867e359b CM |
81 | struct pt_regs *p; |
82 | ||
5f639fdc CM |
83 | if (sp % sizeof(long) != 0) |
84 | return NULL; | |
867e359b CM |
85 | if (!in_kernel_stack(kbt, sp)) |
86 | return NULL; | |
87 | if (!in_kernel_stack(kbt, sp + C_ABI_SAVE_AREA_SIZE + PTREGS_SIZE-1)) | |
88 | return NULL; | |
89 | p = (struct pt_regs *)(sp + C_ABI_SAVE_AREA_SIZE); | |
90 | if (p->faultnum == INT_SWINT_1 || p->faultnum == INT_SWINT_1_SIGRETURN) | |
91 | fault = "syscall"; | |
92 | else { | |
93 | if (kbt->verbose) { /* else we aren't going to use it */ | |
94 | snprintf(fault_buf, sizeof(fault_buf), | |
95 | "interrupt %ld", p->faultnum); | |
96 | fault = fault_buf; | |
97 | } | |
98 | } | |
99 | if (EX1_PL(p->ex1) == KERNEL_PL && | |
3cebbafd | 100 | __kernel_text_address(p->pc) && |
867e359b CM |
101 | in_kernel_stack(kbt, p->sp) && |
102 | p->sp >= sp) { | |
103 | if (kbt->verbose) | |
0707ad30 | 104 | pr_err(" <%s while in kernel mode>\n", fault); |
867e359b | 105 | } else if (EX1_PL(p->ex1) == USER_PL && |
3ef23111 | 106 | p->sp < PAGE_OFFSET && p->sp != 0) { |
867e359b | 107 | if (kbt->verbose) |
0707ad30 | 108 | pr_err(" <%s while in user mode>\n", fault); |
867e359b | 109 | } else if (kbt->verbose) { |
0707ad30 | 110 | pr_err(" (odd fault: pc %#lx, sp %#lx, ex1 %#lx?)\n", |
867e359b CM |
111 | p->pc, p->sp, p->ex1); |
112 | p = NULL; | |
113 | } | |
7f04f081 | 114 | if (!kbt->profile || ((1ULL << p->faultnum) & QUEUED_INTERRUPTS) == 0) |
867e359b | 115 | return p; |
867e359b CM |
116 | return NULL; |
117 | } | |
118 | ||
119 | /* Is the pc pointing to a sigreturn trampoline? */ | |
93013a0f | 120 | static int is_sigreturn(unsigned long pc) |
867e359b CM |
121 | { |
122 | return (pc == VDSO_BASE); | |
123 | } | |
124 | ||
125 | /* Return a pt_regs pointer for a valid signal handler frame */ | |
5f639fdc CM |
126 | static struct pt_regs *valid_sigframe(struct KBacktraceIterator* kbt, |
127 | struct rt_sigframe* kframe) | |
867e359b CM |
128 | { |
129 | BacktraceIterator *b = &kbt->it; | |
130 | ||
5f639fdc CM |
131 | if (b->pc == VDSO_BASE && b->sp < PAGE_OFFSET && |
132 | b->sp % sizeof(long) == 0) { | |
133 | int retval; | |
134 | pagefault_disable(); | |
135 | retval = __copy_from_user_inatomic( | |
136 | kframe, (void __user __force *)b->sp, | |
137 | sizeof(*kframe)); | |
138 | pagefault_enable(); | |
139 | if (retval != 0 || | |
140 | (unsigned int)(kframe->info.si_signo) >= _NSIG) | |
867e359b | 141 | return NULL; |
867e359b | 142 | if (kbt->verbose) { |
0707ad30 | 143 | pr_err(" <received signal %d>\n", |
5f639fdc | 144 | kframe->info.si_signo); |
867e359b | 145 | } |
5f639fdc | 146 | return (struct pt_regs *)&kframe->uc.uc_mcontext; |
867e359b CM |
147 | } |
148 | return NULL; | |
149 | } | |
150 | ||
0707ad30 | 151 | static int KBacktraceIterator_is_sigreturn(struct KBacktraceIterator *kbt) |
867e359b CM |
152 | { |
153 | return is_sigreturn(kbt->it.pc); | |
154 | } | |
155 | ||
156 | static int KBacktraceIterator_restart(struct KBacktraceIterator *kbt) | |
157 | { | |
158 | struct pt_regs *p; | |
5f639fdc | 159 | struct rt_sigframe kframe; |
867e359b CM |
160 | |
161 | p = valid_fault_handler(kbt); | |
162 | if (p == NULL) | |
5f639fdc | 163 | p = valid_sigframe(kbt, &kframe); |
867e359b CM |
164 | if (p == NULL) |
165 | return 0; | |
166 | backtrace_init(&kbt->it, read_memory_func, kbt, | |
167 | p->pc, p->lr, p->sp, p->regs[52]); | |
168 | kbt->new_context = 1; | |
169 | return 1; | |
170 | } | |
171 | ||
172 | /* Find a frame that isn't a sigreturn, if there is one. */ | |
173 | static int KBacktraceIterator_next_item_inclusive( | |
174 | struct KBacktraceIterator *kbt) | |
175 | { | |
176 | for (;;) { | |
177 | do { | |
178 | if (!KBacktraceIterator_is_sigreturn(kbt)) | |
dabe98c9 | 179 | return KBT_ONGOING; |
867e359b CM |
180 | } while (backtrace_next(&kbt->it)); |
181 | ||
182 | if (!KBacktraceIterator_restart(kbt)) | |
dabe98c9 | 183 | return KBT_DONE; |
867e359b CM |
184 | } |
185 | } | |
186 | ||
187 | /* | |
188 | * If the current sp is on a page different than what we recorded | |
189 | * as the top-of-kernel-stack last time we context switched, we have | |
190 | * probably blown the stack, and nothing is going to work out well. | |
191 | * If we can at least get out a warning, that may help the debug, | |
192 | * though we probably won't be able to backtrace into the code that | |
193 | * actually did the recursive damage. | |
194 | */ | |
195 | static void validate_stack(struct pt_regs *regs) | |
196 | { | |
bc1a298f | 197 | int cpu = raw_smp_processor_id(); |
867e359b CM |
198 | unsigned long ksp0 = get_current_ksp0(); |
199 | unsigned long ksp0_base = ksp0 - THREAD_SIZE; | |
200 | unsigned long sp = stack_pointer; | |
201 | ||
202 | if (EX1_PL(regs->ex1) == KERNEL_PL && regs->sp >= ksp0) { | |
0707ad30 | 203 | pr_err("WARNING: cpu %d: kernel stack page %#lx underrun!\n" |
867e359b CM |
204 | " sp %#lx (%#lx in caller), caller pc %#lx, lr %#lx\n", |
205 | cpu, ksp0_base, sp, regs->sp, regs->pc, regs->lr); | |
206 | } | |
207 | ||
208 | else if (sp < ksp0_base + sizeof(struct thread_info)) { | |
0707ad30 | 209 | pr_err("WARNING: cpu %d: kernel stack page %#lx overrun!\n" |
867e359b CM |
210 | " sp %#lx (%#lx in caller), caller pc %#lx, lr %#lx\n", |
211 | cpu, ksp0_base, sp, regs->sp, regs->pc, regs->lr); | |
212 | } | |
213 | } | |
214 | ||
215 | void KBacktraceIterator_init(struct KBacktraceIterator *kbt, | |
216 | struct task_struct *t, struct pt_regs *regs) | |
217 | { | |
93013a0f | 218 | unsigned long pc, lr, sp, r52; |
867e359b CM |
219 | int is_current; |
220 | ||
221 | /* | |
222 | * Set up callback information. We grab the kernel stack base | |
5f639fdc | 223 | * so we will allow reads of that address range. |
867e359b | 224 | */ |
5f639fdc | 225 | is_current = (t == NULL || t == current); |
867e359b CM |
226 | kbt->is_current = is_current; |
227 | if (is_current) | |
228 | t = validate_current(); | |
229 | kbt->task = t; | |
867e359b CM |
230 | kbt->verbose = 0; /* override in caller if desired */ |
231 | kbt->profile = 0; /* override in caller if desired */ | |
dabe98c9 | 232 | kbt->end = KBT_ONGOING; |
5f639fdc CM |
233 | kbt->new_context = 1; |
234 | if (is_current) | |
867e359b | 235 | validate_stack(regs); |
867e359b CM |
236 | |
237 | if (regs == NULL) { | |
867e359b CM |
238 | if (is_current || t->state == TASK_RUNNING) { |
239 | /* Can't do this; we need registers */ | |
dabe98c9 | 240 | kbt->end = KBT_RUNNING; |
867e359b CM |
241 | return; |
242 | } | |
0707ad30 | 243 | pc = get_switch_to_pc(); |
867e359b CM |
244 | lr = t->thread.pc; |
245 | sp = t->thread.ksp; | |
246 | r52 = 0; | |
247 | } else { | |
248 | pc = regs->pc; | |
249 | lr = regs->lr; | |
250 | sp = regs->sp; | |
251 | r52 = regs->regs[52]; | |
252 | } | |
253 | ||
254 | backtrace_init(&kbt->it, read_memory_func, kbt, pc, lr, sp, r52); | |
dabe98c9 | 255 | kbt->end = KBacktraceIterator_next_item_inclusive(kbt); |
867e359b CM |
256 | } |
257 | EXPORT_SYMBOL(KBacktraceIterator_init); | |
258 | ||
259 | int KBacktraceIterator_end(struct KBacktraceIterator *kbt) | |
260 | { | |
dabe98c9 | 261 | return kbt->end != KBT_ONGOING; |
867e359b CM |
262 | } |
263 | EXPORT_SYMBOL(KBacktraceIterator_end); | |
264 | ||
265 | void KBacktraceIterator_next(struct KBacktraceIterator *kbt) | |
266 | { | |
93013a0f | 267 | unsigned long old_pc = kbt->it.pc, old_sp = kbt->it.sp; |
867e359b | 268 | kbt->new_context = 0; |
dabe98c9 CM |
269 | if (!backtrace_next(&kbt->it) && !KBacktraceIterator_restart(kbt)) { |
270 | kbt->end = KBT_DONE; | |
271 | return; | |
272 | } | |
273 | kbt->end = KBacktraceIterator_next_item_inclusive(kbt); | |
274 | if (old_pc == kbt->it.pc && old_sp == kbt->it.sp) { | |
275 | /* Trapped in a loop; give up. */ | |
276 | kbt->end = KBT_LOOP; | |
277 | } | |
867e359b CM |
278 | } |
279 | EXPORT_SYMBOL(KBacktraceIterator_next); | |
280 | ||
5f639fdc CM |
281 | static void describe_addr(struct KBacktraceIterator *kbt, |
282 | unsigned long address, | |
283 | int have_mmap_sem, char *buf, size_t bufsize) | |
284 | { | |
285 | struct vm_area_struct *vma; | |
286 | size_t namelen, remaining; | |
287 | unsigned long size, offset, adjust; | |
288 | char *p, *modname; | |
289 | const char *name; | |
290 | int rc; | |
291 | ||
292 | /* | |
293 | * Look one byte back for every caller frame (i.e. those that | |
294 | * aren't a new context) so we look up symbol data for the | |
295 | * call itself, not the following instruction, which may be on | |
296 | * a different line (or in a different function). | |
297 | */ | |
298 | adjust = !kbt->new_context; | |
299 | address -= adjust; | |
300 | ||
301 | if (address >= PAGE_OFFSET) { | |
302 | /* Handle kernel symbols. */ | |
303 | BUG_ON(bufsize < KSYM_NAME_LEN); | |
304 | name = kallsyms_lookup(address, &size, &offset, | |
305 | &modname, buf); | |
306 | if (name == NULL) { | |
307 | buf[0] = '\0'; | |
308 | return; | |
309 | } | |
310 | namelen = strlen(buf); | |
311 | remaining = (bufsize - 1) - namelen; | |
312 | p = buf + namelen; | |
313 | rc = snprintf(p, remaining, "+%#lx/%#lx ", | |
314 | offset + adjust, size); | |
315 | if (modname && rc < remaining) | |
316 | snprintf(p + rc, remaining - rc, "[%s] ", modname); | |
317 | buf[bufsize-1] = '\0'; | |
318 | return; | |
319 | } | |
320 | ||
321 | /* If we don't have the mmap_sem, we can't show any more info. */ | |
322 | buf[0] = '\0'; | |
323 | if (!have_mmap_sem) | |
324 | return; | |
325 | ||
326 | /* Find vma info. */ | |
327 | vma = find_vma(kbt->task->mm, address); | |
328 | if (vma == NULL || address < vma->vm_start) { | |
329 | snprintf(buf, bufsize, "[unmapped address] "); | |
330 | return; | |
331 | } | |
332 | ||
333 | if (vma->vm_file) { | |
334 | char *s; | |
335 | p = d_path(&vma->vm_file->f_path, buf, bufsize); | |
336 | if (IS_ERR(p)) | |
337 | p = "?"; | |
338 | s = strrchr(p, '/'); | |
339 | if (s) | |
340 | p = s+1; | |
341 | } else { | |
342 | p = "anon"; | |
343 | } | |
344 | ||
345 | /* Generate a string description of the vma info. */ | |
346 | namelen = strlen(p); | |
347 | remaining = (bufsize - 1) - namelen; | |
348 | memmove(buf, p, namelen); | |
349 | snprintf(buf + namelen, remaining, "[%lx+%lx] ", | |
350 | vma->vm_start, vma->vm_end - vma->vm_start); | |
351 | } | |
352 | ||
3ef23111 CM |
353 | /* |
354 | * Avoid possible crash recursion during backtrace. If it happens, it | |
355 | * makes it easy to lose the actual root cause of the failure, so we | |
356 | * put a simple guard on all the backtrace loops. | |
357 | */ | |
358 | static bool start_backtrace(void) | |
359 | { | |
360 | if (current->thread.in_backtrace) { | |
361 | pr_err("Backtrace requested while in backtrace!\n"); | |
362 | return false; | |
363 | } | |
364 | current->thread.in_backtrace = true; | |
365 | return true; | |
366 | } | |
367 | ||
368 | static void end_backtrace(void) | |
369 | { | |
370 | current->thread.in_backtrace = false; | |
371 | } | |
372 | ||
867e359b CM |
373 | /* |
374 | * This method wraps the backtracer's more generic support. | |
375 | * It is only invoked from the architecture-specific code; show_stack() | |
376 | * and dump_stack() (in entry.S) are architecture-independent entry points. | |
377 | */ | |
378 | void tile_show_stack(struct KBacktraceIterator *kbt, int headers) | |
379 | { | |
380 | int i; | |
5f639fdc | 381 | int have_mmap_sem = 0; |
867e359b | 382 | |
3ef23111 CM |
383 | if (!start_backtrace()) |
384 | return; | |
867e359b CM |
385 | if (headers) { |
386 | /* | |
387 | * Add a blank line since if we are called from panic(), | |
388 | * then bust_spinlocks() spit out a space in front of us | |
389 | * and it will mess up our KERN_ERR. | |
390 | */ | |
0707ad30 CM |
391 | pr_err("\n"); |
392 | pr_err("Starting stack dump of tid %d, pid %d (%s)" | |
867e359b CM |
393 | " on cpu %d at cycle %lld\n", |
394 | kbt->task->pid, kbt->task->tgid, kbt->task->comm, | |
bc1a298f | 395 | raw_smp_processor_id(), get_cycles()); |
867e359b | 396 | } |
867e359b CM |
397 | kbt->verbose = 1; |
398 | i = 0; | |
399 | for (; !KBacktraceIterator_end(kbt); KBacktraceIterator_next(kbt)) { | |
867e359b | 400 | char namebuf[KSYM_NAME_LEN+100]; |
5f639fdc | 401 | unsigned long address = kbt->it.pc; |
867e359b | 402 | |
5f639fdc CM |
403 | /* Try to acquire the mmap_sem as we pass into userspace. */ |
404 | if (address < PAGE_OFFSET && !have_mmap_sem && kbt->task->mm) | |
405 | have_mmap_sem = | |
406 | down_read_trylock(&kbt->task->mm->mmap_sem); | |
407 | ||
408 | describe_addr(kbt, address, have_mmap_sem, | |
409 | namebuf, sizeof(namebuf)); | |
867e359b | 410 | |
0707ad30 | 411 | pr_err(" frame %d: 0x%lx %s(sp 0x%lx)\n", |
867e359b CM |
412 | i++, address, namebuf, (unsigned long)(kbt->it.sp)); |
413 | ||
414 | if (i >= 100) { | |
0707ad30 | 415 | pr_err("Stack dump truncated" |
867e359b CM |
416 | " (%d frames)\n", i); |
417 | break; | |
418 | } | |
419 | } | |
dabe98c9 CM |
420 | if (kbt->end == KBT_LOOP) |
421 | pr_err("Stack dump stopped; next frame identical to this one\n"); | |
867e359b | 422 | if (headers) |
0707ad30 | 423 | pr_err("Stack dump complete\n"); |
5f639fdc CM |
424 | if (have_mmap_sem) |
425 | up_read(&kbt->task->mm->mmap_sem); | |
3ef23111 | 426 | end_backtrace(); |
867e359b CM |
427 | } |
428 | EXPORT_SYMBOL(tile_show_stack); | |
429 | ||
430 | ||
431 | /* This is called from show_regs() and _dump_stack() */ | |
432 | void dump_stack_regs(struct pt_regs *regs) | |
433 | { | |
434 | struct KBacktraceIterator kbt; | |
435 | KBacktraceIterator_init(&kbt, NULL, regs); | |
436 | tile_show_stack(&kbt, 1); | |
437 | } | |
438 | EXPORT_SYMBOL(dump_stack_regs); | |
439 | ||
440 | static struct pt_regs *regs_to_pt_regs(struct pt_regs *regs, | |
441 | ulong pc, ulong lr, ulong sp, ulong r52) | |
442 | { | |
443 | memset(regs, 0, sizeof(struct pt_regs)); | |
444 | regs->pc = pc; | |
445 | regs->lr = lr; | |
446 | regs->sp = sp; | |
447 | regs->regs[52] = r52; | |
448 | return regs; | |
449 | } | |
450 | ||
451 | /* This is called from dump_stack() and just converts to pt_regs */ | |
452 | void _dump_stack(int dummy, ulong pc, ulong lr, ulong sp, ulong r52) | |
453 | { | |
454 | struct pt_regs regs; | |
455 | dump_stack_regs(regs_to_pt_regs(®s, pc, lr, sp, r52)); | |
456 | } | |
457 | ||
458 | /* This is called from KBacktraceIterator_init_current() */ | |
459 | void _KBacktraceIterator_init_current(struct KBacktraceIterator *kbt, ulong pc, | |
460 | ulong lr, ulong sp, ulong r52) | |
461 | { | |
462 | struct pt_regs regs; | |
463 | KBacktraceIterator_init(kbt, NULL, | |
464 | regs_to_pt_regs(®s, pc, lr, sp, r52)); | |
465 | } | |
466 | ||
0a0fca9d | 467 | /* This is called only from kernel/sched/core.c, with esp == NULL */ |
867e359b CM |
468 | void show_stack(struct task_struct *task, unsigned long *esp) |
469 | { | |
470 | struct KBacktraceIterator kbt; | |
471 | if (task == NULL || task == current) | |
472 | KBacktraceIterator_init_current(&kbt); | |
473 | else | |
474 | KBacktraceIterator_init(&kbt, task, NULL); | |
475 | tile_show_stack(&kbt, 0); | |
476 | } | |
477 | ||
478 | #ifdef CONFIG_STACKTRACE | |
479 | ||
480 | /* Support generic Linux stack API too */ | |
481 | ||
482 | void save_stack_trace_tsk(struct task_struct *task, struct stack_trace *trace) | |
483 | { | |
484 | struct KBacktraceIterator kbt; | |
485 | int skip = trace->skip; | |
486 | int i = 0; | |
487 | ||
3ef23111 CM |
488 | if (!start_backtrace()) |
489 | goto done; | |
867e359b CM |
490 | if (task == NULL || task == current) |
491 | KBacktraceIterator_init_current(&kbt); | |
492 | else | |
493 | KBacktraceIterator_init(&kbt, task, NULL); | |
494 | for (; !KBacktraceIterator_end(&kbt); KBacktraceIterator_next(&kbt)) { | |
495 | if (skip) { | |
496 | --skip; | |
497 | continue; | |
498 | } | |
499 | if (i >= trace->max_entries || kbt.it.pc < PAGE_OFFSET) | |
500 | break; | |
501 | trace->entries[i++] = kbt.it.pc; | |
502 | } | |
3ef23111 CM |
503 | end_backtrace(); |
504 | done: | |
867e359b CM |
505 | trace->nr_entries = i; |
506 | } | |
507 | EXPORT_SYMBOL(save_stack_trace_tsk); | |
508 | ||
509 | void save_stack_trace(struct stack_trace *trace) | |
510 | { | |
511 | save_stack_trace_tsk(NULL, trace); | |
512 | } | |
7c63e1ee | 513 | EXPORT_SYMBOL_GPL(save_stack_trace); |
867e359b CM |
514 | |
515 | #endif | |
516 | ||
517 | /* In entry.S */ | |
518 | EXPORT_SYMBOL(KBacktraceIterator_init_current); |