Skip to content

Commit b75db73

Browse files
Martin PeschkeJames Bottomley
authored andcommitted
[SCSI] zfcp: Add qtcb dump to hba debug trace
This patch adds per request hardware debugging data to the trace record which is written per request. It's a replacement for some sad kernel message based debugging code. Considering the amount of trace data, printk() is not suitable for this stuff. Writing binary traces is more efficient. In addition we got all information in one place. The QTCB trace data is only dumped for requests other than SCSI requests. Otherwise we would flood the trace ring buffer. We are mostly interested in non-SCSI, recovery related requests here anyway. This patch also works around a known hardware bug. It truncates QTCB traces so that we do not save unused areas of the hardware trace. Signed-off-by: Martin Peschke <[email protected]> Signed-off-by: Christof Schmitt <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 07c70d2 commit b75db73

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/s390/scsi/zfcp_dbf.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req)
179179
(fsf_req->fsf_command == FSF_QTCB_OPEN_LUN)) {
180180
strncpy(rec->tag2, "open", ZFCP_DBF_TAG_SIZE);
181181
level = 4;
182+
} else if (qtcb->header.log_length) {
183+
strncpy(rec->tag2, "qtcb", ZFCP_DBF_TAG_SIZE);
184+
level = 5;
182185
} else {
183186
strncpy(rec->tag2, "norm", ZFCP_DBF_TAG_SIZE);
184187
level = 6;
@@ -250,6 +253,17 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req)
250253

251254
debug_event(adapter->hba_dbf, level,
252255
rec, sizeof(struct zfcp_hba_dbf_record));
256+
257+
/* have fcp channel microcode fixed to use as little as possible */
258+
if (fsf_req->fsf_command != FSF_QTCB_FCP_CMND) {
259+
/* adjust length skipping trailing zeros */
260+
char *buf = (char *)qtcb + qtcb->header.log_start;
261+
int len = qtcb->header.log_length;
262+
for (; len && !buf[len - 1]; len--);
263+
zfcp_dbf_hexdump(adapter->hba_dbf, rec, sizeof(*rec), level,
264+
buf, len);
265+
}
266+
253267
spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
254268
}
255269

0 commit comments

Comments
 (0)