From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoX99-00064L-5k for qemu-devel@nongnu.org; Wed, 03 Aug 2011 04:49:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoX92-0003kO-QR for qemu-devel@nongnu.org; Wed, 03 Aug 2011 04:49:42 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:44070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoX91-0003gH-VZ for qemu-devel@nongnu.org; Wed, 03 Aug 2011 04:49:40 -0400 Received: by mail-wy0-f173.google.com with SMTP id 20so154406wye.4 for ; Wed, 03 Aug 2011 01:49:39 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 3 Aug 2011 10:49:19 +0200 Message-Id: <1312361359-15445-17-git-send-email-pbonzini@redhat.com> In-Reply-To: <1312361359-15445-1-git-send-email-pbonzini@redhat.com> References: <1312361359-15445-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 16/16] scsi: add special traces for common commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Can be useful when debugging the device scan phase. Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c | 17 +++++++++++++++++ trace-events | 4 ++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index f6fb4f0..143c7eb 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -396,6 +396,23 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, } req->cmd = cmd; + switch (buf[0]) { + case INQUIRY: + trace_scsi_inquiry(d->id, lun, tag, cmd.buf[1], cmd.buf[2]); + break; + case TEST_UNIT_READY: + trace_scsi_test_unit_ready(d->id, lun, tag); + break; + case REPORT_LUNS: + trace_scsi_report_luns(d->id, lun, tag); + break; + case REQUEST_SENSE: + trace_scsi_request_sense(d->id, lun, tag); + break; + default: + break; + } + return req; } diff --git a/trace-events b/trace-events index 55023b0..c565748 100644 --- a/trace-events +++ b/trace-events @@ -249,6 +249,10 @@ disable scsi_req_parsed(int target, int lun, int tag, int cmd, int mode, int xfe disable scsi_req_parsed_lba(int target, int lun, int tag, int cmd, uint64_t lba) "target %d lun %d tag %d command %d lba %"PRIu64"" disable scsi_req_parse_bad(int target, int lun, int tag, int cmd) "target %d lun %d tag %d command %d" disable scsi_req_build_sense(int target, int lun, int tag, int key, int asc, int ascq) "target %d lun %d tag %d key %#02x asc %#02x ascq %#02x" +disable scsi_report_luns(int target, int lun, int tag) "target %d lun %d tag %d" +disable scsi_inquiry(int target, int lun, int tag, int cdb1, int cdb2) "target %d lun %d tag %d page %#02x/%#02x" +disable scsi_test_unit_ready(int target, int lun, int tag) "target %d lun %d tag %d" +disable scsi_request_sense(int target, int lun, int tag) "target %d lun %d tag %d" # vl.c disable vm_state_notify(int running, int reason) "running %d reason %d" -- 1.7.6