Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:GA
qemu-linux-user
0161-virtio-scsi-trace-events.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0161-virtio-scsi-trace-events.patch of Package qemu-linux-user
From: Hannes Reinecke <hare@suse.de> Date: Wed, 11 Nov 2020 13:09:27 +0100 Subject: virtio-scsi: trace events Git-commit: eb8cb3d9dcfbcc74ebaabed4ef0d915eeffa4da1 References: bsc#1178049 Add trace events for SCSI and TMF command tracing. Signed-off-by: Hannes Reinecke <hare@suse.de> BR: Includes minor tweaks that came from the PTF patch as opposed to the one upstreamed. Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/scsi/trace-events | 6 ++++++ hw/scsi/virtio-scsi.c | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events index 3c2fd7f52f6b1dd030ac0aee7e65..61b75d707e0bd01955e8d88ab92c 100644 --- a/hw/scsi/trace-events +++ b/hw/scsi/trace-events @@ -292,6 +292,12 @@ lsi_awoken(void) "Woken by SIGP" lsi_reg_read(const char *name, int offset, uint8_t ret) "Read reg %s 0x%x = 0x%02x" lsi_reg_write(const char *name, int offset, uint8_t val) "Write reg %s 0x%x = 0x%02x" +# hw/scsi/virtio-scsi.c +virtio_scsi_cmd_req(int lun, uint32_t tag, uint8_t cmd) "virtio_scsi_cmd_req lun=%u tag=0x%x cmd=0x%x" +virtio_scsi_cmd_resp(int lun, uint32_t tag, int response, uint8_t status) "virtio_scsi_cmd_resp lun=%u tag=0x%x response=%d status=0x%x" +virtio_scsi_tmf_req(int lun, uint32_t tag, int subtype) "virtio_scsi_tmf_req lun=%u tag=0x%x subtype=%d" +virtio_scsi_tmf_resp(int lun, uint32_t tag, int response) "virtio_scsi_tmf_resp lun=%u tag=0x%x response=%d" + # hw/scsi/scsi-disk.c scsi_disk_check_condition(uint32_t tag, uint8_t key, uint8_t asc, uint8_t ascq) "Command complete tag=0x%x sense=%d/%d/%d" scsi_disk_read_complete(uint32_t tag, size_t size) "Data ready tag=0x%x len=%zd" diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 3aa99717e235f2b150259468b615..d5f024994cd0607051ad2806c574 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -24,6 +24,7 @@ #include "scsi/constants.h" #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-access.h" +#include "trace.h" static inline int virtio_scsi_get_lun(uint8_t *lun) { @@ -235,7 +236,11 @@ static void virtio_scsi_cancel_notify(Notifier *notifier, void *data) notifier); if (--n->tmf_req->remaining == 0) { - virtio_scsi_complete_req(n->tmf_req); + VirtIOSCSIReq *req = n->tmf_req; + + trace_virtio_scsi_tmf_resp(virtio_scsi_get_lun(req->req.tmf.lun), + req->req.tmf.tag, req->resp.tmf.response); + virtio_scsi_complete_req(req); } g_free(n); } @@ -263,6 +268,8 @@ static int virtio_scsi_do_tmf(VirtIOSCSI *s, VirtIOSCSIReq *req) req->resp.tmf.response = VIRTIO_SCSI_S_OK; virtio_tswap32s(VIRTIO_DEVICE(s), &req->req.tmf.subtype); + trace_virtio_scsi_tmf_req(virtio_scsi_get_lun(req->req.tmf.lun), + req->req.tmf.tag, req->req.tmf.subtype); switch (req->req.tmf.subtype) { case VIRTIO_SCSI_T_TMF_ABORT_TASK: case VIRTIO_SCSI_T_TMF_QUERY_TASK: @@ -417,6 +424,10 @@ static void virtio_scsi_handle_ctrl_req(VirtIOSCSI *s, VirtIOSCSIReq *req) } } if (r == 0) { + if (type == VIRTIO_SCSI_T_TMF) + trace_virtio_scsi_tmf_resp(virtio_scsi_get_lun(req->req.tmf.lun), + req->req.tmf.tag, + req->resp.tmf.response); virtio_scsi_complete_req(req); } else { assert(r == -EINPROGRESS); @@ -452,6 +463,10 @@ static void virtio_scsi_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) static void virtio_scsi_complete_cmd_req(VirtIOSCSIReq *req) { + trace_virtio_scsi_cmd_resp(virtio_scsi_get_lun(req->req.cmd.lun), + req->req.cmd.tag, + req->resp.cmd.response, + req->resp.cmd.status); /* Sense data is not in req->resp and is copied separately * in virtio_scsi_command_complete. */ @@ -549,6 +564,8 @@ static int virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req) return -EINVAL; } } + trace_virtio_scsi_cmd_req(virtio_scsi_get_lun(req->req.cmd.lun), + req->req.cmd.tag, req->req.cmd.cdb[0]); d = virtio_scsi_device_find(s, req->req.cmd.lun); if (!d) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor