From owner-freebsd-arch@FreeBSD.ORG Fri May 25 16:02:47 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 6439D1065674 for ; Fri, 25 May 2012 16:02:47 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 34B808FC19 for ; Fri, 25 May 2012 16:02:47 +0000 (UTC) Received: from [209.249.190.124] (port=52208 helo=punk.neville-neil.com.neville-neil.com) by vps.hungerhost.com with esmtpa (Exim 4.77) (envelope-from ) id 1SXwyR-0008T5-Te for arch@freebsd.org; Fri, 25 May 2012 12:02:44 -0400 Date: Fri, 25 May 2012 12:03:40 -0400 Message-ID: <86wr40tfhf.wl%gnn@neville-neil.com> From: gnn@freebsd.org To: arch@freebsd.org User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.4 (amd64-portbld-freebsd10.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: Subject: 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: Fri, 25 May 2012 16:02:47 -0000 Howdy, 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. You can find the patch here: freebsd.org: http://people.freebsd.org/~gnn/dtio_provider.diff 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. 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. I need to clean this up and get the translators working properly before I can check this in. 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. 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. Comments welcome. Best, George