/* * Subject to the GPL, version 2. */ #include "xmalloc.h" struct panic_handler { void *arg; pid_t pid; bool is_enabled; void (*on_panic)(void *arg); struct panic_handler *next; }; static struct panic_handler *panic_handlers; void panic_handler_add(void (*on_panic)(void *arg), void *arg) { struct panic_handler *handler = xmallocz(sizeof(*handler)); handler->arg = arg; handler->pid = getpid(); handler->is_enabled = true; handler->on_panic = on_panic; handler->next = panic_handlers; panic_handlers = handler; }; void call_panic_handlers(void) { struct panic_handler *it; pid_t pid = getpid(); for (it = panic_handlers; it; it = it->next) { if (it->pid == pid && it->is_enabled) { it->is_enabled = false; it->on_panic(it->arg); } } } ='main'>index : net-next.git
net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2016-11-27 00:13:33 +0100
committerThomas Gleixner <tglx@linutronix.de>2016-12-02 00:52:34 +0100
commit14660b7ea3ca628410bb999d53926ca77973892b (patch)
treeb90ee3b6578ef63ce61a0283ec3d607f71cff028 /Documentation
parent9c6bafab03dec222237b6eb8b5adf5c18ec76264 (diff)
oprofile/nmi timer: Convert to hotplug state machine
Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: oprofile-list@lists.sf.net Cc: Robert Richter <rric@kernel.org> Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20161126231350.10321-6-bigeasy@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'Documentation')