From owner-freebsd-scsi@FreeBSD.ORG Mon Apr 11 16:07:41 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 397FF106564A; Mon, 11 Apr 2011 16:07:41 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id D9EA38FC19; Mon, 11 Apr 2011 16:07:40 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id p3BFcvNY063281; Mon, 11 Apr 2011 09:38:57 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id p3BFcvfT063280; Mon, 11 Apr 2011 09:38:57 -0600 (MDT) (envelope-from ken) Date: Mon, 11 Apr 2011 09:38:57 -0600 From: "Kenneth D. Merry" To: Alexander Motin Message-ID: <20110411153857.GA63246@nargothrond.kdm.org> References: <20110331223339.GA13682@freebsd.org> <201104010843.47367.jhb@freebsd.org> <20110404204316.GA11367@freebsd.org> <4D9D9917.3030102@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D9D9917.3030102@FreeBSD.org> User-Agent: Mutt/1.4.2i Cc: Alexander Best , freebsd-current@freebsd.org, John Baldwin , freebsd-scsi@freebsd.org Subject: Re: multiple issues with devstat_*(9) X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 16:07:41 -0000 On Thu, Apr 07, 2011 at 13:59:35 +0300, Alexander Motin wrote: > Alexander Best wrote: > > On Fri Apr 1 11, John Baldwin wrote: > >> On Thursday, March 31, 2011 6:33:39 pm Alexander Best wrote: > >>> i think there are multiple issues with devstat. i found the following in > >>> devicestat.h: > > ... > > >>> funny thing is i found the following in scsi_pass.c: > >>> > >>> softc->device_stats = devstat_new_entry("pass", > >>> periph->unit_number, 0, > >>> DEVSTAT_NO_BLOCKSIZE > >>> | (no_tags ? DEVSTAT_NO_ORDERED_TAGS : 0), > >>> softc->pd_type | > >>> DEVSTAT_TYPE_IF_SCSI | > >>> DEVSTAT_TYPE_PASS, > >>> DEVSTAT_PRIORITY_PASS); > >>> > >>> ...so pass* *should* show up under iostat -t scsi. > > As I can see, this is a bug (or feature) of the libdevstat / > devstat_selectdevs(). If you specify any -t, then pass devices will be > reported only if you request "pass" specifically. > > >> Hmm, pass devices for adaX should not be SCSI though, they should be ide I > >> think. > > > > i think the situation with ATA_CAM should be discussed further. still besides > > this issue there are many more with devstat(3). > > > > i'll try to track all the "devstat_new_entry()" occurrences and see if some > > issues can be fixed. maybe only the proper DEVSTAT_* args were forgotten. > > Assuming that SCSI and IDE in -t option means transport type, and > assuming that we count everything except ATA and SATA as SCSI, I've made > following patch, that should fix issues from the CAM side: > http://people.freebsd.org/~mav/cam.devstat.patch > > Any objections? Or SCSI/IDE there expected to mean command set? For what it's worth, I think the above patch is the right approach. The device type stuff in devstat has been broken since GEOM went in, so I'm glad to see you step up to fix it! Ken -- Kenneth Merry ken@FreeBSD.ORG