diff options
author | Keith Busch <keith.busch@intel.com> | 2018-07-02 11:15:03 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-07-24 09:55:45 -0400 |
commit | b80a55e246a1b817cb254d79d077f364a2419578 (patch) | |
tree | 49f9fcf9cff16d42f4f95353f5cdefc191a829ff /drivers/nvme | |
parent | 5d87eb94d9ba13e5e2d5ceb56ac6fe0948259ffa (diff) |
nvme: add controller name to trace events
This appends the controller instance to the nvme trace buffer to
distinguish which controller is dispatching and completing a command.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/trace.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h index e6362677447d..35b8c72478d5 100644 --- a/drivers/nvme/host/trace.h +++ b/drivers/nvme/host/trace.h | |||
@@ -82,6 +82,7 @@ TRACE_EVENT(nvme_setup_cmd, | |||
82 | TP_PROTO(struct request *req, struct nvme_command *cmd), | 82 | TP_PROTO(struct request *req, struct nvme_command *cmd), |
83 | TP_ARGS(req, cmd), | 83 | TP_ARGS(req, cmd), |
84 | TP_STRUCT__entry( | 84 | TP_STRUCT__entry( |
85 | __field(int, ctrl_id) | ||
85 | __field(int, qid) | 86 | __field(int, qid) |
86 | __field(u8, opcode) | 87 | __field(u8, opcode) |
87 | __field(u8, flags) | 88 | __field(u8, flags) |
@@ -91,6 +92,7 @@ TRACE_EVENT(nvme_setup_cmd, | |||
91 | __array(u8, cdw10, 24) | 92 | __array(u8, cdw10, 24) |
92 | ), | 93 | ), |
93 | TP_fast_assign( | 94 | TP_fast_assign( |
95 | __entry->ctrl_id = nvme_req(req)->ctrl->instance; | ||
94 | __entry->qid = nvme_req_qid(req); | 96 | __entry->qid = nvme_req_qid(req); |
95 | __entry->opcode = cmd->common.opcode; | 97 | __entry->opcode = cmd->common.opcode; |
96 | __entry->flags = cmd->common.flags; | 98 | __entry->flags = cmd->common.flags; |
@@ -100,9 +102,9 @@ TRACE_EVENT(nvme_setup_cmd, | |||
100 | memcpy(__entry->cdw10, cmd->common.cdw10, | 102 | memcpy(__entry->cdw10, cmd->common.cdw10, |
101 | sizeof(__entry->cdw10)); | 103 | sizeof(__entry->cdw10)); |
102 | ), | 104 | ), |
103 | TP_printk("qid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)", | 105 | TP_printk("nvme%d: qid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)", |
104 | __entry->qid, __entry->cid, __entry->nsid, | 106 | __entry->ctrl_id, __entry->qid, __entry->cid, |
105 | __entry->flags, __entry->metadata, | 107 | __entry->nsid, __entry->flags, __entry->metadata, |
106 | show_opcode_name(__entry->qid, __entry->opcode), | 108 | show_opcode_name(__entry->qid, __entry->opcode), |
107 | parse_nvme_cmd(__entry->qid, __entry->opcode, __entry->cdw10)) | 109 | parse_nvme_cmd(__entry->qid, __entry->opcode, __entry->cdw10)) |
108 | ); | 110 | ); |
@@ -111,6 +113,7 @@ TRACE_EVENT(nvme_complete_rq, | |||
111 | TP_PROTO(struct request *req), | 113 | TP_PROTO(struct request *req), |
112 | TP_ARGS(req), | 114 | TP_ARGS(req), |
113 | TP_STRUCT__entry( | 115 | TP_STRUCT__entry( |
116 | __field(int, ctrl_id) | ||
114 | __field(int, qid) | 117 | __field(int, qid) |
115 | __field(int, cid) | 118 | __field(int, cid) |
116 | __field(u64, result) | 119 | __field(u64, result) |
@@ -119,6 +122,7 @@ TRACE_EVENT(nvme_complete_rq, | |||
119 | __field(u16, status) | 122 | __field(u16, status) |
120 | ), | 123 | ), |
121 | TP_fast_assign( | 124 | TP_fast_assign( |
125 | __entry->ctrl_id = nvme_req(req)->ctrl->instance; | ||
122 | __entry->qid = nvme_req_qid(req); | 126 | __entry->qid = nvme_req_qid(req); |
123 | __entry->cid = req->tag; | 127 | __entry->cid = req->tag; |
124 | __entry->result = le64_to_cpu(nvme_req(req)->result.u64); | 128 | __entry->result = le64_to_cpu(nvme_req(req)->result.u64); |
@@ -126,9 +130,10 @@ TRACE_EVENT(nvme_complete_rq, | |||
126 | __entry->flags = nvme_req(req)->flags; | 130 | __entry->flags = nvme_req(req)->flags; |
127 | __entry->status = nvme_req(req)->status; | 131 | __entry->status = nvme_req(req)->status; |
128 | ), | 132 | ), |
129 | TP_printk("qid=%d, cmdid=%u, res=%llu, retries=%u, flags=0x%x, status=%u", | 133 | TP_printk("nvme%d: qid=%d, cmdid=%u, res=%llu, retries=%u, flags=0x%x, status=%u", |
130 | __entry->qid, __entry->cid, __entry->result, | 134 | __entry->ctrl_id, __entry->qid, __entry->cid, |
131 | __entry->retries, __entry->flags, __entry->status) | 135 | __entry->result, __entry->retries, __entry->flags, |
136 | __entry->status) | ||
132 | 137 | ||
133 | ); | 138 | ); |
134 | 139 | ||