[dtrace-discuss] self-> in BEGIN probe
Robert Milkowski
rmilkowski at task.gda.pl
Wed Feb 14 02:01:40 PST 2007
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?
#!/usr/sbin/dtrace -s
#pragma D option quiet
BEGIN
{
self->in_metaslab = 0;
}
fbt::metaslab_ff_alloc:entry
/self->in_metaslab == 0/
{
self->in_metaslab = 1;
self->loopcount = 0;
}
fbt::avl_walk:entry
/self->in_metaslab/
{
self->loopcount++;
}
fbt::metaslab_ff_alloc:return
/self->in_metaslab/
{
self->in_metaslab = 0;
@loops["Loops count"] = quantize(self->loopcount);
self->loopcount = 0;
}
--
Best regards,
Robert mailto:rmilkowski at task.gda.pl
http://milek.blogspot.com
More information about the dtrace-discuss
mailing list