// SPDX-License-Identifier: GPL-2.0 #include <string.h> #include "perf_regs.h" #include "thread.h" #include "map.h" #include "event.h" #include "debug.h" #include "tests/tests.h" #include "arch-tests.h" #define STACK_SIZE 8192
static int sample_ustack(struct perf_sample *sample, struct thread *thread, u64 *regs) { struct stack_dump *stack = &sample->user_stack; struct map *map; unsigned long sp; u64 stack_size, *buf; buf = malloc(STACK_SIZE); if (!buf) { pr_debug("failed to allocate sample uregs data\n"); return -1; } sp = (unsigned long) regs[PERF_REG_X86_SP]; map = map_groups__find(thread->mg, (u64)sp); if (!map) { pr_debug("failed to get stack map\n"); free(buf); return -1; } 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; return 0; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jiri Olsa | 158 | 96.34% | 1 | 33.33% |
Masanari Iida | 5 | 3.05% | 1 | 33.33% |
Arnaldo Carvalho de Melo | 1 | 0.61% | 1 | 33.33% |
Total | 164 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Jiri Olsa | 90 | 100.00% | 2 | 100.00% |
Total | 90 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Jiri Olsa | 273 | 96.47% | 3 | 42.86% |
Masanari Iida | 5 | 1.77% | 1 | 14.29% |
Matt Fleming | 3 | 1.06% | 1 | 14.29% |
Arnaldo Carvalho de Melo | 1 | 0.35% | 1 | 14.29% |
Greg Kroah-Hartman | 1 | 0.35% | 1 | 14.29% |
Total | 283 | 100.00% | 7 | 100.00% |