Skip to contentSkip to conversation

scsi: fix tracing of scsi requests with simple backend

PATCH Applied Paolo Bonzini 2 participants 2 messages Jun 3, 2011 – Jun 5, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: fix tracing of scsi requests with simple backend

The simple backend only supports a maximum of 6 arguments. Split the scsi_req_parsed event in two parts to cope with the limit.

---
 hw/scsi-bus.c |    6 +++++-
 trace-events  |    3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)
hw/scsi-bus.c +5 -1
index 837f24e..ad6a730 100644
@@ -413,7 +413,11 @@ int scsi_req_parse(SCSIRequest *req, uint8_t *buf)
     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);
+                          req->cmd.mode, req->cmd.xfer);
+    if (req->cmd.lba != -1) {
+        trace_scsi_req_parsed_lba(req->dev->id, req->lun, req->tag, buf[0],
+                              req->cmd.lba);
+    }
     return 0;
 }
 
trace-events +2 -1
index 3137a15..e0e9574 100644
@@ -210,7 +210,8 @@ disable scsi_req_alloc(int target, int lun, int tag) "target %d lun %d tag %d"
 disable scsi_req_data(int target, int lun, int tag, int len) "target %d lun %d tag %d len %d"
 disable scsi_req_dequeue(int target, int lun, int tag) "target %d lun %d tag %d"
 disable scsi_req_continue(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_parsed(int target, int lun, int tag, int cmd, int mode, int xfer) "target %d lun %d tag %d command %d dir %d length %d"
+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"
 
 # vl.c
Signature · 1 line
1.7.4.4
Applied
#1 lore raw

Thanks, applied.

Quoted 45 lines · Paolo Bonzini

The simple backend only supports a maximum of 6 arguments.  Split the scsi_req_parsed event in two parts to cope with the limit.

---
 hw/scsi-bus.c |    6 +++++-
 trace-events  |    3 ++-

 2 files changed, 7 insertions(+), 2 deletions(-)
hw/scsi-bus.c +5 -1
index 837f24e..ad6a730 100644
@@ -413,7 +413,11 @@ int scsi_req_parse(SCSIRequest *req, uint8_t *buf)
     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);
+                          req->cmd.mode, req->cmd.xfer);
+    if (req->cmd.lba != -1) {
+        trace_scsi_req_parsed_lba(req->dev->id, req->lun, req->tag, buf[0],
+                              req->cmd.lba);
+    }
     return 0;
  }
 
trace-events +0 -0
index 3137a15..e0e9574 100644
@@ -210,7 +210,8 @@ disable scsi_req_alloc(int target, int lun, int tag) "target %d lun %d tag %d"

 disable scsi_req_data(int target, int lun, int tag, int len) "target %d lun %d tag %d len %d" disable scsi_req_dequeue(int target, int lun, int tag) "target %d lun %d tag %d" disable scsi_req_continue(int target, int lun, int tag) "target %d lun %d tag %d"

trace-events +2 -1
-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_parsed(int target, int lun, int tag, int cmd, int mode, int xfer) "target %d lun %d tag %d command %d dir %d length %d"
+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"

 # vl.c
--
1.7.4.4