Fernando Gleiser
2008-Apr-23 02:49 UTC
[dtrace-discuss] Help with some custom kernel sdt probes
I''m playing with FreeBSD''s port of DTrace we''re adding some sdt probes to some kernel modules so we can time some events The probes load fine and they show up in dtrace -l, but I can''t manage to access their arguments here''s some snip of code static void em_intr(void *arg) { struct adapter *adapter = arg; struct ifnet *ifp = adapter->ifp; uint32_t reg_icr; SDT_INTR_PROBE(em, interrupt_start, adapter->dev, &em_intr, ifp, adapter , 0); If I want to access some of the struct ifnet''s fields, like this: sdt:::interrupt_end { this->ifnet=(struct ifnet *)arg2; @[this->ifnet->if_xname]=quantize(timestamp-self->ts); } I get the following error: dtrace: failed to compile script sdt-test2.d: line 13: operator -> cannot be applied to a forward declaration: no struct ifnet definition is available is there anything I''m missing to make the struct definition visible to a D script? any help/suggestions would be greatly apreciated Fer ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
John Birrell
2008-Apr-24 00:46 UTC
[dtrace-discuss] Help with some custom kernel sdt probes
How recent is the FreeBSD source tree you are using? You can try using cftdump on the kernel module and look for ifnet (to check that there is CTF data for the structure). Also note that the SDT implementation in FreeBSD differs from that in OpenSolaris. On FreeBSD you can define your argument types where the probes are declared. If you have a recent source tree, look at the SDT probes in (say) src/sys/kern/kern_proc.c -- This message posted from opensolaris.org