Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * NVM Express device driver tracepoints
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (c) 2018 Johannes Thumshirn, SUSE Linux GmbH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <asm/unaligned.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include "trace.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) static const char *nvme_trace_delete_sq(struct trace_seq *p, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 	u16 sqid = get_unaligned_le16(cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 	trace_seq_printf(p, "sqid=%u", sqid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) static const char *nvme_trace_create_sq(struct trace_seq *p, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	u16 sqid = get_unaligned_le16(cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	u16 qsize = get_unaligned_le16(cdw10 + 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	u16 sq_flags = get_unaligned_le16(cdw10 + 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	u16 cqid = get_unaligned_le16(cdw10 + 6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	trace_seq_printf(p, "sqid=%u, qsize=%u, sq_flags=0x%x, cqid=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 			 sqid, qsize, sq_flags, cqid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static const char *nvme_trace_delete_cq(struct trace_seq *p, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	u16 cqid = get_unaligned_le16(cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	trace_seq_printf(p, "cqid=%u", cqid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) static const char *nvme_trace_create_cq(struct trace_seq *p, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	u16 cqid = get_unaligned_le16(cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	u16 qsize = get_unaligned_le16(cdw10 + 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	u16 cq_flags = get_unaligned_le16(cdw10 + 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	u16 irq_vector = get_unaligned_le16(cdw10 + 6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	trace_seq_printf(p, "cqid=%u, qsize=%u, cq_flags=0x%x, irq_vector=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 			 cqid, qsize, cq_flags, irq_vector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) static const char *nvme_trace_admin_identify(struct trace_seq *p, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	u8 cns = cdw10[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	u16 ctrlid = get_unaligned_le16(cdw10 + 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	trace_seq_printf(p, "cns=%u, ctrlid=%u", cns, ctrlid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) static const char *nvme_trace_admin_get_features(struct trace_seq *p,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 						 u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	u8 fid = cdw10[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	u8 sel = cdw10[1] & 0x7;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	u32 cdw11 = get_unaligned_le32(cdw10 + 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	trace_seq_printf(p, "fid=0x%x sel=0x%x cdw11=0x%x", fid, sel, cdw11);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) static const char *nvme_trace_get_lba_status(struct trace_seq *p,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 					     u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	u64 slba = get_unaligned_le64(cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	u32 mndw = get_unaligned_le32(cdw10 + 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	u16 rl = get_unaligned_le16(cdw10 + 12);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	u8 atype = cdw10[15];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	trace_seq_printf(p, "slba=0x%llx, mndw=0x%x, rl=0x%x, atype=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 			slba, mndw, rl, atype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) static const char *nvme_trace_read_write(struct trace_seq *p, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	u64 slba = get_unaligned_le64(cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	u16 length = get_unaligned_le16(cdw10 + 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	u16 control = get_unaligned_le16(cdw10 + 10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	u32 dsmgmt = get_unaligned_le32(cdw10 + 12);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	u32 reftag = get_unaligned_le32(cdw10 +  16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	trace_seq_printf(p,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 			 "slba=%llu, len=%u, ctrl=0x%x, dsmgmt=%u, reftag=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 			 slba, length, control, dsmgmt, reftag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) static const char *nvme_trace_dsm(struct trace_seq *p, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	trace_seq_printf(p, "nr=%u, attributes=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 			 get_unaligned_le32(cdw10),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 			 get_unaligned_le32(cdw10 + 4));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) static const char *nvme_trace_common(struct trace_seq *p, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	trace_seq_printf(p, "cdw10=%*ph", 24, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) const char *nvme_trace_parse_admin_cmd(struct trace_seq *p,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 				       u8 opcode, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	switch (opcode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	case nvme_admin_delete_sq:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		return nvme_trace_delete_sq(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	case nvme_admin_create_sq:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		return nvme_trace_create_sq(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	case nvme_admin_delete_cq:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		return nvme_trace_delete_cq(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	case nvme_admin_create_cq:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		return nvme_trace_create_cq(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	case nvme_admin_identify:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		return nvme_trace_admin_identify(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	case nvme_admin_get_features:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		return nvme_trace_admin_get_features(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	case nvme_admin_get_lba_status:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		return nvme_trace_get_lba_status(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		return nvme_trace_common(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) const char *nvme_trace_parse_nvm_cmd(struct trace_seq *p,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 				     u8 opcode, u8 *cdw10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	switch (opcode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	case nvme_cmd_read:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	case nvme_cmd_write:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	case nvme_cmd_write_zeroes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		return nvme_trace_read_write(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	case nvme_cmd_dsm:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		return nvme_trace_dsm(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		return nvme_trace_common(p, cdw10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) static const char *nvme_trace_fabrics_property_set(struct trace_seq *p, u8 *spc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	u8 attrib = spc[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	u32 ofst = get_unaligned_le32(spc + 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	u64 value = get_unaligned_le64(spc + 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	trace_seq_printf(p, "attrib=%u, ofst=0x%x, value=0x%llx",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 			 attrib, ofst, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) static const char *nvme_trace_fabrics_connect(struct trace_seq *p, u8 *spc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	u16 recfmt = get_unaligned_le16(spc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	u16 qid = get_unaligned_le16(spc + 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	u16 sqsize = get_unaligned_le16(spc + 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	u8 cattr = spc[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	u32 kato = get_unaligned_le32(spc + 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	trace_seq_printf(p, "recfmt=%u, qid=%u, sqsize=%u, cattr=%u, kato=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 			 recfmt, qid, sqsize, cattr, kato);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) static const char *nvme_trace_fabrics_property_get(struct trace_seq *p, u8 *spc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	u8 attrib = spc[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	u32 ofst = get_unaligned_le32(spc + 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	trace_seq_printf(p, "attrib=%u, ofst=0x%x", attrib, ofst);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) static const char *nvme_trace_fabrics_common(struct trace_seq *p, u8 *spc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	trace_seq_printf(p, "specific=%*ph", 24, spc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) const char *nvme_trace_parse_fabrics_cmd(struct trace_seq *p,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		u8 fctype, u8 *spc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	switch (fctype) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	case nvme_fabrics_type_property_set:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 		return nvme_trace_fabrics_property_set(p, spc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	case nvme_fabrics_type_connect:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 		return nvme_trace_fabrics_connect(p, spc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	case nvme_fabrics_type_property_get:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 		return nvme_trace_fabrics_property_get(p, spc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		return nvme_trace_fabrics_common(p, spc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) const char *nvme_trace_disk_name(struct trace_seq *p, char *name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	const char *ret = trace_seq_buffer_ptr(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	if (*name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 		trace_seq_printf(p, "disk=%s, ", name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	trace_seq_putc(p, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) EXPORT_TRACEPOINT_SYMBOL_GPL(nvme_sq);