[Fwd: [dtrace-discuss] SDT probes used for error tracing]

James Dickens jamesd.wi at gmail.com
Mon Sep 11 15:33:16 PDT 2006


On 9/11/06, Jesse Butler <Jesse.Butler at sun.com> wrote:
> Rather than the  previous generic how-to question, I have an idea of something
> that might work.  Maybe someone could tell me if I'm on the right track?
>
> I'd like to replace the tracing facility in a debug module with SDT probes, so
> that the debug tracing can simply be enabled in place.  Specifically, I'd like
> to trace failures in functions, and also report when a bad argument is sent in.
>
> Can I simply do this by naming the probes according to the function and failure?
>
> So, something like this:
>
> function1()
> {
>         int ret;
>
>         if ((ret = initialize()) == FAILED) {
>                 drv_trace("function1: initialize failed");
>                 goto fail1;
>         }
>
>         if ((ret = configure()) == FAILED) {
>                 drv_trace("function1: configure failed");
>                 goto fail2;
>         }
>
>         etc...
>
> Could be something like this:
>
> function1()
> {
>         int ret;
>
>         if ((ret = initialize()) == FAILED) {
>                 DTRACE_PROBE(function1__initialize__failed);
>                 goto fail1;
>         }
>
>         if ((ret = configure()) == FAILED) {
>                 DTRACE_PROBE(function1__configure__failed);
>                 goto fail2;
>         }
>
while you could do as you propose, but I don't really see the point,
since if either of these events fail, you would most likely log the
event or possibly even exit with an error message. So you would be
probing events that are already known and most likely these aren't
common events anyway, there isn't much point.

DTrace probes are more effective when you probe common things,
successful completion of work that you some times want to monitor, at
least while testing or performance tuning.


James Dickens
uadmin.blogspot.com


>         etc...
>
> It seems I might end up with a *lot* of probes, but maybe that's OK?
>
> Thanks,
> Jesse
>
>
>
> -------- Original Message --------
> Subject: [dtrace-discuss] SDT probes used for error tracing
> Date: Fri, 08 Sep 2006 12:01:46 -0400
> From: Jesse Butler <Jesse.Butler at Sun.COM>
> Reply-To: Jesse.Butler at Sun.COM
> Organization: Sun Microsystems
> To: dtrace-discuss at opensolaris.org
>
> Is there a suggested way (or is it even possible) to pass a string to a
> DTRACE_PROBE function, like could be done with TNF_PROBE functions? I am
> interested in using Dtrace to dump error conditions whilst debugging.
>
> Thanks,
> Jesse
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org
>


More information about the dtrace-discuss mailing list