[dtrace-discuss] self-> in BEGIN probe
Robert Milkowski
rmilkowski at task.gda.pl
Thu Feb 15 16:28:25 PST 2007
Hello Menno,
Wednesday, February 14, 2007, 11:30:16 AM, you wrote:
ML> ----- Original Message -----
ML> From: Robert Milkowski <rmilkowski at task.gda.pl>
ML> Date: Wednesday, February 14, 2007 11:02 am
ML> Subject: [dtrace-discuss] self-> in BEGIN probe
ML> To: dtrace-discuss at opensolaris.org
>> Hello dtrace-discuss,
>>
>>
>> With a bug id
>>
>> 6495013 Loops and recursion in metaslab_ff_alloc can kill
>> performance, even on a pool with lots of free data
>>
>> There's associated D script below.
>>
>> What's the point setting self->in_metaslab in a BEGIN probe?
>> I'm not talking about setting it to 0 as this is not necessary but
>> rather about self-> variables in BEGIN probe. I guess it has no
>> rather about self-> predictable meaning, right?
>>
ML> I think it is used as a forward declaration. The predicate on the
ML> first clause would cause the script not to run since
ML> slef->in_metaslab would be undefined at that point. The proper way
ML> to do the forward declaration would be something like:
Actually it will work without declaration on BEGIN only you are
checking for zero (or non zero).
ML> #!/usr/sbin/dtrace -s
ML> #pragma D option quiet
ML> self int in_metaslab;
That's interesting - I didn't know one can do it for self-> variables
in that way.
--
Best regards,
Robert mailto:rmilkowski at task.gda.pl
http://milek.blogspot.com
More information about the dtrace-discuss
mailing list