qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/2] Add trace calls to scsi-disk.c.


From: Don Koch
Subject: [Qemu-devel] [PATCH 1/2] Add trace calls to scsi-disk.c.
Date: Fri, 16 Jan 2015 14:20:24 -0500

Signed-off-by: Don Koch <address@hidden>
---
 hw/scsi/scsi-disk.c | 4 ++++
 trace-events        | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index f65618d..98bbead 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -37,6 +37,7 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
 #include "sysemu/blockdev.h"
 #include "hw/block/block.h"
 #include "sysemu/dma.h"
+#include "trace.h"
 
 #ifdef __linux
 #include <scsi/sg.h>
@@ -533,6 +534,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, 
uint8_t *outbuf)
     int buflen = 0;
     int start;
 
+    trace_scsi_disk_inquiry(req->cmd.buf[1], req->cmd.buf[2]);
     if (req->cmd.buf[1] & 0x1) {
         /* Vital product data */
         uint8_t page_code = req->cmd.buf[2];
@@ -717,6 +719,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, 
uint8_t *outbuf)
 
     /* Standard INQUIRY data */
     if (req->cmd.buf[2] != 0) {
+        trace_scsi_disk_inquiry_err_standard(req->cmd.buf[2]);
         return -1;
     }
 
@@ -1843,6 +1846,7 @@ static int32_t scsi_disk_emulate_command(SCSIRequest 
*req, uint8_t *buf)
     case INQUIRY:
         buflen = scsi_disk_emulate_inquiry(req, outbuf);
         if (buflen < 0) {
+            trace_scsi_disk_inquiry_err_generic(buflen);
             goto illegal_request;
         }
         break;
diff --git a/trace-events b/trace-events
index 6a60f19..43fb0db 100644
--- a/trace-events
+++ b/trace-events
@@ -588,6 +588,11 @@ scsi_inquiry(int target, int lun, int tag, int cdb1, int 
cdb2) "target %d lun %d
 scsi_test_unit_ready(int target, int lun, int tag) "target %d lun %d tag %d"
 scsi_request_sense(int target, int lun, int tag) "target %d lun %d tag %d"
 
+# hw/scsi/scsi-disk.c
+scsi_disk_inquiry_err_standard(int buf2) "buf[2]=%u"
+scsi_disk_inquiry_err_generic(int buflen) "buflen=%d"
+scsi_disk_inquiry(int buf1, int buf2) "buf[1]=0x%x buf[2]=0x%x"
+
 # vl.c
 vm_state_notify(int running, int reason) "running %d reason %d"
 load_file(const char *name, const char *path) "name %s location %s"
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]