summaryrefslogtreecommitdiff
path: root/cesar/hle/inc/trace.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/hle/inc/trace.h')
-rw-r--r--cesar/hle/inc/trace.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/cesar/hle/inc/trace.h b/cesar/hle/inc/trace.h
new file mode 100644
index 0000000000..063bf907d9
--- /dev/null
+++ b/cesar/hle/inc/trace.h
@@ -0,0 +1,73 @@
+#ifndef hle_inc_trace_h
+#define hle_inc_trace_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file hle/inc/trace.h
+ * \brief trace system for the HLE.
+ * \ingroup hle
+ *
+ */
+
+#include "lib/trace.h"
+
+/** Shortcut for tracing inside the HLE. */
+#define HLE_TRACE(id, args...)\
+ TRACE_FAST_SHORT(HLE_TRACE_, &ctx->trace, id, ## args)
+
+#if CONFIG_TRACE
+
+enum
+{
+ HLE_TRACE_INIT,
+ HLE_TRACE_UNINIT,
+ HLE_TRACE_DATA_SEND,
+ HLE_TRACE_DATA_SEND_DONE,
+ HLE_TRACE_DATA_BUFFER_ADD,
+ HLE_TRACE_DATA_RECV,
+ HLE_TRACE_MME_BUFFER_ADD,
+ HLE_TRACE_MME_SEND,
+ HLE_TRACE_MME_SEND_DONE,
+ HLE_TRACE_MME_RECV,
+ HLE_TRACE_IPMBOX
+};
+
+BEGIN_DECLS
+
+/**
+ * Initialize the trace buffer
+ * \param ctx the hle context.
+ */
+void
+hle_trace_init (hle_t *ctx);
+
+/**
+ * Uninit the trace buffer
+ * \param ctx the hle context
+ */
+void
+hle_trace_uninit (hle_t *ctx);
+
+/**
+ * Print the trace buffers
+ * \param ctx the hle context
+ */
+void
+hle_trace_print (hle_t *ctx);
+
+END_DECLS
+
+#else /* !CONFIG_TRACE */
+
+#define hle_trace_init(ctx) ((void) 0)
+#define hle_trace_uninit(ctx) ((void) 0)
+#define hle_trace_print(ctx) ((void) 0)
+
+#endif /* !CONFIG_TRACE */
+
+#endif /* hle_inc_trace_h */