This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Dynamically enabling/disabling probe points from within stap script
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: James Y Knight <foom at fuhm dot net>
- Cc: systemtap at sourceware dot org
- Date: Fri, 20 Nov 2009 17:46:38 -0500
- Subject: Re: Dynamically enabling/disabling probe points from within stap script
- References: <99F43110-6332-47AB-A399-21BCCFA48664@fuhm.net>
James Y Knight <foom@fuhm.net> writes:
> Is there any plan to allow the ability to dynamically and
> efficiently enable and disable probes from within the systemtap
> script?
Yup.
> I know you can do:
> probe process(...).mark("foo") if (whatever) {}
> but that isn't efficient [...]
That's right. We have had a rough design for this, but kind of forgot
to finish the job. Your note and PR10995 should bring attention back
to the problem. (One drawback of actually disarming/rearming probes
is that because of the unavoidable latency between intended rearming
and actual rearming, the script may experience unknown missed probes.)
> Also nice would be a way to (efficiently!) say "run this probe every
> N times the location is hit".
Since this would require counting each location hit, and thus the
activation of the corresponding low-level probe, this would be
equivalent to adding something like this into the probe handler
if (count++ % 100) next;
- FChE