From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 6 08:19:00 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 40C3516A41F for ; Tue, 6 Sep 2005 08:19:00 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from mail28.syd.optusnet.com.au (mail28.syd.optusnet.com.au [211.29.133.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BDED43D49 for ; Tue, 6 Sep 2005 08:18:59 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail28.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id j868IvHi000942 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 6 Sep 2005 18:18:57 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1]) by cirb503493.alcatel.com.au (8.12.10/8.12.10) with ESMTP id j868IuSR028985; Tue, 6 Sep 2005 18:18:56 +1000 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost) by cirb503493.alcatel.com.au (8.12.10/8.12.9/Submit) id j868IuGK028984; Tue, 6 Sep 2005 18:18:56 +1000 (EST) (envelope-from pjeremy) Date: Tue, 6 Sep 2005 18:18:55 +1000 From: Peter Jeremy To: Nikhil Dharashivkar Message-ID: <20050906081855.GA26550@cirb503493.alcatel.com.au> References: <17db6d3a0509051000622868bc@mail.gmail.com> <431C8D5B.7080309@samsco.org> <431C92F2.9090104@persistent.co.in> <431C93DD.20402@samsco.org> <17db6d3a0509052203b1da14a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17db6d3a0509052203b1da14a@mail.gmail.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@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 08:19:00 -0000 On Tue, 2005-Sep-06 10:33:53 +0530, Nikhil Dharashivkar wrote: > 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. It's not clear how ktrace is going to help here. The ktrXXX(9) functions place ktr_request events in a queue. A kernel thread then dumps the queue entries into a file via the normal buffer cache. The data on disk is typically about 30 seconds behind real time. If the system crashes, you will lose any events that are still in the buffer cache or ktr_todo queue. Another problem is that since ktrace generates disk I/O, it is likely to disturb your testing. A better approach would seem to be to build a circular buffer and store the I/O requests in the buffer. When the system crashes, you can look at the last entries in the buffer. -- Peter Jeremy