提交 c15450e3 编写于 作者: M Martin Peschke 提交者: James Bottomley

[SCSI] zfcp: Introduce a helper function that dumps hex data to a zfcp trace.

Signed-off-by: NMartin Peschke <mp3@de.ibm.com>
Signed-off-by: NChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 d5cdc989
......@@ -31,6 +31,24 @@ MODULE_PARM_DESC(dbfsize,
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len,
int level, char *from, int from_len)
{
int offset;
struct zfcp_dbf_dump *dump = to;
int room = to_len - sizeof(*dump);
for (offset = 0; offset < from_len; offset += dump->size) {
memset(to, 0, to_len);
strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
dump->total_size = from_len;
dump->offset = offset;
dump->size = min(from_len - offset, room);
memcpy(dump->data, from + offset, dump->size);
debug_event(dbf, level, dump, dump->size);
}
}
static int
zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册