% cat lwp.dThis script can be easily modified to obtain the call stacks to any kind of function call, by replacing "lwp_*", with the actual function name. Also "execname" has to be replaced with the actual process name.
#!/usr/sbin/dtrace -s
#pragma D option quiet
BEGIN
{
start = timestamp;
}
syscall:::entry
/execname == "execname"/
{
@s[probefunc] = count();
}
syscall::lwp_*:entry
/execname == "execname"/
{
@c[curthread->t_tid] = count();
@st[ustack(60)] = count();
}
END
{
printf("Ran for %d seconds\n\n", (timestamp - start) / 1000000000);
trunc(@s,5);
printa(@s);
printf("\n%-10s %-10s\n", "LWP ID", "COUNT");
printa("%-10d %@d\n", @c);
printa(@st);
}
Technorati tags
Solaris | OpenSolaris | DTrace
No comments:
Post a Comment