From owner-freebsd-stable@FreeBSD.ORG Fri Dec 3 08:21:08 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D585106566B for ; Fri, 3 Dec 2010 08:21:08 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4E6EB8FC18 for ; Fri, 3 Dec 2010 08:21:08 +0000 (UTC) Received: by vws9 with SMTP id 9so3766066vws.13 for ; Fri, 03 Dec 2010 00:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=yJFSzVWUxKz0vHL6Wofrt/JRKDwU8pG6oO8lvxRQQXI=; b=HyCC8tAB1FSfuMuhzO8BxsMnMApaBpriNgQgur1H9m5nc1geH7WmWeifYCBRy35p7c 6kXoR1RphuQ9/HiwXELuOXaB0dw21C1LpVD8HI6l9cqbVDKDb+dpSPz2dMGNYmQRLyX0 ltnRi/fWJPhP0GhMqrTy0Tl6yLuAdXgljjZ9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=tKkDK9GQd7wxfZe69AwJe/pjn8RhZ6ubz7aSk3++6tVsZJFsHLQlgyos8x1mBCIyQ3 OLuaifre5TKQ/1cR2KFZprnkM4d/5SvWlnVmwh5bnto5lgA9xtIiJg8OZsaSvbOC1Iqo aoqDLDPYdeANvDHk3hOQ9Sb7avOBaNAh0ccR4= MIME-Version: 1.0 Received: by 10.220.177.133 with SMTP id bi5mr268803vcb.260.1291364465597; Fri, 03 Dec 2010 00:21:05 -0800 (PST) Sender: artemb@gmail.com Received: by 10.220.177.195 with HTTP; Fri, 3 Dec 2010 00:21:05 -0800 (PST) In-Reply-To: References: Date: Fri, 3 Dec 2010 00:21:05 -0800 X-Google-Sender-Auth: Si-Magi1BX1s0u0YMI-VPf0r6Tk Message-ID: From: Artem Belevich To: Thomas Zander Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-stable Subject: Re: DTrace (or other monitor) access to LBA of a block device X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 08:21:08 -0000 On Thu, Dec 2, 2010 at 1:33 PM, Thomas Zander wrote: > Hi, > > do we have any way to monitor which LBAs of which block device are > read/written at a given time? > > I stumbled upon this, > http://southbrain.com/south/2008/02/fun-with-dtrace-and-zfs-mirror.html > > which is pretty intriguing. Unfortunately on FreeBSD we do not have > the DTrace io provider, so his dtrace script would not work. > Do we have another option to monitor block device access in a similar fashion? GEOM sounds like a good candidate for probing of that kind. sudo dtrace -n 'fbt:kernel:g_io_deliver:entry { printf("%s %d %d %d\n",stringof(args[0]->bio_from->geom->name), args[0]->bio_cmd, args[0]->bio_offset, args[0]->bio_length); }' Keep in mind that g_io_deliver will be called for each GEOM node from top to bottom for each completed request. You may need to add some filtering on device name to avoid redundant info. --Artem