aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/greybus_trace.h
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2016-06-05 14:03:28 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-06-06 20:50:08 -0700
commit6da7c88972a0153db427c14c6c5b2c4e2ccaefb7 (patch)
tree1f8f06b99758603dcca55cfaf51f5c0c122d97ac /drivers/staging/greybus/greybus_trace.h
parentgreybus: timesync: Bind TimeSync into Greybus (diff)
downloadlinux-dev-6da7c88972a0153db427c14c6c5b2c4e2ccaefb7.tar.xz
linux-dev-6da7c88972a0153db427c14c6c5b2c4e2ccaefb7.zip
greybus: tracepoints: Add standard Linux tracepoint for TimeSync event
This patch adds a tracepoint to the TimeSync ISR, the purpose of which is to indicate a TimeSync event has happened. This tracepoint can be enabled by issuing the following command: echo 1 > /sys/kernel/debug/tracing/events/greybus/gb_timesync_irq/enable Synchronization looks like this: TIMESTAMP FUNCTION | | 147.865788: gb_timesync_irq: strobe 1/4 frame-time 2910076529 147.866781: gb_timesync_irq: strobe 2/4 frame-time 2910095689 147.867777: gb_timesync_irq: strobe 3/4 frame-time 2910114820 147.868791: gb_timesync_irq: strobe 4/4 frame-time 2910134038 A ping can be triggered like this: cat /sys/kernel/debug/greybus/frame-time And that ping looks like this: TIMESTAMP FUNCTION | | 147.934678: gb_timesync_irq: ping 4/4 frame-time 2911380356 169.280551: gb_timesync_irq: ping 4/4 frame-time 3321221069 Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Acked-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/greybus_trace.h')
-rw-r--r--drivers/staging/greybus/greybus_trace.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/staging/greybus/greybus_trace.h b/drivers/staging/greybus/greybus_trace.h
index 342f5adb6708..7249b8aba583 100644
--- a/drivers/staging/greybus/greybus_trace.h
+++ b/drivers/staging/greybus/greybus_trace.h
@@ -488,6 +488,34 @@ DEFINE_HD_EVENT(gb_hd_in);
#undef DEFINE_HD_EVENT
+/*
+ * Occurs on a TimeSync synchronization event or a TimeSync ping event.
+ */
+TRACE_EVENT(gb_timesync_irq,
+
+ TP_PROTO(u8 ping, u8 strobe, u8 count, u64 frame_time),
+
+ TP_ARGS(ping, strobe, count, frame_time),
+
+ TP_STRUCT__entry(
+ __field(u8, ping)
+ __field(u8, strobe)
+ __field(u8, count)
+ __field(u64, frame_time)
+ ),
+
+ TP_fast_assign(
+ __entry->ping = ping;
+ __entry->strobe = strobe;
+ __entry->count = count;
+ __entry->frame_time = frame_time;
+ ),
+
+ TP_printk("%s %d/%d frame-time %llu\n",
+ __entry->ping ? "ping" : "strobe", __entry->strobe,
+ __entry->count, __entry->frame_time)
+);
+
#endif /* _TRACE_GREYBUS_H */
/* This part must be outside protection */