| static int sample_ustack(struct perf_sample *sample, |
| struct thread *thread, u64 *regs) |
| struct stack_dump *stack = &sample->user_stack; |
| buf = malloc(STACK_SIZE); |
| pr_debug("failed to allocate sample uregs data\n"); |
| sp = (unsigned long) regs[PERF_REG_ARM_SP]; |
| map = map_groups__find(thread->mg, MAP__VARIABLE, (u64) sp); |
| pr_debug("failed to get stack map\n"); |
| stack_size = map->end - sp; |
| stack_size = stack_size > STACK_SIZE ? STACK_SIZE : stack_size; |
| memcpy(buf, (void *) sp, stack_size); |
| stack->data = (char *) buf; |
| stack->size = stack_size; |
| int test__arch_unwind_sample(struct perf_sample *sample, |
| struct regs_dump *regs = &sample->user_regs; |
| buf = calloc(1, sizeof(u64) * PERF_REGS_MAX); |
| pr_debug("failed to allocate sample uregs data\n"); |
| regs->abi = PERF_SAMPLE_REGS_ABI; |
| regs->mask = PERF_REGS_MASK; |
| return sample_ustack(sample, thread, buf); |