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>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_317472FC-497C-4AD6-A0DF-F3CF9340D676 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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> --------------- =E2=80=94 Domagoj > On 5 Aug 2018, at 06:43, Farhan Khan <khanzf@gmail.com> wrote: >=20 > Hi all, >=20 > 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. >=20 > Brendan Gregg's book has examples of using #include, but when I do = this: >=20 > --------------- > #!/usr/sbin/dtrace -s >=20 > #include <net80211/ieee80211_var.h> > #include <net80211/ieee80211_regdomain.h> > #include <net80211/ieee80211_radiotap.h> > #include <net80211/ieee80211_ratectl.h> > --------------- >=20 > I get this error: >=20 > --------------- > $ sudo ./newstate.d > dtrace: failed to compile script ./newstate.d: line 3: invalid control > directive: #include > --------------- >=20 > Is there a way to include header files and get their subsequent = structs? >=20 > Thanks, >=20 > -- > 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" --Apple-Mail=_317472FC-497C-4AD6-A0DF-F3CF9340D676 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----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----- --Apple-Mail=_317472FC-497C-4AD6-A0DF-F3CF9340D676--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?893AB692-BC26-44B4-8DC8-D62B2F907F02>