... and your test suite has a bug.
You have
>> ------------------------------------------------------------------------
>> #pragma D option quiet
>>
>> BEGIN
>> {
>>       brendan();
>>       exit(0);
>> }
>> ------------------------------------------------------------------------

Should be

#pragma D option quiet

BEGIN
{
        brendan();
}

That way it not ends until 4/1/09 when you can fix it with the
hanging_chad() action that sends a Ctrl-C to every hanging
brendan() action

-Angelo



On Apr 1, 2008, at 11:05 AM, Adam Leventhal wrote:

> Hey Chad,
>
> This looks good; just one nit. In dtrace.c, you have this:
>
> @@ -5772,6 +5772,9 @@
>                       }
>
>                       switch (act->dta_kind) {
> +                     case DTRACEACT_BRENDAN:
> +                             continue;
> +
>                       case DTRACEACT_STOP:
>                               if (dtrace_priv_proc_destructive(state))
>                                       dtrace_action_stop();
>
> I think you need something like this in there:
>
>       if (strcmp(curthread->t_procp->p_user.u_comm, "iTunes") == 0)
>               cpu_core[CPU->cpu_id].cpuc_dtrace_flags |= CPU_DTRACE_UPRIV;
>
> - ahl
>
>
> On Apr 1, 2008, at 4:37 AM, Chad Mynhier wrote:
>> This came up as an RFE during the conference (I believe it's been
>> logged
>> as "4012008: brendan() action needed for DTrace Toolkit".)
>>
>> As everyone here is aware, DTrace is not quite as user friendly as it
>> could be.  For the uninitiated, it can be confusing to run a DTrace
>> script and not see the expected output.  Brendan Gregg has addressed
>> this in the DTrace Toolkit[1] by including a BEGIN probe in each
>> script
>> to alert the uninitiated, i.e.:
>>
>> dtrace:::BEGIN
>> {
>>       printf("Tracing... Hit Ctrl-C to end.\n");
>> }
>>
>> Unfortunately, this can lead to much unnecessary typing, and it  
>> leaves
>> open the possibility of human error (e.g., "Tracing... Hit Ctrl-D to
>> end.\n")  To address these problems, I've implemented the brendan()
>> action.  The brendan() action addresses both problems in that it is
>> shorter to type and that it removes the possibility of errors.  (A
>> typo
>> in the name of the brendan() action, e.g., brandon(), would be
>> caught as
>> an error by the D compiler.)
>>
>> The DTrace test suite script for this, misc/tst.brendan.d,
>> demonstrates
>> the usage:
>>
>> ------------------------------------------------------------------------
>> #pragma D option quiet
>>
>> BEGIN
>> {
>>       brendan();
>>       exit(0);
>> }
>> ------------------------------------------------------------------------
>>
>> with the resulting output:
>>
>> ------------------------------------------------------------------------
>> Tracing... Hit Ctrl-C to end.
>>
>> ------------------------------------------------------------------------
>>
>>
>> I've put up a webrev for this at the following URL:
>>
>> http://cr.opensolaris.org/~cmynhier/brendan/
>>
>> [1]  http://www.brendangregg.com/dtrace.html
>> _______________________________________________
>> dtrace-discuss mailing list
>> dtrace-discuss@opensolaris.org
>
>
> --
> Adam Leventhal, Fishworks                        http://blogs.sun.com/ahl
>
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss@opensolaris.org

_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to