#include #include #include "tests.h" #include "debug.h" #include "util.h" #include "perf-hooks.h" static void sigsegv_handler(int sig __maybe_unused) { pr_debug("SIGSEGV is observed as expected, try to recover.\n"); perf_hooks__recover(); signal(SIGSEGV, SIG_DFL); raise(SIGSEGV); exit(-1); } static void the_hook(void *_hook_flags) { int *hook_flags = _hook_flags; int *p = NULL; *hook_flags = 1234; /* Generate a segfault, test perf_hooks__recover */ *p = 0; } int test__perf_hooks(int subtest __maybe_unused) { int hook_flags = 0; signal(SIGSEGV, sigsegv_handler); perf_hooks__set_hook("test", the_hook, &hook_flags); perf_hooks__invoke_test(); /* hook is triggered? */ if (hook_flags != 1234) { pr_debug("Setting failed: %d (%p)\n", hook_flags, &hook_flags); return TEST_FAIL; } /* the buggy hook is removed? */ if (perf_hooks__get_hook("test")) return TEST_FAIL; return TEST_OK; } t type='hidden' name='id' value='c67b42f3a3f03e68bf915f32c8f7be0b726fec1a'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-02 13:20:23 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-02 13:20:23 -0800
commitc67b42f3a3f03e68bf915f32c8f7be0b726fec1a (patch)
tree9abf8c8a276cd5e8119e5c50f53afc220648008e /drivers/usb/dwc3/debugfs.c
parent027eb72cbcf81561867a764074964e2ce9828398 (diff)
parentc8f325a59cfc718d13a50fbc746ed9b415c25e92 (diff)
Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI fixes from Ingo Molnar: "Two EFI boot fixes, one for arm64 and one for x86 systems with certain firmware versions" * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi/fdt: Avoid FDT manipulation after ExitBootServices() x86/efi: Always map the first physical page into the EFI pagetables
Diffstat (limited to 'drivers/usb/dwc3/debugfs.c')