Lines Matching refs:stack
111 struct intel_pt_stack stack; member
241 static void intel_pt_pop_blk(struct intel_pt_stack *stack) in intel_pt_pop_blk() argument
243 struct intel_pt_blk *blk = stack->blk; in intel_pt_pop_blk()
245 stack->blk = blk->prev; in intel_pt_pop_blk()
246 if (!stack->spare) in intel_pt_pop_blk()
247 stack->spare = blk; in intel_pt_pop_blk()
252 static uint64_t intel_pt_pop(struct intel_pt_stack *stack) in intel_pt_pop() argument
254 if (!stack->pos) { in intel_pt_pop()
255 if (!stack->blk) in intel_pt_pop()
257 intel_pt_pop_blk(stack); in intel_pt_pop()
258 if (!stack->blk) in intel_pt_pop()
260 stack->pos = INTEL_PT_BLK_SIZE; in intel_pt_pop()
262 return stack->blk->ip[--stack->pos]; in intel_pt_pop()
265 static int intel_pt_alloc_blk(struct intel_pt_stack *stack) in intel_pt_alloc_blk() argument
269 if (stack->spare) { in intel_pt_alloc_blk()
270 blk = stack->spare; in intel_pt_alloc_blk()
271 stack->spare = NULL; in intel_pt_alloc_blk()
278 blk->prev = stack->blk; in intel_pt_alloc_blk()
279 stack->blk = blk; in intel_pt_alloc_blk()
280 stack->pos = 0; in intel_pt_alloc_blk()
284 static int intel_pt_push(struct intel_pt_stack *stack, uint64_t ip) in intel_pt_push() argument
288 if (!stack->blk || stack->pos == INTEL_PT_BLK_SIZE) { in intel_pt_push()
289 err = intel_pt_alloc_blk(stack); in intel_pt_push()
294 stack->blk->ip[stack->pos++] = ip; in intel_pt_push()
298 static void intel_pt_clear_stack(struct intel_pt_stack *stack) in intel_pt_clear_stack() argument
300 while (stack->blk) in intel_pt_clear_stack()
301 intel_pt_pop_blk(stack); in intel_pt_clear_stack()
302 stack->pos = 0; in intel_pt_clear_stack()
305 static void intel_pt_free_stack(struct intel_pt_stack *stack) in intel_pt_free_stack() argument
307 intel_pt_clear_stack(stack); in intel_pt_free_stack()
308 zfree(&stack->blk); in intel_pt_free_stack()
309 zfree(&stack->spare); in intel_pt_free_stack()
314 intel_pt_free_stack(&decoder->stack); in intel_pt_decoder_free()
902 err = intel_pt_push(&decoder->stack, decoder->ip + in intel_pt_walk_insn()
908 decoder->ret_addr = intel_pt_pop(&decoder->stack); in intel_pt_walk_insn()
1582 intel_pt_clear_stack(&decoder->stack); in intel_pt_walk_trace()
1971 intel_pt_clear_stack(&decoder->stack); in intel_pt_sync()