+static
+const char *print_channel_name(const char *name)
+{
+ return name ? : DEFAULT_CHANNEL_NAME;
+}
+
+static
+const char *print_raw_channel_name(const char *name)
+{
+ return name ? : "<default>";
+}
+
+/* Mi print a partial event.
+ * enabled is 0 or 1
+ * success is 0 or 1
+ */
+static int mi_print_event(char *event_name, int enabled, int success)
+{
+ int ret;
+
+ assert(writer);
+ assert(event_name);
+
+ /* Open event element */
+ ret = mi_lttng_writer_open_element(writer, config_element_event);
+ if (ret) {
+ goto end;
+ }
+
+ /* Print the name of event */
+ ret = mi_lttng_writer_write_element_string(writer,
+ config_element_name, event_name);
+ if (ret) {
+ goto end;
+ }
+
+ /* Print enabled ? */
+ ret = mi_lttng_writer_write_element_bool(writer,
+ config_element_enabled, enabled);
+ if (ret) {
+ goto end;
+ }
+
+ /* Success ? */
+ ret = mi_lttng_writer_write_element_bool(writer,
+ mi_lttng_element_command_success, success);
+ if (ret) {
+ goto end;
+ }
+
+ /* Close event element */
+ ret = mi_lttng_writer_close_element(writer);
+end:
+ return ret;
+}
+