Include header files in dtrace scripts

Farhan Khan khanzf at gmail.com
Sun Aug 5 04:44:08 UTC 2018


Hi all,

I am trying to run dtrace on some net80211 functions in the kernel.
Rather than recreate my own version of several fairly large structs,
which would be a lot of work, I would like to just include
net80211/ieee80211_var.h and related headers.

Brendan Gregg's book has examples of using #include, but when I do this:

---------------
#!/usr/sbin/dtrace -s

#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211_regdomain.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_ratectl.h>
---------------

I get this error:

---------------
$ sudo ./newstate.d
dtrace: failed to compile script ./newstate.d: line 3: invalid control
directive: #include
---------------

Is there a way to include header files and get their subsequent structs?

Thanks,

--
Farhan Khan
PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE


More information about the freebsd-dtrace mailing list