From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 10 20:19:59 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 127F5106566C; Sun, 10 Apr 2011 20:19:59 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8DF8FC14; Sun, 10 Apr 2011 20:19:57 +0000 (UTC) Received: by bwz12 with SMTP id 12so5186504bwz.13 for ; Sun, 10 Apr 2011 13:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Mx78LRKRvuwHnOi+q2hCAyBhIvWsSHXZueFWQCImCxQ=; b=kVaSRX6IOIri9BUg2B2fE9+/lukMlqH0qEn+DiXm9yZSUqHsautf5blKa9RXbyXZ3J WE79q10T4QkJxJks0Yz2FE/nyjzP0OIpLuYwzfpcC9/8AhAIZTC/kyyk/ctHrSscQVAA fBwYdQ5xy3JofT3qRpd4EsxK38gRoBClStUXY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=TkrEDw/ltdxlzjJYf+hM5VZJFlfGIbJHTc+HV6RFPAwCErYB/8mLFECzMykaOd5CCW N0i9UPbl6aguJMuXn7S+GHHD2kYCoHoDZztUXp2tgyPvnmpjqYurLrEIoFSDj0TjpWMb 823i/GusButnPDmWT4uGSJd9dV/DCSYTnDaKM= Received: by 10.204.81.213 with SMTP id y21mr3425752bkk.63.1302466781406; Sun, 10 Apr 2011 13:19:41 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id t1sm2823228bkx.19.2011.04.10.13.19.39 (version=SSLv3 cipher=OTHER); Sun, 10 Apr 2011 13:19:40 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DA210D3.5090807@FreeBSD.org> Date: Sun, 10 Apr 2011 23:19:31 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Alexander Best References: <20110331223339.GA13682@freebsd.org> <201104010843.47367.jhb@freebsd.org> <20110404204316.GA11367@freebsd.org> <4D9D9917.3030102@FreeBSD.org> <20110410115644.GA55815@freebsd.org> In-Reply-To: <20110410115644.GA55815@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-scsi@freebsd.org, freebsd-current@freebsd.org, John Baldwin 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: Sun, 10 Apr 2011 20:19:59 -0000 Alexander Best wrote: > On Thu Apr 7 11, 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 > > with your patch i get the following output: > > otaku% iostat -t ide > tty ada0 ada1 cpu > tin tout KB/t tps MB/s KB/t tps MB/s us ni sy in id > 6 144 14.21 6 0.09 20.46 40 0.81 2 0 3 0 95 > otaku% iostat -t scsi > tty cd0 cpu > tin tout KB/t tps MB/s us ni sy in id > 6 146 2.32 0 0.00 2 0 3 0 95 > otaku% iostat -t pass > tty pass0 pass1 pass2 cpu > tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id > 6 147 0.36 0 0.00 0.36 0 0.00 0.00 0 0.00 2 0 3 0 95 > otaku% iostat -t da > tty ada0 ada1 cpu > tin tout KB/t tps MB/s KB/t tps MB/s us ni sy in id > 6 147 14.21 6 0.08 20.46 37 0.75 1 0 3 0 95 > otaku% iostat -t cd > tty cd0 cpu > tin tout KB/t tps MB/s us ni sy in id > 7 147 2.32 0 0.00 1 0 3 0 95 > otaku% iostat -t other > tty cpu > tin tout us ni sy in id > 7 149 1 0 3 0 95 > otaku% iostat -n 100 > tty ada0 ada1 cd0 pass0 pass1 pass2 cpu > tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id > 6 135 14.21 5 0.07 20.44 32 0.64 2.32 0 0.00 0.36 0 0.00 0.36 0 0.00 0.00 0 0.00 1 0 3 0 96 > > the the remaining issues imho are: > > 1) ada* and cd* are SATA/ATA devices. so i think they should show up together > either under ide *or* scsi. i don't have any *real* scsi devices. I've just retested the patch and haven't reproduced your problem: %iostat -d da0 ada0 da1 cd0 KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s 0.01 0 0.00 3.27 1 0.00 2.65 1 0.00 0.00 0 0.00 %iostat -d -t ide da0 ada0 cd0 KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s 0.01 0 0.00 3.27 1 0.00 0.00 0 0.00 %iostat -d -t scsi da1 KB/t tps MB/s 2.65 1 0.00 %iostat -d -t pass pass0 pass1 pass2 pass3 KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 %iostat -d -t ide,pass pass0 pass1 pass2 KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 %iostat -d -t scsi,pass pass3 KB/t tps MB/s 0.00 0 0.00 da0 is an PATA ATAPI ZIP, da1 - USB floppy, ada0 - SATA HDD, cd0 - PATA ATAPI CD-ROM. Just an idea, aren't you are using legacy ata(4) + atapicam for your cd0? atapicam lies that it's buses are SPI (SCSI). > 2) the pass* devices still don't show up under ide/scsi/other. that's ok, but > then the src comments and manual pages need to be changed accordingly. As I have told - it is a bug/feature of libdevstat. It should not be difficult to fix, if it is really a bug. -- Alexander Motin