+const char *print_loglevel(int value)
+{
+ switch (value) {
+ case -1:
+ return "";
+ case BT_LOGLEVEL_EMERG:
+ return "TRACE_EMERG";
+ case BT_LOGLEVEL_ALERT:
+ return "TRACE_ALERT";
+ case BT_LOGLEVEL_CRIT:
+ return "TRACE_CRIT";
+ case BT_LOGLEVEL_ERR:
+ return "TRACE_ERR";
+ case BT_LOGLEVEL_WARNING:
+ return "TRACE_WARNING";
+ case BT_LOGLEVEL_NOTICE:
+ return "TRACE_NOTICE";
+ case BT_LOGLEVEL_INFO:
+ return "TRACE_INFO";
+ case BT_LOGLEVEL_DEBUG_SYSTEM:
+ return "TRACE_DEBUG_SYSTEM";
+ case BT_LOGLEVEL_DEBUG_PROGRAM:
+ return "TRACE_DEBUG_PROGRAM";
+ case BT_LOGLEVEL_DEBUG_PROCESS:
+ return "TRACE_DEBUG_PROCESS";
+ case BT_LOGLEVEL_DEBUG_MODULE:
+ return "TRACE_DEBUG_MODULE";
+ case BT_LOGLEVEL_DEBUG_UNIT:
+ return "TRACE_DEBUG_UNIT";
+ case BT_LOGLEVEL_DEBUG_FUNCTION:
+ return "TRACE_DEBUG_FUNCTION";
+ case BT_LOGLEVEL_DEBUG_LINE:
+ return "TRACE_DEBUG_LINE";
+ case BT_LOGLEVEL_DEBUG:
+ return "TRACE_DEBUG";
+ default:
+ return "<<UNKNOWN>>";
+ }
+}
+
+static
+int ctf_text_write_event(struct stream_pos *ppos, struct ctf_stream_definition *stream)
+