From patchwork Tue May 17 11:00:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 95906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EEE9FB6EEB for ; Tue, 17 May 2011 21:04:04 +1000 (EST) Received: from localhost ([::1]:55967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMI4H-0006ir-RN for incoming@patchwork.ozlabs.org; Tue, 17 May 2011 07:04:01 -0400 Received: from eggs.gnu.org ([140.186.70.92]:40185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMI2a-0005Zv-IF for qemu-devel@nongnu.org; Tue, 17 May 2011 07:03:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMI1x-0004zc-FO for qemu-devel@nongnu.org; Tue, 17 May 2011 07:02:16 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:62390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMI1x-0004zX-C8 for qemu-devel@nongnu.org; Tue, 17 May 2011 07:01:37 -0400 Received: by iym10 with SMTP id 10so365615iym.4 for ; Tue, 17 May 2011 04:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=F6v2xnNB24rVwMs8hkmRkCFE+amjWY9pMj7U5GHN3bI=; b=CiMr2QHmB/Xt9onxzM6ppZtQxS/5GR4nFr0ftDPe+oq+/0fcFTPrWsk8iENGHX/vjt 0XIhFTD49EQpIRsTo5FPzM/R7sbesfo4lEFB/YETU1j7p5bBdna4RRS/4crBOoFNRShA iTWoF5YZnvWbIH+0d48v1EJ8e1TpU+l29E5co= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=uV/QcJJY7UcayxtDzHlRQd/0XACQZyqKT6/hGgWsDvKDCs/TyqTQmT4kMF3ErZyU9V 34cW+yzRV51bHukgKyDUwk/9jgpY398Y1uHVRj1eKB0QmIaSgJbUtoFOWPF8d5c2IaIC 5sdm6Mmzk1R3p1PXsuiNjLndMSUtY7ibgsR3k= Received: by 10.231.114.41 with SMTP id c41mr321570ibq.112.1305630096577; Tue, 17 May 2011 04:01:36 -0700 (PDT) Received: from localhost.localdomain (93-34-184-88.ip51.fastwebnet.it [93.34.184.88]) by mx.google.com with ESMTPS id c16sm211390ibe.41.2011.05.17.04.01.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2011 04:01:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 17 May 2011 13:00:47 +0200 Message-Id: <1305630067-2119-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1305630067-2119-1-git-send-email-pbonzini@redhat.com> References: <1305630067-2119-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.173 Subject: [Qemu-devel] [PATCH v3 01/21] scsi: add tracing of scsi requests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Paolo Bonzini Reviewed-by: Christoph Hellwig --- hw/scsi-bus.c | 6 ++++++ trace-events | 6 ++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index ceeb4ec..0fd85fc 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -4,6 +4,7 @@ #include "scsi-defs.h" #include "qdev.h" #include "blockdev.h" +#include "trace.h" static char *scsibus_get_fw_dev_path(DeviceState *dev); @@ -141,6 +142,7 @@ SCSIRequest *scsi_req_alloc(size_t size, SCSIDevice *d, uint32_t tag, uint32_t l req->lun = lun; req->status = -1; req->enqueued = true; + trace_scsi_req_alloc(req->dev->id, req->lun, req->tag); QTAILQ_INSERT_TAIL(&d->requests, req, next); return req; } @@ -159,6 +161,7 @@ SCSIRequest *scsi_req_find(SCSIDevice *d, uint32_t tag) static void scsi_req_dequeue(SCSIRequest *req) { + trace_scsi_req_dequeue(req->dev->id, req->lun, req->tag); if (req->enqueued) { QTAILQ_REMOVE(&req->dev->requests, req, next); req->enqueued = false; @@ -195,6 +198,7 @@ static int scsi_req_length(SCSIRequest *req, uint8_t *cmd) req->cmd.len = 12; break; default: + trace_scsi_req_parse_bad(req->dev->id, req->lun, req->tag, cmd[0]); return -1; } @@ -392,6 +396,8 @@ int scsi_req_parse(SCSIRequest *req, uint8_t *buf) memcpy(req->cmd.buf, buf, req->cmd.len); scsi_req_xfer_mode(req); req->cmd.lba = scsi_req_lba(req); + trace_scsi_req_parsed(req->dev->id, req->lun, req->tag, buf[0], + req->cmd.mode, req->cmd.xfer, req->cmd.lba); return 0; } diff --git a/trace-events b/trace-events index a00b63c..55f89b4 100644 --- a/trace-events +++ b/trace-events @@ -205,6 +205,12 @@ disable usb_set_config(int addr, int config, int ret) "dev %d, config %d, ret %d disable usb_clear_device_feature(int addr, int feature, int ret) "dev %d, feature %d, ret %d" disable usb_set_device_feature(int addr, int feature, int ret) "dev %d, feature %d, ret %d" +# hw/scsi-bus.c +disable scsi_req_alloc(int target, int lun, int tag) "target %d lun %d tag %d" +disable scsi_req_dequeue(int target, int lun, int tag) "target %d lun %d tag %d" +disable scsi_req_parsed(int target, int lun, int tag, int cmd, int mode, int xfer, uint64_t lba) "target %d lun %d tag %d command %d dir %d length %d lba %"PRIu64"" +disable scsi_req_parse_bad(int target, int lun, int tag, int cmd) "target %d lun %d tag %d command %d" + # vl.c disable vm_state_notify(int running, int reason) "running %d reason %d"