#include #include "perf_regs.h" #include "thread.h" #include "map.h" #include "event.h" #include "debug.h" #include "tests/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_ARM_SP]; map = map_groups__find(thread->mg, MAP__VARIABLE, (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; } int test__arch_unwind_sample(struct perf_sample *sample, struct thread *thread) { struct regs_dump *regs = &sample->user_regs; u64 *buf; buf = calloc(1, sizeof(u64) * PERF_REGS_MAX); if (!buf) { pr_debug("failed to allocate sample uregs data\n"); return -1; } perf_regs_load(buf); regs->abi = PERF_SAMPLE_REGS_ABI; regs->regs = buf; regs->mask = PERF_REGS_MASK; return sample_ustack(sample, thread, buf); } orm> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/net/qrtr
/cgit.cgi/linux/net-next.git/commit/net/core/netevent.c?id=19ca2c8fecb1592d623fe5e82d6796f8d446268d'>netevent.c
diff options
ModeNameSize
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 12:21:51 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 12:21:51 -0800
commit19ca2c8fecb1592d623fe5e82d6796f8d446268d (patch)
tree0756e115d125846f46b302085307768f069434a1 /net/core/netevent.c
parenta4685d2f58e2230d4e27fb2ee581d7ea35e5d046 (diff)
parent880a38547ff08715ce4f1daf9a4bb30c87676e68 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull namespace fix from Eric Biederman: "This has a single brown bag fix. The possible deadlock with dec_pid_namespaces that I had thought was fixed earlier turned out only to have been moved. So instead of being cleaver this change takes ucounts_lock with irqs disabled. So dec_ucount can be used from any context without fear of deadlock. The items accounted for dec_ucount and inc_ucount are all comparatively heavy weight objects so I don't exepct this will have any measurable performance impact" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: userns: Make ucounts lock irq-safe
Diffstat (limited to 'net/core/netevent.c')