From: Kris Van Hees Date: Wed, 20 Jan 2016 07:48:08 +0000 (-0500) Subject: dtrace: ensure signal-handled is fired with correct signal X-Git-Tag: v4.1.12-92~204^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6eb5d1664232ea38f51d8ae706b784876b0a7089;p=users%2Fjedix%2Flinux-maple.git dtrace: ensure signal-handled is fired with correct signal When sending a signal to a process that neither ignores nor handles that signal, it is translated into a SIGKILL because the signal will effectively cause the process to be terminated. As a result, one would see a signal-send probe for the original signal, and a signal-handled probe for SIGKILL. Since in these cases the original signal is retained within the target task for exit reporting, it is possible to report the original signal number in the signal-handled probe. This commit accomplishes that to ensure that accurate pairing for signal probes is possible. Orabug: 22573604 Signed-off-by: Kris Van Hees Acked-by: Nick Alcock --- diff --git a/kernel/signal.c b/kernel/signal.c index 8b87c1ebe231..a263c1d87d2c 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2267,10 +2267,14 @@ relock: ka = &sighand->action[signr-1]; - DTRACE_PROC3(signal__handle, int, signr, siginfo_t *, - ksig->ka.sa.sa_handler != SIG_DFL ? NULL : - &ksig->info, void (*)(void), - ksig->ka.sa.sa_handler); + DTRACE_PROC3(signal__handle, + int, signal->group_exit_code + ? signal->group_exit_code + : signr, + siginfo_t *, ksig->ka.sa.sa_handler != SIG_DFL + ? NULL + : &ksig->info, + void (*)(void), ksig->ka.sa.sa_handler); /* Trace actually delivered signals. */ trace_signal_deliver(signr, &ksig->info, ka);