On 11-Jul-01 Seigo Tanimura wrote:
> On Mon, 9 Jul 2001 03:20:44 -0500,
>   Alfred Perlstein <[EMAIL PROTECTED]> said:
> Alfred> I'm also quite sure that you can't call the ktrace functions with
> Alfred> any mutexes held so the code is doing to need some help, basically
> Alfred> the trick in trapsig() and postsig() is to generate the ktrace
> Alfred> IO after the locks have been dropped, this means somehow caching
> Alfred> the info sent to ktrace where it's currently called, and calling
> Alfred> it later with the cached info after the locks are dropped.
> We can cache ktrace information into struct proc and mark the
> existence of cache in p_traceflag. Then we send the information to
> ktrace upon returning from trapsignal() or CURSIG(), or in sigexit(). 

Jake is working on porting the BSD/OS ktrace code, which uses a ring buffer of
events that get handed off to a worker background thread that does the actual
I/O.  This way, ktrace won't sleep and you won't have these problems.  I
wouldn't expend lots of effort attempting to fix the current ktrace.

> Another problem I noticed is bogus unlock and lock around call of
> machine-and-maybe-executable-format-dependent sendsig(), found in
> sys/*/*/machdep.c. Instead of locking curproc in sendsig() once again,
> we should call sendsig() with curproc locked, and release the lock
> only in sendsig().

That is probably fine.


John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to