[PATCH] fix signals instrumentation

Pierre-Marc Fournier <[email protected]> Thu, 1 Nov 2007 18:20:31 -0400
Newsgroups gmane.linux.kernel.tracing
Message-ID <1193955632-13079-2-git-send-email-pierre-marc.fournier@polymtl.ca>
The kernel_send_signal marker could not catch all the signals that were sent
to processes due to its location, in specific_send_sig_info(), which is not
visited by all signal dispaching paths. Most notably, signals arriving through
sys_kill() could not be traced. Moving the marker in send_signal() ensures
that all signals are recorded.

Also rename the marker to kernel_send_signal to match the function name.

Signed-off-by: Pierre-Marc Fournier <[email protected]>
---
 kernel/signal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 6130be7..f700cb6 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -664,6 +664,8 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
 	struct sigqueue * q = NULL;
 	int ret = 0;
 
+	trace_mark(kernel_send_signal, "pid %d signal %d", t->pid, sig);
+
 	/*
 	 * Deliver the signal to listening signalfds. This must be called
 	 * with the sighand lock held.
@@ -770,8 +772,6 @@ specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
 	if (sig_ignored(t, sig))
 		goto out;
 
-	trace_mark(kernel_process_signal, "pid %d signal %d", t->pid, sig);
-
 	/* Support queueing exactly one non-rt signal, so that we
 	   can get more detailed information about the cause of
 	   the signal. */
-- 
1.5.3.4