Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jul 2005 20:56:01 -0700
From:      Peter Wemm <peter@wemm.org>
To:        freebsd-arch@freebsd.org
Cc:        Peter Edwards <peadar@freebsd.org>, arch@freebsd.org, Robert Watson <rwatson@freebsd.org>
Subject:   Re: ktrace and KTR_DROP
Message-ID:  <200507112056.02249.peter@wemm.org>
In-Reply-To: <20050701155757.A36905@fledge.watson.org>
References:  <20050701132104.GA95135@freefall.freebsd.org> <20050701155757.A36905@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 01 July 2005 08:04 am, Robert Watson wrote:
> On Fri, 1 Jul 2005, Peter Edwards wrote:
> > Ever since the introduction of a separate ktrace worker thread for
> > writing output, there's the distinct possibility that ktrace output
> > will drop requests. For some proceses, it's actually inevitable: as
> > long as the traced processes can sustain a rate of generating
> > ktrace events faster than the ktrace thread can write them, you'll
> > eventually run out of ktrace requests.
[..]
> One of the things I've been thinking for a few years is that I think
> I actually preferred the old model better, there processes (now
> threads) would hang a "current record" off of their process (now
> thread) structure, and fill it in as they went along. 

I much prefer the old model as well.  I personally would like to have 
syscall returns delayed if the outstanding writes for ktrace requests 
is above a certain watermark.  There have been several suggestions for 
how to do this.

This could be as simple as throttling *all* ktrace writers as they 
return to userland from syscalls if the backlog is getting too large.  
But probably better would be to have each process responsible for its 
own writing and backlog management.  ie: queue up the records to memory 
just like now, and start unwinding them at a convenient location in 
syscall return.

-- 
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507112056.02249.peter>