Hi,
I am learning dtrace and I find the "fbt:::entry" on sparc platform
behaves strange.
When I try to run the following script, the results on sparc platform
really confused me. The output on sparc is similar to:
1 => open /var/ld/ld.config
......
1 -> dnlc_lookup
1 -> bcmp
1 -> bcmp
1 -> bcmp
......
1 -> bcmp
1 -> bcmp
1 -> bcmp
1 <- bcmp
1 <- dnlc_lookup
......
1 <= open 2
>From the output, "fbt::bcmp:entry" probe is actived for several times,
but "fbt::bcmp:return" only 1 time. So the function entries and returns
are not balanced at all.
I also check the instructions of bcmp return and dnlc_lookup return.
They are not call insturctions both. So I think it's not a tail-call
optimization.
However, everything is ok on the x86 platform.
The script is:
#!/usr/sbin/dtrace -Fs
syscall::open:entry,
syscall::open64:entry
{
self->spec = speculation();
speculate(self->spec);
printf("%s", stringof(copyinstr(arg0)));
}
fbt:::
/self->spec/
{
speculate(self->spec);
}
syscall::open:return,
syscall::open64:return
/self->spec/
{
speculate(self->spec);
trace(errno);
}
syscall::open:return,
syscall::open64:return
/self->spec && errno != 0/
{
commit(self->spec);
self->spec = 0;
}
syscall::open:return,
syscall::open64:return
/self->spec && errno == 0/
{
discard(self->spec);
self->spec = 0;
}
_______________________________________________
dtrace-discuss mailing list
[email protected]