Date: Sat, 3 Oct 2020 12:03:09 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366391 - head/sys/kern Message-ID: <202010031203.093C39BW083088@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Sat Oct 3 12:03:08 2020 New Revision: 366391 URL: https://svnweb.freebsd.org/changeset/base/366391 Log: Move KTRUSERRET() from userret() to ast(). It's a really long detour - it writes ktrace entries to the filesystem - so the overhead of ast() won't make any difference. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26404 Modified: head/sys/kern/kern_ktrace.c head/sys/kern/subr_trap.c Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Sat Oct 3 10:47:17 2020 (r366390) +++ head/sys/kern/kern_ktrace.c Sat Oct 3 12:03:08 2020 (r366391) @@ -347,6 +347,9 @@ ktr_enqueuerequest(struct thread *td, struct ktr_reque 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); } /* Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sat Oct 3 10:47:17 2020 (r366390) +++ head/sys/kern/subr_trap.c Sat Oct 3 12:03:08 2020 (r366391) @@ -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. @@ -340,6 +337,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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010031203.093C39BW083088>