svn commit: r366391 - head/sys/kern
Edward Tomasz Napierala
trasz at FreeBSD.org
Sat Oct 3 12:03:09 UTC 2020
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
More information about the svn-src-all
mailing list