summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-08 02:36:56 +0400
committerMark Brown <broonie@linaro.org>2013-10-08 21:03:05 +0400
commit31a2c46cd94c6463b2b57b476e5a0fd154fee439 (patch)
treeb14e24e268f09319f0056bb5b8d4b3fecf354c3c /include/trace
parent56ec1978ff07380bbdc0a942c8779ec9fd9e02ee (diff)
downloadlinux-31a2c46cd94c6463b2b57b476e5a0fd154fee439.tar.xz
spi/trace: Trace length of SPI messages on completion
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/spi.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/trace/events/spi.h b/include/trace/events/spi.h
index a7b09072ce56..5e77e21f885a 100644
--- a/include/trace/events/spi.h
+++ b/include/trace/events/spi.h
@@ -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 */