Hi all,
TLDR; I want to print out a complicated struct in a human readable way dtrace. I could manually add in the struct, but there are several nested structs and that gets messy and difficult to replicate very quickly. How does one do this?
Detailed: I am trying to display the print a structure that is returned by the kernel function usbd_get_endpoint. The background is because I am running usbd_transfer_setup but getting an error condition and do not understand why, so I want to instrument usbd_get_endpoint, which is called by usbd_transfer_setup.
I want to print out the struct usb_endpoint in a human readable format. It is located in sys/dev/usb/usbdi.h
Currently I have done this:
Here are my outputs:
Is including header files possible in dtrace? If so, how is this done?
TLDR; I want to print out a complicated struct in a human readable way dtrace. I could manually add in the struct, but there are several nested structs and that gets messy and difficult to replicate very quickly. How does one do this?
Detailed: I am trying to display the print a structure that is returned by the kernel function usbd_get_endpoint. The background is because I am running usbd_transfer_setup but getting an error condition and do not understand why, so I want to instrument usbd_get_endpoint, which is called by usbd_transfer_setup.
I want to print out the struct usb_endpoint in a human readable format. It is located in sys/dev/usb/usbdi.h
Currently I have done this:
Code:
#include <sys/dev/usb/usbdi.h>
fbt::usbd_get_endpoint:return
{
printf("Exit %d\n", arg0);
}
Here are my outputs:
Code:
[farhan@freebsddev ~]$ sudo dtrace -s usbd_get_endpoint.d
dtrace: failed to compile script usbd_get_endpoint.d: invalid control directive: #include
[farhan@freebsddev ~]$ sudo dtrace -C -s usbd_get_endpoint.d
dtrace: failed to compile script usbd_get_endpoint.d: line 1: invalid type combination