Lines Matching +full:- +full:- +full:depth
1 // SPDX-License-Identifier: BSD-2-Clause
51 s = TAILQ_FIRST(&tsd->sess_stack); in get_fbuf()
53 if (!s || tsd->ctx != s->ctx) in get_fbuf()
56 if (!is_ta_ctx(s->ctx) || to_ta_ctx(s->ctx)->panicked) in get_fbuf()
59 if (s->fbuf && s->fbuf->syscall_trace_enabled && in get_fbuf()
60 !s->fbuf->syscall_trace_suspended) in get_fbuf()
61 return s->fbuf; in get_fbuf()
73 size_t idx = fbuf->curr_idx; in add_elem()
78 elem = (uint64_t *)((vaddr_t)fbuf + fbuf->buf_off) + idx; in add_elem()
82 if ((idx + 1) * sizeof(*elem) > fbuf->max_size) { in add_elem()
84 fbuf->overflow = true; in add_elem()
87 fbuf->curr_idx = idx; in add_elem()
95 if (!fbuf || !fbuf->buf_off || !fbuf->max_size) in ftrace_enter()
98 add_elem(fbuf, fbuf->ret_idx + 1, pc); in ftrace_enter()
100 if (fbuf->ret_idx < FTRACE_RETFUNC_DEPTH) { in ftrace_enter()
101 fbuf->ret_stack[fbuf->ret_idx] = *lr; in ftrace_enter()
102 fbuf->begin_time[fbuf->ret_idx] = now; in ftrace_enter()
103 fbuf->ret_idx++; in ftrace_enter()
106 * This scenario isn't expected as function call depth in ftrace_enter()
127 if (!fbuf || !fbuf->ret_idx || fbuf->ret_idx > FTRACE_RETFUNC_DEPTH) in ftrace_return()
130 fbuf->ret_idx--; in ftrace_return()
131 start = fbuf->begin_time[fbuf->ret_idx]; in ftrace_return()
132 elapsed = (now - start) * 1000000000 / read_cntfrq(); in ftrace_return()
135 return fbuf->ret_stack[fbuf->ret_idx]; in ftrace_return()