• Home
  • Raw
  • Download

Lines Matching full:stack

3  * thread-stack.c: Synthesize a thread's stack using call / return events
22 #include "thread-stack.h"
40 * struct thread_stack_entry - thread stack entry.
68 * struct thread_stack - thread stack constructed from 'call' and 'return'
70 * @stack: array that holds the stack
71 * @cnt: number of entries in the stack
72 * @sz: current maximum stack size
83 * @br_stack_rb: branch stack (ring buffer)
84 * @br_stack_sz: maximum branch stack size
89 struct thread_stack_entry *stack; member
111 * and therefore requires a stack for each cpu.
126 new_stack = realloc(ts->stack, sz); in thread_stack__grow()
130 ts->stack = new_stack; in thread_stack__grow()
201 if (!ts->stack && in thread_stack__new()
220 if (!ts->stack) in thread__cpu_stack()
246 pr_warning("Out of memory: discarding thread stack\n"); in thread_stack__push()
251 ts->stack[ts->cnt].trace_end = trace_end; in thread_stack__push()
252 ts->stack[ts->cnt++].ret_addr = ret_addr; in thread_stack__push()
266 * further down the stack. If the return address is not found at all, in thread_stack__pop()
268 * seen for some reason) and leave the stack alone. in thread_stack__pop()
271 if (ts->stack[--i].ret_addr == ret_addr) { in thread_stack__pop()
283 if (ts->stack[--i].trace_end) in thread_stack__pop_trace_end()
295 return ts->stack[ts->cnt - 1].cp->in_kernel; in thread_stack__in_kernel()
311 tse = &ts->stack[idx]; in thread_stack__call_return()
355 pr_err("Error flushing thread stack!\n"); in __thread_stack__flush()
418 pr_warning("Out of memory: no thread stack\n"); in thread_stack__event()
427 * the stack might be completely invalid. Better to report nothing than in thread_stack__event()
428 * to report something misleading, so flush the stack. in thread_stack__event()
441 * stack. in thread_stack__event()
459 * have flushed the stack) then try to make sense of the stack. in thread_stack__event()
490 zfree(&ts->stack); in __thread_stack__free()
545 ip = ts->stack[ts->cnt - j].ret_addr; in thread_stack__sample()
586 ip = ts->stack[ts->cnt - j].ret_addr; in thread_stack__sample_late()
596 ip = ts->stack[ts->cnt - j].ret_addr; in thread_stack__sample_late()
675 * have subsequent addresses removed from the branch stack.
797 tse = &ts->stack[ts->cnt++]; in thread_stack__push_cp()
823 struct thread_stack_entry *tse = &ts->stack[0]; in thread_stack__pop_cp()
830 if (ts->stack[ts->cnt - 1].ret_addr == ret_addr && in thread_stack__pop_cp()
831 !ts->stack[ts->cnt - 1].non_call) { in thread_stack__pop_cp()
838 if (ts->stack[i].ret_addr != ret_addr || in thread_stack__pop_cp()
839 ts->stack[i].non_call) in thread_stack__pop_cp()
925 /* If the stack is empty, push the userspace address */ in thread_stack__no_call_return()
939 parent = ts->stack[ts->cnt - 1].cp; in thread_stack__no_call_return()
945 * At the bottom of the stack, assume the missing 'call' was in thread_stack__no_call_return()
971 ts->stack[ts->cnt - 1].non_call = true; in thread_stack__no_call_return()
1007 tse = &ts->stack[ts->cnt - 1]; in thread_stack__trace_begin()
1025 /* No point having 'trace end' on the bottom of the stack */ in thread_stack__trace_end()
1026 if (!ts->cnt || (ts->cnt == 1 && ts->stack[0].ref == ref)) in thread_stack__trace_end()
1029 cp = call_path__findnew(cpr, ts->stack[ts->cnt - 1].cp, NULL, 0, in thread_stack__trace_end()
1054 struct thread_stack_entry *tse = &ts->stack[ts->cnt - 1]; in thread_stack__x86_retpoline()
1064 * not itself mean anything. Here the top-of-stack is removed, in thread_stack__x86_retpoline()
1065 * by decrementing the stack count, and then further down, the in thread_stack__x86_retpoline()
1066 * resulting top-of-stack is replaced with the actual target. in thread_stack__x86_retpoline()
1072 sym = ts->stack[ts->cnt - 2].cp->sym; in thread_stack__x86_retpoline()
1091 cp = call_path__findnew(cpr, ts->stack[ts->cnt - 2].cp, tsym, in thread_stack__x86_retpoline()
1096 /* Replace the top-of-stack with the actual target */ in thread_stack__x86_retpoline()
1097 ts->stack[ts->cnt - 1].cp = cp; in thread_stack__x86_retpoline()
1129 /* Flush stack on exec */ in thread_stack__process()
1137 /* If the stack is empty, put the current symbol on the stack */ in thread_stack__process()
1162 cp = call_path__findnew(cpr, ts->stack[ts->cnt - 1].cp, in thread_stack__process()
1185 /* Pop kernel stack */ in thread_stack__process()
1192 /* x86 retpoline 'return' doesn't match the stack */ in thread_stack__process()
1194 ts->stack[ts->cnt - 1].ret_addr != sample->addr) in thread_stack__process()
1217 * it a jmp. Make that visible by recording on the stack a in thread_stack__process()
1219 * when a ret pops the stack, all jmps must be popped off first. in thread_stack__process()
1221 cp = call_path__findnew(cpr, ts->stack[ts->cnt - 1].cp, in thread_stack__process()
1227 ts->stack[ts->cnt - 1].non_call = true; in thread_stack__process()