From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 6 05:03:54 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 884EC16A41F for ; Tue, 6 Sep 2005 05:03:54 +0000 (GMT) (envelope-from nikhildharashivkar@gmail.com) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA3BE43D49 for ; Tue, 6 Sep 2005 05:03:53 +0000 (GMT) (envelope-from nikhildharashivkar@gmail.com) Received: by rproxy.gmail.com with SMTP id r35so931038rna for ; Mon, 05 Sep 2005 22:03:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sbSG28rNpKgyg1Glb70yDYJFxdDz28NsWu0nCjzIlP9FCjfeHqkskZ2gbRftJVyEx4Ai1DSj32POq8BTdDsXa6+ROGwuqTLIfnFAqAUnwOPjQPq5AAyAj1jHfp+oG8beypatVxZQDQZLh2KhdRc9cb7FFQn7bxX3UE4yHSsa3/c= Received: by 10.38.73.47 with SMTP id v47mr474921rna; Mon, 05 Sep 2005 22:03:53 -0700 (PDT) Received: by 10.38.12.59 with HTTP; Mon, 5 Sep 2005 22:03:53 -0700 (PDT) Message-ID: <17db6d3a0509052203b1da14a@mail.gmail.com> Date: Tue, 6 Sep 2005 10:33:53 +0530 From: Nikhil Dharashivkar To: Scott Long In-Reply-To: <431C93DD.20402@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <17db6d3a0509051000622868bc@mail.gmail.com> <431C8D5B.7080309@samsco.org> <431C92F2.9090104@persistent.co.in> <431C93DD.20402@samsco.org> Cc: freebsd-hackers@freebsd.org, "Rajesh S. Ghanekar" , freebsd-scsi@freebsd.org Subject: Re: Adding new option to ktrace X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2005 05:03:54 -0000 Hi Scott and Rajesh, Thanks for replying me. Basically what happend, while testing scsi driver on freebsd, at some point it crashes. So, there is no way to know how much IO is performed. To know the IO state just before the driver fails, i selected ktrace to print IO information whatever i ll get from dastrategy routine. On 9/6/05, Scott Long wrote: > Rajesh S. Ghanekar wrote: > > Scott Long wrote: > > > >> Nikhil Dharashivkar wrote: > >> > >>> Hi, > >>> i want to hack the ktrace system call. Basically, I want to monito= r > >>> scsi disk IO through dastrategy() routine. > >>> It seems that kern_ktrace.c implements different functions for > >>> ktrace options like -tc / -ti ... etc (see man page). So, is it > >>> possible to add new option for disk IO with new structure object > >>> containing disk io information which will be pass to > >>> ktr_submittrequest thr' ktr_request structure. > >>> Will data will be written correctly in ktrace.out and will > >>> kdump analyze that ? > >>> > >>> > >>> > >> > >> What are you trying to monitor? Would the existing devstat interface > >> work? > > > > > > May be he requires how many bytes transferred (read/write) while a > > process is executing. > > I guess devstat doesn't do it from process context, it gives total IO > > read/writes from a device, > > if registred via devstat. Please correct me if I am wrong. > > > > > > - Rajesh > > >=20 > There isn't a 1:1 correlation between the bytes that the userland > program writes, and the bytes that actually get written to disk. > Filesystem metadata writes will happen if the file needs to be > extended, not to mention the access time being updated. Some writes > won't even originate from a userland program, like swap writes. > GEOM also decouples the I/O path, so it's not the user process that > will actually do the write, it's the g_down kthread. I would think > that this would make tracking I/O via ktrace very hard. >=20 > Scott >=20 --=20 Thanks and Regards, Nikhil.