Controlling probe overhead
Stone, Joshua I
joshua.i.stone@intel.com
Thu Jan 25 22:30:00 GMT 2007
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).
* Make the threshold tunable (by gurus only?).
* Account for other runtime overhead (transport, timer sync, etc.).
* Make exceptions for some probes (begin, end)
Comments and suggestions are welcome...
Josh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stp_accounting.patch
Type: application/octet-stream
Size: 2490 bytes
Desc: stp_accounting.patch
URL: <http://sourceware.org/pipermail/systemtap/attachments/20070125/80f2b06f/attachment.obj>
More information about the Systemtap
mailing list