From owner-freebsd-arch@FreeBSD.ORG Mon May 28 17:11:27 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6B29106566C; Mon, 28 May 2012 17:11:27 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay06.ispgateway.de (smtprelay06.ispgateway.de [80.67.31.101]) by mx1.freebsd.org (Postfix) with ESMTP id 744698FC0A; Mon, 28 May 2012 17:11:27 +0000 (UTC) Received: from [78.35.185.129] (helo=fabiankeil.de) by smtprelay06.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1SZ3OF-0001HQ-Mj; Mon, 28 May 2012 19:05:55 +0200 Date: Mon, 28 May 2012 19:03:00 +0200 From: Fabian Keil To: gnn@freebsd.org Message-ID: <20120528190300.3a43fc8d@fabiankeil.de> In-Reply-To: <86wr40tfhf.wl%gnn@neville-neil.com> References: <86wr40tfhf.wl%gnn@neville-neil.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/JwiCtaM=HFd/B+UCSuQaqjH"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: arch@freebsd.org Subject: Re: RFC: A trial io provider for DTrace... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 17:11:27 -0000 --Sig_/JwiCtaM=HFd/B+UCSuQaqjH Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable gnn@freebsd.org wrote: > I have just put up the first patch that can give you something similar > to the io provider in DTrace. The patch is against HEAD of about a > week ago. >=20 > You can find the patch here: freebsd.org: >=20 > http://people.freebsd.org/~gnn/dtio_provider.diff >=20 > Note that you need to create a src/sys/modules/dtrace/dtio/ directory > for this patch, since patch doesn't seem to create directories for me. Worked for me when applying with -p0. > 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. >=20 > Here is an example of it working: >=20 > dtrace -n 'io:::start /args[0] !=3D 0/{ trace(args[0]->bio_bcount)}' >=20 > 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 > I need to clean this up and get the translators working properly > before I can check this in. >=20 > Also, note that this patch doesn't catch all I/O, but should get most > of it, as it's hooked into the devstat system. >=20 > I will be adding manual pages for the internals of DTrace to our > section 9, as well as, hopefully, writing up a wiki page on how to add > your own kernel providers. >=20 > Comments welcome. I got: clang -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -g -Wall -Wredundant-de= cls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-ar= ith -Winline -Wcast-qual /usr/src/sys/kern/subr_devstat.c:390:2: error: use of undeclared identi= fier 'bs' DTRACE_DEVSTAT_BIO_DONE(); ^ /usr/src/sys/kern/subr_devstat.c:76:41: note: expanded from macro 'DTRA= CE_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 !=3D 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. Thanks a lot. Fabian --Sig_/JwiCtaM=HFd/B+UCSuQaqjH Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/Dr8sACgkQBYqIVf93VJ0JFgCfTDujAxJajr4079QCmroHgWsl wDcAn12ctyO6y8hGFhLA1RwxzoB4TNNj =Jfaw -----END PGP SIGNATURE----- --Sig_/JwiCtaM=HFd/B+UCSuQaqjH--