summaryrefslogtreecommitdiff
path: root/cesar/hal/leon/maximus/src/maximus_trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/hal/leon/maximus/src/maximus_trace.c')
-rw-r--r--cesar/hal/leon/maximus/src/maximus_trace.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/cesar/hal/leon/maximus/src/maximus_trace.c b/cesar/hal/leon/maximus/src/maximus_trace.c
new file mode 100644
index 0000000000..28ee4d13f7
--- /dev/null
+++ b/cesar/hal/leon/maximus/src/maximus_trace.c
@@ -0,0 +1,42 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file hal/leon/maximus/src/maximus_trace.c
+ * \brief Define leon timer trace events.
+ * \ingroup hal_leon_maximus
+ */
+#include "common/std.h"
+
+#include "inc/maximus_timer_ctx.h"
+
+void
+maximus_leon_timer_trace_init (leon_timer_t *ctx)
+{
+ static trace_namespace_t namespace;
+ static const trace_event_id_t event_ids[] =
+ {
+ TRACE_EVENT (MAXIMUS_LEON_TIMER_TRACE_INIT, "init"),
+ TRACE_EVENT (MAXIMUS_LEON_TIMER_TRACE_UNINIT, "uninit"),
+ TRACE_EVENT (MAXIMUS_LEON_TIMER_TRACE_LEON_TIMER_PROGRAM,
+ "leon timer program %x"),
+ TRACE_EVENT (MAXIMUS_LEON_TIMER_TRACE_LEON_TIMER_CANCEL, "leon timer cancel"),
+ TRACE_EVENT (MAXIMUS_LEON_TIMER_TRACE_DEFERRED_CB, "deferred cb"),
+ TRACE_EVENT (MAXIMUS_LEON_TIMER_TRACE_LEON_TIMER_CB, "leon timer cb"),
+ };
+ dbg_assert (ctx);
+ trace_namespace_init (&namespace, event_ids, COUNT (event_ids));
+ trace_buffer_add (&ctx->trace, "leon timer", 8, 4, true, &namespace);
+}
+
+void
+maximus_leon_timer_trace_uninit (leon_timer_t *ctx)
+{
+ dbg_assert (ctx);
+ trace_buffer_remove (&ctx->trace);
+}
+