Re: [PATCHv2 4/4] nvme: add disk name to tracepoints

Christoph Hellwig
2018-06-29T08:00:06Z

> +const char *nvme_trace_disk_name(struct trace_seq *p, char *name)
> +{
> + const char *ret = trace_seq_buffer_ptr(p);
> +
> + if (name[0] != 0)
> + trace_seq_printf(p, "disk=%-.*s, ", DISK_NAME_LEN, name);

if (*name)
trace_seq_printf(p, "disk=%-.*s, ", DISK_NAME_LEN, name);

?

> + req->rq_disk ?
> + memcpy(__entry->disk, req->rq_disk->disk_name, DISK_NAME_LEN) :
> + memset(__entry->disk, 0, DISK_NAME_LEN);

Make this a helper please.