Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Feb 2022 11:42:00 -0500
From:      Ryan Stone <rysto32@gmail.com>
To:        Farhan Khan <farhan@farhan.codes>
Cc:        freebsd-dtrace@freebsd.org
Subject:   Re: Read return struct of kernel trace
Message-ID:  <CAFMmRNwQ0=cvBP7c_6HYSBoYRi7eiKmV31i9TBCXOL7O4np0Mg@mail.gmail.com>
In-Reply-To: <601aef51-3402-43fe-b44c-8c2976a4f777@www.fastmail.com>
References:  <601aef51-3402-43fe-b44c-8c2976a4f777@www.fastmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
It should be dtrace -Cs usbd_get_endpoint.d

However you probably don't need the #include at all, even if you need
access to usb types in your full script.  The type information will be
embedded in the kernel and automatically fetched by dtrace.

On Sun, Feb 20, 2022 at 1:22 AM Farhan Khan <farhan@farhan.codes> wrote:
>
> Hi all,
>
> I am trying to instrument the return value of usbd_get_endpoint(), which =
is a "struct usb_endpoint" defined in /usr/src/sys/dev/usb/usbdi.h. I would=
 like to print out the contents of the struct in a human-readable way. To t=
hat end, I am trying to include the header file into my dtrace script but k=
eep getting error messages from dtrace.
> My script is as follows:
> ------------
> #!/usr/sbin/dtrace -qvs
>
> #include <dev/usb/usbdi.h>
>
> fbt::usbd_get_endpoint:return
> {
> printf("Exit %d\n", arg0);
> }
> ------------
> [farhan@freebsddev ~]$ sudo dtrace -C ./usbd_get_endpoint.d
> dtrace: no probes specified
> [farhan@freebsddev ~]$ sudo dtrace -sC ./usbd_get_endpoint.d
> dtrace: failed to open C: No such file or directory
> [farhan@freebsddev ~]$ sudo dtrace ./usbd_get_endpoint.d
> dtrace: no probes specified
>
> I am not certain how to resolve this issue. Also, if it is not necessary =
to include the header to print out the structure, please suggest an alterna=
tive method.
> Thank you!
> --
> Farhan Khan
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNwQ0=cvBP7c_6HYSBoYRi7eiKmV31i9TBCXOL7O4np0Mg>