From patchwork Mon May 23 16:08:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 96980 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 CC5A2B6FA4 for ; Tue, 24 May 2011 02:09:54 +1000 (EST) Received: from localhost ([::1]:55407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOXhY-000118-4W for incoming@patchwork.ozlabs.org; Mon, 23 May 2011 12:09:52 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOXhD-0000vS-HA for qemu-devel@nongnu.org; Mon, 23 May 2011 12:09:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOXhC-0001DZ-FT for qemu-devel@nongnu.org; Mon, 23 May 2011 12:09:31 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:50127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOXhC-0001DU-8i for qemu-devel@nongnu.org; Mon, 23 May 2011 12:09:30 -0400 Received: by pvg3 with SMTP id 3so3215837pvg.4 for ; Mon, 23 May 2011 09:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references; bh=QhGZGO0aJtxiefyBQgClATs2AfXR+xoov0LYDWuHFjE=; b=R5WSpXcN8DbRlkvwqrwSqM9WXpIfacEqEGJ5avpd08ZQm5mWWu1h4ZGDnUldvp/va4 QsiPPpONTEE0FJInTtv77WrPtLpNcwUupmEBHGoMCrbUgRtB1OcpPW2/GkeSYbRkBreK SQiI9nMNfRRYk1QbKDo68wtaD5wOT2m83igxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=GSGcoPkAdVTy5PzVzPaCHI4xQQyQLOeHNuP8f3Btg0jMWawoJ01RySupK5kYsCteaO iTfHJyucqKbfJYnKaVjxLrDPJM6pnIb96pAa17VDAlKbC/UuwZXz1snHV4GezlvgZX2m Z535IA094jFv4oVpOJ/WAH2etGdDZqzPw3BzM= Received: by 10.143.96.7 with SMTP id y7mr843601wfl.30.1306166969538; Mon, 23 May 2011 09:09:29 -0700 (PDT) Received: from localhost.localdomain (93-34-184-88.ip51.fastwebnet.it [93.34.184.88]) by mx.google.com with ESMTPS id x12sm5946194wfd.6.2011.05.23.09.09.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2011 09:09:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 23 May 2011 18:08:46 +0200 Message-Id: <1306166949-19698-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306166949-19698-1-git-send-email-pbonzini@redhat.com> References: <1306166949-19698-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.173 Cc: hch@lst.de Subject: [Qemu-devel] [PATCH v4 01/24] 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"