]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: ensure signal-handled is fired with correct signal
authorKris Van Hees <kris.van.hees@oracle.com>
Wed, 20 Jan 2016 07:48:08 +0000 (02:48 -0500)
committerKris Van Hees <kris.van.hees@oracle.com>
Sat, 30 Jan 2016 09:55:05 +0000 (04:55 -0500)
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 <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
kernel/signal.c

index 8b87c1ebe231613e0e4574fca30dd4030eea813b..a263c1d87d2ca5b0a3a01c815cc3409d0f7590c6 100644 (file)
@@ -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);