summaryrefslogtreecommitdiffstats
path: root/drivers/siox
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2017-12-19 04:00:12 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-19 04:56:24 -0500
commit297a344d5238c049fdc234c34dd7bb0d83f01271 (patch)
treeb38944b4c7caa25b132bd4f7f9325202b28717fb /drivers/siox
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 'drivers/siox')
-rw-r--r--drivers/siox/siox-core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/siox/siox-core.c b/drivers/siox/siox-core.c
index 16585c1b2b9e..fdfcdea25867 100644
--- a/drivers/siox/siox-core.c
+++ b/drivers/siox/siox-core.c
@@ -33,6 +33,9 @@
33 */ 33 */
34#define SIOX_STATUS_TYPE 0xf0 34#define SIOX_STATUS_TYPE 0xf0
35 35
36#define CREATE_TRACE_POINTS
37#include <trace/events/siox.h>
38
36static bool siox_is_registered; 39static bool siox_is_registered;
37 40
38static void siox_master_lock(struct siox_master *smaster) 41static void siox_master_lock(struct siox_master *smaster)
@@ -126,6 +129,7 @@ static void siox_poll(struct siox_master *smaster)
126{ 129{
127 struct siox_device *sdevice; 130 struct siox_device *sdevice;
128 size_t i = smaster->setbuf_len; 131 size_t i = smaster->setbuf_len;
132 unsigned int devno = 0;
129 int unsync_error = 0; 133 int unsync_error = 0;
130 134
131 smaster->last_poll = jiffies; 135 smaster->last_poll = jiffies;
@@ -172,6 +176,10 @@ static void siox_poll(struct siox_master *smaster)
172 sdevice->status_written &= ~SIOX_STATUS_WDG; 176 sdevice->status_written &= ~SIOX_STATUS_WDG;
173 177
174 smaster->buf[i] = sdevice->status_written; 178 smaster->buf[i] = sdevice->status_written;
179
180 trace_siox_set_data(smaster, sdevice, devno, i);
181
182 devno++;
175 } 183 }
176 184
177 smaster->pushpull(smaster, smaster->setbuf_len, smaster->buf, 185 smaster->pushpull(smaster, smaster->setbuf_len, smaster->buf,
@@ -181,6 +189,7 @@ static void siox_poll(struct siox_master *smaster)
181 unsync_error = 0; 189 unsync_error = 0;
182 190
183 /* interpret data pulled in from devices in buf[setbuf_len..] */ 191 /* interpret data pulled in from devices in buf[setbuf_len..] */
192 devno = 0;
184 i = smaster->setbuf_len; 193 i = smaster->setbuf_len;
185 list_for_each_entry(sdevice, &smaster->devices, node) { 194 list_for_each_entry(sdevice, &smaster->devices, node) {
186 struct siox_driver *sdriver = 195 struct siox_driver *sdriver =
@@ -255,10 +264,13 @@ static void siox_poll(struct siox_master *smaster)
255 sdevice->status_written_lastcycle = sdevice->status_written; 264 sdevice->status_written_lastcycle = sdevice->status_written;
256 sdevice->connected = connected; 265 sdevice->connected = connected;
257 266
267 trace_siox_get_data(smaster, sdevice, devno, status_clean, i);
268
258 /* only give data read to driver if the device is connected */ 269 /* only give data read to driver if the device is connected */
259 if (sdriver && connected) 270 if (sdriver && connected)
260 sdriver->get_data(sdevice, &smaster->buf[i]); 271 sdriver->get_data(sdevice, &smaster->buf[i]);
261 272
273 devno++;
262 i += sdevice->outbytes; 274 i += sdevice->outbytes;
263 } 275 }
264} 276}