This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: analysis of polling in systemtap
- From: Martin Hunt <hunt at redhat dot com>
- To: Mathieu Desnoyers <compudj at krystal dot dyndns dot org>
- Cc: "systemtap at sources dot redhat dot com" <systemtap at sources dot redhat dot com>
- Date: Mon, 19 Dec 2005 12:24:27 -0800
- Subject: Re: analysis of polling in systemtap
- Organization: Red Hat Inc
- References: <1134762840.3952.49.camel@monkey2> <20051216201846.GA1838@Krystal>
On Fri, 2005-12-16 at 15:18 -0500, Mathieu Desnoyers wrote:
> You could also keep two arrays for your data. Your poller would first atomically
> switch the pointer to the "empty" array before doing its sorting of the "full"
> array. Once the pointer is changed, just wait until every writer to the "full"
> array has finished (you might want to use a small lock for this, or RCU of your
> timer can wait (if it's a thread)) and then play freely with your data.
This is a good idea for maps. But there is a problem of how the
translator determines when it should be done. If the maps are not
cleared in the timer probes, we don't want this. And it only applies to
maps, not pmaps.
There is a tradeoff here. Additional accuracy during polling of maps vs
additional memory and complexity. It may not be worth it. Timer events
that print data then clear are probably only used in situations where
high accuracy isn't necessary.
Martin