#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 */
#include <linux/debugfs.h>
#include "greybus.h"
#include "timesync.h"
+#include "greybus_trace.h"
/*
* Minimum inter-strobe value of one millisecond is chosen because it
{
unsigned long flags;
u64 strobe_time;
+ bool strobe_is_ping = true;
strobe_time = __gb_timesync_get_frame_time(timesync_svc);
spin_lock_irqsave(×ync_svc->spinlock, flags);
if (timesync_svc->state == GB_TIMESYNC_STATE_PING) {
- if (timesync_svc->capture_ping)
- timesync_svc->ap_ping_frame_time = strobe_time;
- goto done;
+ if (!timesync_svc->capture_ping)
+ goto done_nolog;
+ timesync_svc->ap_ping_frame_time = strobe_time;
+ goto done_log;
} else if (timesync_svc->state != GB_TIMESYNC_STATE_WAIT_SVC) {
- goto done;
+ goto done_nolog;
}
timesync_svc->strobe_time[timesync_svc->strobe] = strobe_time;
gb_timesync_set_state(timesync_svc,
GB_TIMESYNC_STATE_AUTHORITATIVE);
}
-done:
+ strobe_is_ping = false;
+done_log:
+ trace_gb_timesync_irq(strobe_is_ping, timesync_svc->strobe,
+ GB_TIMESYNC_MAX_STROBES, strobe_time);
+done_nolog:
spin_unlock_irqrestore(×ync_svc->spinlock, flags);
}
EXPORT_SYMBOL(gb_timesync_irq);