Re: [PATCH v8 16/24] drivers/fsi: Add tracepoints for low-level operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Steven,

Thanks for checking this out.

>> +TRACE_EVENT(fsi_master_write,
>> +	TP_PROTO(const struct fsi_master *master, int link, int id,
>> +			uint32_t addr, size_t size, const void *data),
>> +	TP_ARGS(master, link, id, addr, size, data),
>> +	TP_STRUCT__entry(
>> +		__field(int,	master_idx)
>> +		__field(int,	link)
>> +		__field(int,	id)
>> +		__field(__u32,	addr)
>> +		__field(size_t,	size)
>> +		__field(__u32,	data)
>> +	),
>> +	TP_fast_assign(
>> +		__entry->master_idx = master->idx;
>> +		__entry->link = link;
>> +		__entry->id = id;
>> +		__entry->addr = addr;
>> +		__entry->size = size;
>> +		__entry->data = 0;
>> +		memcpy(&__entry->data, data, size);
> 
> 
> Um, can size ever be greater than 4? If so, this is a bug.

No, size will only ever be 1, 2, or 4, as they're the only valid FSI bus
transactions. Hence storing ->data as a u32 to keep things simple.

> I think you may want to use a dynamic array here.
> 
> 	TP_STRUCT__entry(
> 		[..]
> 		__dynamic_array(char, data, size)
> 	[..]
> 
> 	TP_fast_assign(
> 		[..]
> 		memcpy(__get_dynamic_array(data), data, size);
> 	[..]
> 
> 	TP_printk(...
> 		[..]
> 		__entry->size,
> 		__get_dynamic_array(data)
> 
> You may also want to look at __print_array() too.

The %ph specifier seems to do a decent job though...

Cheers,


Jeremy
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux