[PATCH v2 1/2] nvmet: add tracing of zns commands

Guixin Liu kanie at linux.alibaba.com
Wed Feb 28 00:33:52 PST 2024


在 2024/2/28 13:25, Chaitanya Kulkarni 写道:
> On 2/27/24 18:31, Guixin Liu wrote:
>> Add nvme_cmd_zone_append, nvme_cmd_zone_mgmt_send and
>> nvme_cmd_zone_mgmt_recv parse to nvme target tracing.
>>
>> Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
>> ---
>>    drivers/nvme/target/trace.c | 34 ++++++++++++++++++++++++++++++++++
>>    1 file changed, 34 insertions(+)
>>
>> diff --git a/drivers/nvme/target/trace.c b/drivers/nvme/target/trace.c
>> index 657bd31841b2..6604e5fe57d8 100644
>> --- a/drivers/nvme/target/trace.c
>> +++ b/drivers/nvme/target/trace.c
>> @@ -119,6 +119,35 @@ const char *nvmet_trace_parse_admin_cmd(struct trace_seq *p,
>>    	}
>>    }
>>    
>> +static const char *nvmet_trace_zone_mgmt_send(struct trace_seq *p, u8 *cdw10)
>> +{
>> +	const char *ret = trace_seq_buffer_ptr(p);
>> +	u64 slba = get_unaligned_le64(cdw10);
>> +	u8 zsa = cdw10[12];
>> +	u8 all = cdw10[13];
>> +
>> +	trace_seq_printf(p, "slba=%llu, zsa=%u, all=%u", slba, zsa, all);
>> +	trace_seq_putc(p, 0);
>> +
>> +	return ret;
>> +}
>> +
>> +static const char *nvmet_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
>> +{
>> +	const char *ret = trace_seq_buffer_ptr(p);
>> +	u64 slba = get_unaligned_le64(cdw10);
>> +	u32 numd = get_unaligned_le32(cdw10 + 8);
> please use consistent notation :- &cdw10[8]
It will be changed in v3.
>> +	u8 zra = cdw10[12];
>> +	u8 zrasf = cdw10[13];
> why not decode zrasf values 0h-9h to make it more readable ?
> printing number only will make a trip to the spec since I don't think
> everyone will remember those values all the time , more importantly
> this will also help in testing to grep for right string when using zrasf.
>
> same goes for zsa I guess above ...

Agree, I will translate zrasf and zsa to a readble string, and print them.

Best Regards,

Guixin Liu

>



More information about the Linux-nvme mailing list