summaryrefslogtreecommitdiff
path: root/cesar/bsu/inc
diff options
context:
space:
mode:
authorlaranjeiro2010-05-17 10:02:54 +0000
committerlaranjeiro2010-05-17 10:02:54 +0000
commit5e6a35b04b55263b5c69e3a8ebda4eda18803bfd (patch)
treeeb0ec80d027e66ded7868603bd4217958f00243d /cesar/bsu/inc
parent508f437388a77866f85453bbbd5efa096897bd1e (diff)
cesar/bsu: add trace
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7073 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/bsu/inc')
-rw-r--r--cesar/bsu/inc/context.h5
-rw-r--r--cesar/bsu/inc/trace.h62
2 files changed, 67 insertions, 0 deletions
diff --git a/cesar/bsu/inc/context.h b/cesar/bsu/inc/context.h
index 8c11d49e43..a0146eeea4 100644
--- a/cesar/bsu/inc/context.h
+++ b/cesar/bsu/inc/context.h
@@ -16,6 +16,7 @@
#include "bsu/bsu.h"
#include "bsu/ntb/ntb_sync.h"
#include "bsu/beacon/beacon.h"
+#include "bsu/inc/trace.h"
/** Number of foreign AVLNs handled. */
#define BSU_FOREIGN_AVLNS_NB (HPAV_AVLNS_NB_MAX - 1)
@@ -85,6 +86,10 @@ struct bsu_t
hal_timer_instance_t timer;
/** Activated status. */
bool activate;
+#if CONFIG_TRACE
+ /** Trace system. */
+ trace_buffer_t trace;
+#endif /* !CONFIG_TRACE */
};
#endif /* bsu_inc_context_h */
diff --git a/cesar/bsu/inc/trace.h b/cesar/bsu/inc/trace.h
new file mode 100644
index 0000000000..5fcf68d28e
--- /dev/null
+++ b/cesar/bsu/inc/trace.h
@@ -0,0 +1,62 @@
+#ifndef bsu_inc_trace_h
+#define bsu_inc_trace_h
+/* Cebsu project {{{
+ *
+ * Copyright (C) 2010 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file bsu/inc/trace.h
+ * \brief Trace system
+ * \ingroup bsu
+ */
+#include "lib/trace.h"
+#include "bsu/bsu.h"
+
+/** Shortcut for tracing inside SAR. */
+#define BSU_TRACE(id, args...) \
+ TRACE_FAST_SHORT (BSU_TRACE_, &ctx->trace, id, ## args)
+
+#if CONFIG_TRACE
+
+enum
+{
+ BSU_TRACE_SCHEDULES,
+};
+
+BEGIN_DECLS
+
+/**
+ * Initialize the trace system
+ * \param ctx the bsu context.
+ */
+void
+bsu_trace_init (bsu_t *ctx);
+
+/**
+ * Uninitialize the trace system
+ * \param ctx the bsu context
+ */
+void
+bsu_trace_uninit (bsu_t *ctx);
+
+/**
+ * Print the traces
+ * \param ctx the bsu context.
+ */
+void
+bsu_trace_print (bsu_t *bsu);
+
+END_DECLS
+
+#else /* !CONFIG_TRACE */
+
+#define bsu_trace_init(ctx) ((void) 0)
+#define bsu_trace_uninit(ctx) ((void) 0)
+#define bsu_trace_print(ctx) ((void) 0)
+
+#endif /* !CONFIG_TRACE */
+
+#endif /* bsu_inc_trace_h */