[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4441a1ba-e66e-368a-cc07-8e3859dc8c13@ozlabs.org>
Date: Thu, 8 Jun 2017 10:06:16 +0800
From: Jeremy Kerr <jk@...abs.org>
To: Steven Rostedt <rostedt@...dmis.org>,
Christopher Bostic <cbostic@...ux.vnet.ibm.com>
Cc: robh+dt@...nel.org, mark.rutland@....com, linux@...linux.org.uk,
mingo@...hat.com, gregkh@...uxfoundation.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
joel@....id.au, linux-kernel@...r.kernel.org, andrew@...id.au,
alistair@...ple.id.au, benh@...nel.crashing.org
Subject: Re: [PATCH v8 16/24] drivers/fsi: Add tracepoints for low-level
operations
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
Powered by blists - more mailing lists