Permit custom consumer registration to a session
[lttng-tools.git] / liblttngctl / lttngctl.c
index 827de137e550ef33de57de09f0d823079d2fd513..51f5f6572e1a87da43400a439701efef1ca1d333 100644 (file)
@@ -333,6 +333,24 @@ void lttng_destroy_handle(struct lttng_handle *handle)
        }
 }
 
+/*
+ * Register an outside consumer.
+ */
+int lttng_register_consumer(struct lttng_handle *handle,
+               const char *socket_path)
+{
+       struct lttcomm_session_msg lsm;
+
+       lsm.cmd_type = LTTNG_REGISTER_CONSUMER;
+       copy_string(lsm.session.name, handle->session_name,
+                       sizeof(lsm.session.name));
+       copy_lttng_domain(&lsm.domain, &handle->domain);
+
+       copy_string(lsm.u.reg.path, socket_path, sizeof(lsm.u.reg.path));
+
+       return ask_sessiond(&lsm, NULL);
+}
+
 /*
  *  Start tracing for all trace of the session.
  */
This page took 0.023388 seconds and 4 git commands to generate.