RFC: A trial io provider for DTrace...

George Neville-Neil gnn at freebsd.org
Thu May 31 16:23:27 UTC 2012


On May 28, 2012, at 13:03 , Fabian Keil wrote:

> Worked for me when applying with -p0.
> 
Great!

>> The arguments are not exactly the same as in Solaris, for instance I
>> don't yet support the fileinfo_t, but, you can get to the devstat and
>> bio structures via args[0] and args[1] respectively.
>> 
>> Here is an example of it working:
>> 
>> dtrace -n 'io:::start /args[0] != 0/{ trace(args[0]->bio_bcount)}'
>> 
>> Remember you need to be root to use DTrace.
> 
> Do you intent to eventually commit your patch to get dtrace working
> with sudo? I've been using it since you posted it last October and
> haven't seen any issues.
> http://lists.freebsd.org/pipermail/freebsd-current/2011-October/028120.html
> 

Sorry, what I meant was that you needed root privilege to run DTrace,
sudo will give you that.

> I got:
> 
> clang -c -O2 -pipe -fno-strict-aliasing  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual
>    /usr/src/sys/kern/subr_devstat.c:390:2: error: use of undeclared identifier 'bs'
>            DTRACE_DEVSTAT_BIO_DONE();
>            ^
>    /usr/src/sys/kern/subr_devstat.c:76:41: note: expanded from macro 'DTRACE_DEVSTAT_BIO_DONE'
>                    (*dtrace_io_done_probe)(dtio_done_id, bs, ds);
>                                                          ^
>    1 error generated.
>    *** Error code 1
> 
>    Stop in /usr/obj/usr/src/sys/ZOEY.
>    *** Error code 1
> 
>    Stop in /usr/src.
>    *** [buildkernel] Error code 1
> 
> and used the following patch to get it to compile:
> 
> diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c
> index e2b6d21..732bf9c 100644
> --- a/sys/kern/subr_devstat.c
> +++ b/sys/kern/subr_devstat.c
> @@ -73,7 +73,7 @@ uint32_t      dtio_wait_done_id;
> 
> #define DTRACE_DEVSTAT_BIO_DONE() \
>        if (dtrace_io_done_probe != NULL) \
> -               (*dtrace_io_done_probe)(dtio_done_id, bs, ds);
> +               (*dtrace_io_done_probe)(dtio_done_id, bp, ds);
> 
> Other than that the provider seems to work fine so far.

OK, let me get that fixed up and put up a newer patch.

Thanks for testing and replying!

Best,
George



More information about the freebsd-arch mailing list