From a860eeb5befe892b95e27dbfcc74a02953a95b7a Mon Sep 17 00:00:00 2001 From: jilles Date: Sun, 17 Apr 2011 14:38:11 +0000 Subject: ktrace: Log the code for all signals (PSIG events). The code provides information on how the signal was generated. Formerly, the code was only logged for traps, much like only signal handlers for traps received a meaningful si_code before FreeBSD 7.0. In rare cases, no information is available and 0 is still logged. MFC after: 1 week --- sys/kern/kern_sig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 9c30dc2..d5b49da 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1262,7 +1262,7 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, mtx_lock(&ps->ps_mtx); action = ps->ps_sigact[_SIG_IDX(sig)]; mtx_unlock(&ps->ps_mtx); - ktrpsig(sig, action, &td->td_sigmask, 0); + ktrpsig(sig, action, &td->td_sigmask, ksi->ksi_code); } #endif if (sig == SIGKILL) @@ -2716,7 +2716,7 @@ postsig(sig) #ifdef KTRACE if (KTRPOINT(td, KTR_PSIG)) ktrpsig(sig, action, td->td_pflags & TDP_OLDMASK ? - &td->td_oldsigmask : &td->td_sigmask, 0); + &td->td_oldsigmask : &td->td_sigmask, ksi.ksi_code); #endif if (p->p_stops & S_SIG) { mtx_unlock(&ps->ps_mtx); -- cgit v1.1