Why does the typed argument (pointer to arc_buf_hdr_t) fail on the return probe?
I wrote the following probes for the buf_hash_insert method:
static arc_buf_hdr_t *
buf_hash_insert(arc_buf_hdr_t *buf, kmutex_t **lockp);
fbt:zfs:buf_hash_insert:entry
/args[0]->b_datacnt > 1/
{
printf("b_datacnt=%d", args[0]->b_datacnt);
}
fbt:zfs:buf_hash_insert:return
/args[0]->b_datacnt > 1/
{
}
The entry probe works as expected. However, the return probe’s qualifier
“args[0]->b_datacnt > 1” causes an “operator -> must be applied to a pointer”
error message. So, I changed the return probe’s qualifier to use a cast instead
of a typed argument as shown below:
fbt:zfs:buf_hash_insert:return
/((arc_buf_hdr_t*)arg0)->b_datacnt > 1/
{
}
The above probe loads without error, but I get an “invalid alignment (0x28a) in
predicate at DIF offset 24” error message when the probe is triggered. I’ve
read the thread “args[] typed to 'struct timeval' leads to invalid alignment
error” located at http://jp.opensolaris.org/jive/thread.jspa?messageID=47002 .
I understand that some small structures are passed as multiple arguments
instead of as a pointer. This is confusing. arc_buf_hdt_t is not really a small
structure, and what does this do to the position of the probe's subsequent
arguments? Why does the typed argument work as expected for the entry probe and
not the return probe?
If I want to match entry and return probes, I need to use the same qualifier on
both, but this seems to be impossible. Can anyone give me a suggestion on how
to make this work?
--
This message posted from opensolaris.org
_______________________________________________
dtrace-discuss mailing list
[email protected]