Controlling probe overhead

David Smith dsmith@redhat.com
Wed Mar 7 19:01:00 GMT 2007


Josh,

I took your patch and updated it a small bit.  Sorry for not respondingn 
sooner.  See comments at the end.

Stone, Joshua I wrote:
> Here's a simple patch to put a upper-bound on how much system time is
> consumed by SystemTap.  It keeps a cumulative sum of time spent in
> probes on each cpu, and if that exceeds the threshold within an
> interval, the session is aborted.
> 
> Advantages:
> * Accounting is maintained per-cpu.
> * The frequency of get_cycles() is irrelevant to calculations, even if
> it changes.
> * The code is very simple. :)
> 
> Disadvantages:
> * Doesn't account for overhead in firing the probe (e.g., the cost of a
> debug trap).
> * Doesn't detect excessive overhead from multiple scripts (e.g., ten
> scripts that individually run under the threshold could together bear
> down the system).
> 
> TODO:
> * Share some code with STP_TIMING (which also tracks probe duration).

The patch now shares code with STP_TIMING.

> * Make the threshold tunable (by gurus only?).
> * Account for other runtime overhead (transport, timer sync, etc.).
> * Make exceptions for some probes (begin, end)

Making exceptions for begin/end probe is going to be a bit difficult, 
since the common_probe_entryfn_prologue() and 
common_probe_entryfn_epilogue() functions don't really have any context 
of where they are called from.

> Comments and suggestions are welcome...

Besides sharing code with STP_TIMING, I also added a command-line switch 
to turn this new functionality off (but your idea of tunable thresholds 
is probably better).

I do have a question.  I'm afraid I don't quite understand the logic 
behind (and the differences between) STP_ACCOUNTING_THRESHOLD and 
STP_ACCOUNTING_INTERVAL.  Why isn't STP_ACCOUNTING_THRESHOLD enough? 
Could you explain that a bit?

Thanks.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stp_throttle.patch
Type: text/x-patch
Size: 5491 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20070307/5de165c8/attachment.bin>


More information about the Systemtap mailing list