Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Aug 2018 14:07:14 +0200
From:      Domagoj Stolfa <domagoj.stolfa@gmail.com>
To:        Farhan Khan <khanzf@gmail.com>
Cc:        freebsd-dtrace@freebsd.org
Subject:   Re: Include header files in dtrace scripts
Message-ID:  <893AB692-BC26-44B4-8DC8-D62B2F907F02@gmail.com>
In-Reply-To: <CAFd4kYAMOGLfgLTpj1HagKZzdRnm-jVf=NdNmvGhuK1maWRZvg@mail.gmail.com>
References:  <CAFd4kYAMOGLfgLTpj1HagKZzdRnm-jVf=NdNmvGhuK1maWRZvg@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hi Farhan:

You should call DTrace with -C, which is the C preprocessor:

---------------
#!/usr/sbin/dtrace -Cs

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

—
Domagoj

> On 5 Aug 2018, at 06:43, Farhan Khan <khanzf@gmail.com> wrote:
> 
> 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
> _______________________________________________
> freebsd-dtrace@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
> To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org"


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE37fRcHC0Iwiz+ZVEg+gksMBgNd0FAltm6HIACgkQg+gksMBg
Nd2fKA//XS6c9mXUx0KCbIdc31qYlXk/M+imFJiyIqdQx4zB0TEvyVd+tONUiHqk
rjRkDZqTfjaodZWrkVtyFzewi9jnrtDlbrgeSoNlyoY3ykXVJtTvY4mktmhhb8im
jNjqCnHdc/pZpE96gkqsVwG1wnDyCehYzkDIYsDHcZs+b+lvkg2M3RTCsTP5AsHW
UtPr1ePsrWIMH84GMVnHGhk34kwhPD2sgz6B+eYMN+ajSlNqMewm6xnVqg38Iuvz
jM8cTAl6sui3otu7CTqpUIKuZVaopnAR+vU+jzn6C3O6oCGvYtthrY6OzgdAmcIO
FNPF7SomYvnoR7E+h60WVcIjiO4PiarQRnQUgPveAKEt17d+oBvK/MpZ0C39xzwv
9aCZfopG8iBTslgIUZd4kxfjHx5j+D6ojauZJAx9VqahnDHcfpXGkcc/cbYA8DKB
tDfAseVLTQz3ltXiuBB7Wyj4PvrkLz1c5oLsMJkNfFs/I7XTagCSUByf8tAjLIbS
AFwhErH//C08vYsUaGrZzgdD4Xydm0AX70tCvD6xRkRi3NfudKN06cAuGlXCjUJp
fUVapCaXEOw2jSE2bb25Xmp+qcUAsXHH5Hh6FSaJc6Xicxg1b2dH+6Kzj3vZEqOF
ggDqXbekEoDyjY2DnqccbXv3D6A8l804Y7re+1nOHW73IeNxT9s=
=keMT
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?893AB692-BC26-44B4-8DC8-D62B2F907F02>