Hi,
I am trying to print the vnode_t and vattr_t structure via system()
action. The idea is to use "mdb" to print vnode_t and vattr_t structures
instead of using printf/printa formatters. I have written a script to
trace ufs_setattr call. I have pasted the script below.
<---ufs_attr.d--->
#!/usr/sbin/dtrace -ws
fbt:ufs:ufs_setattr:entry
{
vp = (struct vnode *)arg0;
vap = (struct vattr *)arg1;
system("echo %-#p::print -t \"vnode_t\"|mdb -k",arg0);
system("echo %-#p::print -t \"vattr_t\"|mdb -k",arg1);
printf("vap->va_mask is %-#x", vap->va_mask);
}
<---ufs_attr.d--->
./ufs_attr.d -c "/usr/bin/touch /test"
The print -t "vattr_t" output is
{
uint_t va_mask = 0xd77aae70
vtype_t va_type = 0 (VNON)
...
...
}
Whereas the printf "vap->va_mask is %-#x" output is
vap->va_mask is 0x300
Why is the mdb -k output for "vattr_t" incorrect, whereas for vnode_t it
is correct. Any idea or suggestions.
-TIA
Hemachandran
_______________________________________________
dtrace-discuss mailing list
[email protected]