diff options
-rw-r--r-- | sys/kern/kern_ktrace.c | 3 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 89c3318a485f8..8728801acdf7d 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -347,6 +347,9 @@ ktr_enqueuerequest(struct thread *td, struct ktr_request *req) mtx_lock(&ktrace_mtx); STAILQ_INSERT_TAIL(&td->td_proc->p_ktr, req, ktr_list); mtx_unlock(&ktrace_mtx); + thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + thread_unlock(td); } /* diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 3c7e54e3b195a..0c7e43c40ea26 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -130,9 +130,6 @@ userret(struct thread *td, struct trapframe *frame) PROC_UNLOCK(p); } #endif -#ifdef KTRACE - KTRUSERRET(td); -#endif /* * Charge system time if profiling. @@ -341,6 +338,10 @@ ast(struct trapframe *framep) if (td->td_pflags & TDP_SIGFASTPENDING) sigfastblock_setpend(td, false); +#ifdef KTRACE + KTRUSERRET(td); +#endif + /* * We need to check to see if we have to exit or wait due to a * single threading requirement or some other STOP condition. |