[OmniOS-discuss] Dtrace not working

Matthew Lagoe matthew.lagoe at subrigo.net
Fri May 16 14:03:29 UTC 2014


I am looking at moving from openindiana to omnios and I have a dtrace script
(below) that works on openindiana however I have tried running it on the
latest omnios r151010 and it doesn't run with the error ": No such file or
directory"

 

I am running it with ./wfileio.d, the other DTT scripts seem to work fine

 

When I run it with dtrace -s wfileio.d I also get an error "dtrace: failed
to compile script wfileio.d: line 39: failed to set option 'quiet': Invalid
option name

 

#!/usr/sbin/dtrace -s

/*

* wfileio.d - write file I/O stats, with cache miss rate.

*             Written using DTrace (Solaris 10 3/05)

*

* This script provides statistics on the number of reads and the bytes

* read from filesystems (logical), and the number of bytes read from

* disk (physical). A summary is printed every five seconds by file.

*

* A total miss-rate is also provided for the file system cache.

*

* $Id: wfileio.d 3 2007-08-01 10:50:08Z brendan $

*

* USAGE:            wfileio.d

*

* IDEA: Richard McDougall, Solaris Internals 2nd Ed, FS Chapter.

*

* COPYRIGHT: Copyright (c) 2006 Brendan Gregg.

*

* CDDL HEADER START

*

*  The contents of this file are subject to the terms of the

*  Common Development and Distribution License, Version 1.0 only

*  (the "License").  You may not use this file except in compliance

*  with the License.

*

*  You can obtain a copy of the license at Docs/cddl1.txt

*  or http://www.opensolaris.org/os/licensing.

*  See the License for the specific language governing permissions

*  and limitations under the License.

*

* CDDL HEADER END

*

* 19-Mar-2006  Brendan Gregg   Created this.

* 23-Apr-2006      "      "   Last update.

* 20-Mar-2014  Linda Kateley     Modified into writes

*/

 

#pragma D option quiet

 

self int trace;

uint64_t lbytes;

uint64_t pbytes;

 

dtrace:::BEGIN

{

                trace("Tracing...\n");

}

 

fbt::fop_write:entry

/self->trace == 0 && args[0]->v_path/

{

                self->pathname = cleanpath(args[0]->v_path);

                @wio[self->pathname, "logical"] = count();

                lbytes += args[1]->uio_resid;

                self->size = args[1]->uio_resid;

                self->uiop = args[1];

}

 

fbt::fop_write:return

/self->size/

{

                @wbytes[self->pathname, "logical"] =

                    sum(self->size - self->uiop->uio_resid);

                self->size = 0;

                self->uiop = 0;

                self->pathname = 0;

}

 

io::bdev_strategy:start

/self->size && args[0]->b_flags & B_READ/

{

                @wio[self->pathname, "physical"] = count();

                @wbytes[self->pathname, "physical"] =
sum(args[0]->b_bcount);

                pbytes += args[0]->b_bcount;

}

 

profile:::tick-5s

{

                trunc(@wio, 20);

                trunc(@wbytes, 20);

                printf("\033[H\033[2J");

                printf("\nWrit IOPS, top 20 (count)\n");

                printa("%-54s %10s %10 at d\n", @wio);

                printf("\nWrite Bandwidth, top 20 (bytes)\n");

                printa("%-54s %10s %10 at d\n", @wbytes);

                trunc(@wio);

}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20140516/09a20fff/attachment-0001.html>


More information about the OmniOS-discuss mailing list