Lines Matching refs:stack
134 struct intel_pt_stack stack; member
281 static void intel_pt_pop_blk(struct intel_pt_stack *stack) in intel_pt_pop_blk() argument
283 struct intel_pt_blk *blk = stack->blk; in intel_pt_pop_blk()
285 stack->blk = blk->prev; in intel_pt_pop_blk()
286 if (!stack->spare) in intel_pt_pop_blk()
287 stack->spare = blk; in intel_pt_pop_blk()
292 static uint64_t intel_pt_pop(struct intel_pt_stack *stack) in intel_pt_pop() argument
294 if (!stack->pos) { in intel_pt_pop()
295 if (!stack->blk) in intel_pt_pop()
297 intel_pt_pop_blk(stack); in intel_pt_pop()
298 if (!stack->blk) in intel_pt_pop()
300 stack->pos = INTEL_PT_BLK_SIZE; in intel_pt_pop()
302 return stack->blk->ip[--stack->pos]; in intel_pt_pop()
305 static int intel_pt_alloc_blk(struct intel_pt_stack *stack) in intel_pt_alloc_blk() argument
309 if (stack->spare) { in intel_pt_alloc_blk()
310 blk = stack->spare; in intel_pt_alloc_blk()
311 stack->spare = NULL; in intel_pt_alloc_blk()
318 blk->prev = stack->blk; in intel_pt_alloc_blk()
319 stack->blk = blk; in intel_pt_alloc_blk()
320 stack->pos = 0; in intel_pt_alloc_blk()
324 static int intel_pt_push(struct intel_pt_stack *stack, uint64_t ip) in intel_pt_push() argument
328 if (!stack->blk || stack->pos == INTEL_PT_BLK_SIZE) { in intel_pt_push()
329 err = intel_pt_alloc_blk(stack); in intel_pt_push()
334 stack->blk->ip[stack->pos++] = ip; in intel_pt_push()
338 static void intel_pt_clear_stack(struct intel_pt_stack *stack) in intel_pt_clear_stack() argument
340 while (stack->blk) in intel_pt_clear_stack()
341 intel_pt_pop_blk(stack); in intel_pt_clear_stack()
342 stack->pos = 0; in intel_pt_clear_stack()
345 static void intel_pt_free_stack(struct intel_pt_stack *stack) in intel_pt_free_stack() argument
347 intel_pt_clear_stack(stack); in intel_pt_free_stack()
348 zfree(&stack->blk); in intel_pt_free_stack()
349 zfree(&stack->spare); in intel_pt_free_stack()
354 intel_pt_free_stack(&decoder->stack); in intel_pt_decoder_free()
1026 err = intel_pt_push(&decoder->stack, decoder->ip + in intel_pt_walk_insn()
1032 decoder->ret_addr = intel_pt_pop(&decoder->stack); in intel_pt_walk_insn()
1978 intel_pt_clear_stack(&decoder->stack); in intel_pt_walk_trace()
2380 intel_pt_clear_stack(&decoder->stack); in intel_pt_walk_to_ip()
2542 intel_pt_clear_stack(&decoder->stack); in intel_pt_sync()