• Home
  • Raw
  • Download

Lines Matching refs:kbt

43 static int in_kernel_stack(struct KBacktraceIterator *kbt, unsigned long sp)  in in_kernel_stack()  argument
45 ulong kstack_base = (ulong) kbt->task->stack; in in_kernel_stack()
56 struct KBacktraceIterator *kbt = (struct KBacktraceIterator *)vkbt; in read_memory_func() local
64 if (!in_kernel_stack(kbt, address)) in read_memory_func()
66 } else if (!kbt->is_current) { in read_memory_func()
78 static struct pt_regs *valid_fault_handler(struct KBacktraceIterator* kbt) in valid_fault_handler() argument
82 unsigned long sp = kbt->it.sp; in valid_fault_handler()
87 if (!in_kernel_stack(kbt, sp)) in valid_fault_handler()
89 if (!in_kernel_stack(kbt, sp + C_ABI_SAVE_AREA_SIZE + PTREGS_SIZE-1)) in valid_fault_handler()
95 if (kbt->verbose) { /* else we aren't going to use it */ in valid_fault_handler()
103 in_kernel_stack(kbt, p->sp) && in valid_fault_handler()
105 if (kbt->verbose) in valid_fault_handler()
109 if (kbt->verbose) in valid_fault_handler()
111 } else if (kbt->verbose) { in valid_fault_handler()
116 if (!kbt->profile || ((1ULL << p->faultnum) & QUEUED_INTERRUPTS) == 0) in valid_fault_handler()
128 static struct pt_regs *valid_sigframe(struct KBacktraceIterator* kbt, in valid_sigframe() argument
131 BacktraceIterator *b = &kbt->it; in valid_sigframe()
144 if (kbt->verbose) { in valid_sigframe()
153 static int KBacktraceIterator_is_sigreturn(struct KBacktraceIterator *kbt) in KBacktraceIterator_is_sigreturn() argument
155 return is_sigreturn(kbt->it.pc); in KBacktraceIterator_is_sigreturn()
158 static int KBacktraceIterator_restart(struct KBacktraceIterator *kbt) in KBacktraceIterator_restart() argument
163 p = valid_fault_handler(kbt); in KBacktraceIterator_restart()
165 p = valid_sigframe(kbt, &kframe); in KBacktraceIterator_restart()
168 backtrace_init(&kbt->it, read_memory_func, kbt, in KBacktraceIterator_restart()
170 kbt->new_context = 1; in KBacktraceIterator_restart()
176 struct KBacktraceIterator *kbt) in KBacktraceIterator_next_item_inclusive() argument
180 if (!KBacktraceIterator_is_sigreturn(kbt)) in KBacktraceIterator_next_item_inclusive()
182 } while (backtrace_next(&kbt->it)); in KBacktraceIterator_next_item_inclusive()
184 if (!KBacktraceIterator_restart(kbt)) in KBacktraceIterator_next_item_inclusive()
217 void KBacktraceIterator_init(struct KBacktraceIterator *kbt, in KBacktraceIterator_init() argument
228 kbt->is_current = is_current; in KBacktraceIterator_init()
231 kbt->task = t; in KBacktraceIterator_init()
232 kbt->verbose = 0; /* override in caller if desired */ in KBacktraceIterator_init()
233 kbt->profile = 0; /* override in caller if desired */ in KBacktraceIterator_init()
234 kbt->end = KBT_ONGOING; in KBacktraceIterator_init()
235 kbt->new_context = 1; in KBacktraceIterator_init()
242 kbt->end = KBT_RUNNING; in KBacktraceIterator_init()
256 backtrace_init(&kbt->it, read_memory_func, kbt, pc, lr, sp, r52); in KBacktraceIterator_init()
257 kbt->end = KBacktraceIterator_next_item_inclusive(kbt); in KBacktraceIterator_init()
261 int KBacktraceIterator_end(struct KBacktraceIterator *kbt) in KBacktraceIterator_end() argument
263 return kbt->end != KBT_ONGOING; in KBacktraceIterator_end()
267 void KBacktraceIterator_next(struct KBacktraceIterator *kbt) in KBacktraceIterator_next() argument
269 unsigned long old_pc = kbt->it.pc, old_sp = kbt->it.sp; in KBacktraceIterator_next()
270 kbt->new_context = 0; in KBacktraceIterator_next()
271 if (!backtrace_next(&kbt->it) && !KBacktraceIterator_restart(kbt)) { in KBacktraceIterator_next()
272 kbt->end = KBT_DONE; in KBacktraceIterator_next()
275 kbt->end = KBacktraceIterator_next_item_inclusive(kbt); in KBacktraceIterator_next()
276 if (old_pc == kbt->it.pc && old_sp == kbt->it.sp) { in KBacktraceIterator_next()
278 kbt->end = KBT_LOOP; in KBacktraceIterator_next()
283 static void describe_addr(struct KBacktraceIterator *kbt, in describe_addr() argument
300 adjust = !kbt->new_context; in describe_addr()
329 vma = find_vma(kbt->task->mm, address); in describe_addr()
377 void tile_show_stack(struct KBacktraceIterator *kbt, int headers) in tile_show_stack() argument
393 kbt->task->pid, kbt->task->tgid, kbt->task->comm, in tile_show_stack()
396 kbt->verbose = 1; in tile_show_stack()
398 for (; !KBacktraceIterator_end(kbt); KBacktraceIterator_next(kbt)) { in tile_show_stack()
400 unsigned long address = kbt->it.pc; in tile_show_stack()
403 if (address < PAGE_OFFSET && !have_mmap_sem && kbt->task->mm) in tile_show_stack()
405 down_read_trylock(&kbt->task->mm->mmap_sem); in tile_show_stack()
407 describe_addr(kbt, address, have_mmap_sem, in tile_show_stack()
411 i++, address, namebuf, (unsigned long)(kbt->it.sp)); in tile_show_stack()
419 if (kbt->end == KBT_LOOP) in tile_show_stack()
424 up_read(&kbt->task->mm->mmap_sem); in tile_show_stack()
433 struct KBacktraceIterator kbt; in dump_stack_regs() local
434 KBacktraceIterator_init(&kbt, NULL, regs); in dump_stack_regs()
435 tile_show_stack(&kbt, 1); in dump_stack_regs()
458 void _KBacktraceIterator_init_current(struct KBacktraceIterator *kbt, ulong pc, in _KBacktraceIterator_init_current() argument
462 KBacktraceIterator_init(kbt, NULL, in _KBacktraceIterator_init_current()
469 struct KBacktraceIterator kbt; in show_stack() local
471 KBacktraceIterator_init_current(&kbt); in show_stack()
473 KBacktraceIterator_init(&kbt, task, NULL); in show_stack()
474 tile_show_stack(&kbt, 0); in show_stack()
483 struct KBacktraceIterator kbt; in save_stack_trace_tsk() local
490 KBacktraceIterator_init_current(&kbt); in save_stack_trace_tsk()
492 KBacktraceIterator_init(&kbt, task, NULL); in save_stack_trace_tsk()
493 for (; !KBacktraceIterator_end(&kbt); KBacktraceIterator_next(&kbt)) { in save_stack_trace_tsk()
498 if (i >= trace->max_entries || kbt.it.pc < PAGE_OFFSET) in save_stack_trace_tsk()
500 trace->entries[i++] = kbt.it.pc; in save_stack_trace_tsk()