summaryrefslogtreecommitdiff
path: root/cesar/lib/trace.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/lib/trace.h')
-rw-r--r--cesar/lib/trace.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/cesar/lib/trace.h b/cesar/lib/trace.h
index 10da874ddf..fd8debaca8 100644
--- a/cesar/lib/trace.h
+++ b/cesar/lib/trace.h
@@ -175,7 +175,8 @@ struct trace_namespace_t
* \param text_size size of text to write, i.e. number of characters
* \return should return size, any other value will stop dump
*/
-typedef int (*trace_dump_callback_t) (void *user, char *text, uint text_size);
+typedef int (*trace_dump_callback_t) (void *user, const char *text,
+ uint text_size);
BEGIN_DECLS
@@ -283,6 +284,38 @@ int
trace_buffer_dump (trace_buffer_t *buf, trace_dump_callback_t cb, void *user);
/**
+ * Start a text trace bundle.
+ * \param name bundle name, may be NULL for no name
+ * \param cb callback called several times with text data
+ * \param user user data passed to the callback
+ * \return number of character written or -1 on any error (if one callback
+ * did not return its size parameter)
+ */
+int
+trace_bundle_start (const char *name, trace_dump_callback_t cb, void *user);
+
+/**
+ * Stop a text trace bundle.
+ * \param cb callback called several times with text data
+ * \param user user data passed to the callback
+ * \return number of character written or -1 on any error (if one callback
+ * did not return its size parameter)
+ */
+int
+trace_bundle_stop (trace_dump_callback_t cb, void *user);
+
+/**
+ * Dump all trace buffers as a text trace bundle.
+ * \param name bundle name, may be NULL for no name
+ * \param cb callback called several times with text data
+ * \param user user data passed to the callback
+ * \return number of character written or -1 on any error (if one callback
+ * did not return its size parameter)
+ */
+int
+trace_bundle_dump_all (const char *name, trace_dump_callback_t cb, void *user);
+
+/**
* Dump a full trace buffer as text during debug.
* \param buf trace buffer
*
@@ -292,6 +325,12 @@ void
trace_buffer_dbg_dump (trace_buffer_t *buf);
/**
+ * Dump all trace buffer as a text bundle during debug.
+ */
+void
+trace_dbg_dump_all (void);
+
+/**
* Write event to trace buffer.
* \param buf the trace buffer to write to
* \param id event identifier