summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2017-12-19 10:00:12 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-19 10:56:24 +0100
commit297a344d5238c049fdc234c34dd7bb0d83f01271 (patch)
treeb38944b4c7caa25b132bd4f7f9325202b28717fb /include/trace
parent658a494a5b793ab19575f6825cd3f01ce662b0c6 (diff)
siox: add support for tracing
Implement tracing for SIOX. There are events for the data that is written to the bus and for data being read from it. Acked-by: Gavin Schenk <g.schenk@eckelmann.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/siox.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/include/trace/events/siox.h b/include/trace/events/siox.h
new file mode 100644
index 000000000000..68a43fc2c3a5
--- /dev/null
+++ b/include/trace/events/siox.h
@@ -0,0 +1,66 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM siox
+
+#if !defined(_TRACE_SIOX_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_SIOX_H
+
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(siox_set_data,
+ TP_PROTO(const struct siox_master *smaster,
+ const struct siox_device *sdevice,
+ unsigned int devno, size_t bufoffset),
+ TP_ARGS(smaster, sdevice, devno, bufoffset),
+ TP_STRUCT__entry(
+ __field(int, busno)
+ __field(unsigned int, devno)
+ __field(size_t, inbytes)
+ __dynamic_array(u8, buf, sdevice->inbytes)
+ ),
+ TP_fast_assign(
+ __entry->busno = smaster->busno;
+ __entry->devno = devno;
+ __entry->inbytes = sdevice->inbytes;
+ memcpy(__get_dynamic_array(buf),
+ smaster->buf + bufoffset, sdevice->inbytes);
+ ),
+ TP_printk("siox-%d-%u [%*phD]",
+ __entry->busno,
+ __entry->devno,
+ (int)__entry->inbytes, __get_dynamic_array(buf)
+ )
+);
+
+TRACE_EVENT(siox_get_data,
+ TP_PROTO(const struct siox_master *smaster,
+ const struct siox_device *sdevice,
+ unsigned int devno, u8 status_clean,
+ size_t bufoffset),
+ TP_ARGS(smaster, sdevice, devno, status_clean, bufoffset),
+ TP_STRUCT__entry(
+ __field(int, busno)
+ __field(unsigned int, devno)
+ __field(u8, status_clean)
+ __field(size_t, outbytes)
+ __dynamic_array(u8, buf, sdevice->outbytes)
+ ),
+ TP_fast_assign(
+ __entry->busno = smaster->busno;
+ __entry->devno = devno;
+ __entry->status_clean = status_clean;
+ __entry->outbytes = sdevice->outbytes;
+ memcpy(__get_dynamic_array(buf),
+ smaster->buf + bufoffset, sdevice->outbytes);
+ ),
+ TP_printk("siox-%d-%u (%02hhx) [%*phD]",
+ __entry->busno,
+ __entry->devno,
+ __entry->status_clean,
+ (int)__entry->outbytes, __get_dynamic_array(buf)
+ )
+);
+
+#endif /* if !defined(_TRACE_SIOX_H) || defined(TRACE_HEADER_MULTI_READ) */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>