spi/trace: Trace length of SPI messages on completion
authorMark Brown <broonie@linaro.org>
Mon, 7 Oct 2013 22:36:56 +0000 (23:36 +0100)
committerMark Brown <broonie@linaro.org>
Tue, 8 Oct 2013 17:03:05 +0000 (18:03 +0100)
Signed-off-by: Mark Brown <broonie@linaro.org>
include/trace/events/spi.h

index a7b09072ce56375fe42cdb379af7282e5bc7d5dc..5e77e21f885a6bf4c79747fc4648b3afad150f25 100644 (file)
@@ -80,12 +80,32 @@ DEFINE_EVENT(spi_message, spi_message_start,
 
 );
 
-DEFINE_EVENT(spi_message, spi_message_done,
+TRACE_EVENT(spi_message_done,
 
        TP_PROTO(struct spi_message *msg),
 
-       TP_ARGS(msg)
+       TP_ARGS(msg),
+
+       TP_STRUCT__entry(
+               __field(        int,            bus_num         )
+               __field(        int,            chip_select     )
+               __field(        struct spi_message *,   msg     )
+               __field(        unsigned,       frame           )
+               __field(        unsigned,       actual          )
+       ),
 
+       TP_fast_assign(
+               __entry->bus_num = msg->spi->master->bus_num;
+               __entry->chip_select = msg->spi->chip_select;
+               __entry->msg = msg;
+               __entry->frame = msg->frame_length;
+               __entry->actual = msg->actual_length;
+       ),
+
+        TP_printk("spi%d.%d %p len=%u/%u", (int)__entry->bus_num,
+                 (int)__entry->chip_select,
+                 (struct spi_message *)__entry->msg,
+                  (unsigned)__entry->actual, (unsigned)__entry->frame)
 );
 
 #endif /* _TRACE_POWER_H */
This page took 0.024797 seconds and 5 git commands to generate.