- fprintf(ofp, "usage: lttng disable-channel NAME[,NAME2,...] [options]\n");
- fprintf(ofp, "\n");
- fprintf(ofp, " -h, --help Show this help\n");
- fprintf(ofp, " --list-options Simple listing of options\n");
- fprintf(ofp, " -s, --session Apply to session name\n");
- fprintf(ofp, " -k, --kernel Apply to the kernel tracer\n");
-#if 0
- fprintf(ofp, " -u, --userspace [CMD] Apply to the user-space tracer\n");
- fprintf(ofp, " If no CMD, the domain used is UST global\n");
- fprintf(ofp, " or else the domain is UST EXEC_NAME\n");
- fprintf(ofp, " -p, --pid PID If -u, apply to specific PID (domain: UST PID)\n");
-#else
- fprintf(ofp, " -u, --userspace Apply to the user-space tracer\n");
-#endif
- fprintf(ofp, "\n");
+ int ret;
+
+ assert(writer);
+ assert(channel_name);
+
+ /* Open channel element */
+ ret = mi_lttng_writer_open_element(writer, config_element_channel);
+ if (ret) {
+ goto end;
+ }
+
+ /* Name */
+ ret = mi_lttng_writer_write_element_string(writer, config_element_name,
+ channel_name);
+ if (ret) {
+ goto end;
+ }
+
+ /* 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_success, success);
+ if (ret) {
+ goto end;
+ }
+
+ /* Closing channel element */
+ ret = mi_lttng_writer_close_element(writer);
+
+end:
+ return ret;