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

next in thread | previous in thread | raw e-mail | index | archive | help
Thank you very much!
In my test code I didn't even include the header files and it knew how
to include struct ieee80211_channel.
--
Farhan Khan
PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE


On Sun, Aug 5, 2018 at 8:07 AM, Domagoj Stolfa <domagoj.stolfa@gmail.com> w=
rote:
> 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:
>>
>> 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=
"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFd4kYCgPbXt_Mk4V8maj1P_m3tkmwuEoHR00OD7KpdSjyR%2BUw>