From 6eb5d1664232ea38f51d8ae706b784876b0a7089 Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Wed, 20 Jan 2016 02:48:08 -0500 Subject: [PATCH] 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 --- kernel/signal.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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); -- 2.50.1