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
This commit is contained in:
Edward Tomasz Napierala 2020-10-03 12:03:08 +00:00
parent fedeb08b6a
commit 4658877815
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366391
2 changed files with 7 additions and 3 deletions

View File

@ -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);
}
/*

View File

@ -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.