On Fri, Aug 28, 2009 at 3:30 PM, Joel Reymont<[email protected]> wrote:
> Suppose I have a USDT probe in Firefox and that I'm trying to catch the
> startup with a probe like this:
>
> proc:::exec-success
> /execname == "firefox-bin"/
> {
> start = timestamp;
> }
>
> and stop tracing when Firefox hits this USDT probe:
>
> mozilla:::main-entry
> {
> exit(0);
> }
>
> How do I put the running firefox-bin into "trace mode" so that my USDT probe
> fires?
>
You can do this with two separate DTrace invocations. The first
catches the exec of firefox-bin and fires off the second. Something
like this for the first one:
proc:::exec-success
/ execname == "firefox-bin" /
{
stop();
system("/tmp/trace-firefox.d -p %d", pid);
}
This will stop firefox-bin just after the exec. (Note that it needs
the destructive option, -w or "#pragma D option destructive".)
/tmp/trace-firefox.d does the tracing you want using the USDT probes
in firefox-bin.
Chad
_______________________________________________
dtrace-discuss mailing list
[email protected]