From owner-freebsd-dtrace@freebsd.org Sun Aug 5 19:08:45 2018 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06602105ABD1 for ; Sun, 5 Aug 2018 19:08:45 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA26D729B4 for ; Sun, 5 Aug 2018 19:08:43 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-it0-x22b.google.com with SMTP id h23-v6so15224625ita.5 for ; Sun, 05 Aug 2018 12:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=DWpqNA+OkRxxMk0l5H+OasrwwP6AOGudk+MQ1++rBhA=; b=IVjZz+JKWefhtEoMPk29YQJbm1zNE2xJWtXr6JVB8e/1P/kqwpPS9c+Cs7ZvdT/GWk aG9wPbNQHtSVZjqh/eRNIwPKg1Q9f+QGe9MEA6CqWrD1vl/s7F4t6qZkKqS97fEsnsiW BDp6SXQnFkyubAlemvKuYoY6tEF9iB8Tf9/VdJ1DfE3Wjf+0NtxS8Y7C5MSgX1ncVIY6 adN4thq4HwL72m3XzwO98oDJ64ARX6ie2WiwH/YN1dk/+ivLtPn/a6RYiGvkJnir6vtR izOWHbvaA4CfRzEi6LAccvr7KT3tWfwpUJ4D3K3WGi8T8AV+8FkoSb82ahs9FMTsjpQx U1yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=DWpqNA+OkRxxMk0l5H+OasrwwP6AOGudk+MQ1++rBhA=; b=OaFtsnZo0gy37VHynMQTvpIdKwnJ36tMikhXRKR8y/3ziJU5/hvEBV7KrlWYtdvIfR iY2qrQtyg5JPXcw4h2YhQT6wLXVeLy4DdF1OIbdx8BMkSyve/GMAwvJ7NMhgVfYyFpax sUK202+4P8g6luU0sfsSa5zbXM0fEp0JHBfqM0L1WCp/jK4lAODRFfDLW0DLoh8ORAqi reYCWCixe9MJsOT6wWBantZ88GTcJVZbTGrP9QR2vLv1JHWZBPucQ/reODuqqU57Rkwh qdmMPfXN8q3+w0tpMQGwd8QxgGG2CK4Ay9HvWYzpiGEz7vIWRWw3YUTdEpli4UgsdLWc AbsQ== X-Gm-Message-State: AOUpUlFzrQNxi7raQxmjJaWf/6ISieDW69SvobN9s1XizwrkRT7OANlw FIZrRvvrlpZ+ERH5s2pdBRKvaiFrtxmy6PWlQPw= X-Google-Smtp-Source: AAOMgpeujpvfvQ1SA1NFH9/Z1bTgto5dEjSysARLagocIsqpgX5VBXkFf8bymFR7x8f/4M0EGhTVMZxDPJJ+fJ9RC9I= X-Received: by 2002:a24:e51a:: with SMTP id g26-v6mr12812688iti.43.1533496122307; Sun, 05 Aug 2018 12:08:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:8101:0:0:0:0:0 with HTTP; Sun, 5 Aug 2018 12:08:21 -0700 (PDT) In-Reply-To: <893AB692-BC26-44B4-8DC8-D62B2F907F02@gmail.com> References: <893AB692-BC26-44B4-8DC8-D62B2F907F02@gmail.com> From: Farhan Khan Date: Sun, 5 Aug 2018 15:08:21 -0400 Message-ID: Subject: Re: Include header files in dtrace scripts To: Domagoj Stolfa Cc: freebsd-dtrace@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 19:08:45 -0000 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 w= rote: > Hi Farhan: > > You should call DTrace with -C, which is the C preprocessor: > > --------------- > #!/usr/sbin/dtrace -Cs > > #include > #include > #include > #include > --------------- > > =E2=80=94 > Domagoj > >> On 5 Aug 2018, at 06:43, Farhan Khan 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 >> #include >> #include >> #include >> --------------- >> >> 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= " >