Fix errors due to lttng.h cleanup
[lttng-tools.git] / liblttngctl / liblttngctl.c
index e400775eaa97a6ffcd983cf4f6cd14da695ec18b..c27ce092825595692b91e4552b250a190dcf486f 100644 (file)
@@ -154,10 +154,99 @@ static int ask_sessiond(enum lttcomm_sessiond_command lct, void **buf)
 
 end:
        lttng_disconnect_sessiond();
-       memset(&lsm, 0, sizeof(lsm));
        return ret;
 }
 
+/*
+ * BEGIN KERNEL CONTROL
+ */
+
+/*
+ *  lttng_kernel_enable_event
+ *
+ *  Enable an event in the kernel tracer.
+ */
+int lttng_kernel_enable_event(char *event_name)
+{
+       strncpy(lsm.u.event.event_name, event_name, NAME_MAX);
+       return ask_sessiond(KERNEL_ENABLE_EVENT, NULL);
+}
+
+/*
+ *  lttng_kernel_disable_event
+ *
+ *  Disable an event in the kernel tracer.
+ */
+int lttng_kernel_disable_event(char *event_name)
+{
+       strncpy(lsm.u.event.event_name, event_name, NAME_MAX);
+       return ask_sessiond(KERNEL_DISABLE_EVENT, NULL);
+}
+
+/*
+ *  lttng_kernel_create_session
+ *
+ *  Create a session in the kernel tracer.
+ */
+int lttng_kernel_create_session(void)
+{
+       return ask_sessiond(KERNEL_CREATE_SESSION, NULL);
+}
+
+/*
+ *  lttng_kernel_create_channel
+ *
+ *  Create a channel in the kernel tracer.
+ */
+int lttng_kernel_create_channel(void)
+{
+       return ask_sessiond(KERNEL_CREATE_CHANNEL, NULL);
+}
+
+/*
+ *  lttng_kernel_open_metadata
+ *
+ *  Open metadata in the kernel tracer.
+ */
+int lttng_kernel_open_metadata(void)
+{
+       return ask_sessiond(KERNEL_OPEN_METADATA, NULL);
+}
+
+/*
+ *  lttng_kernel_create_stream
+ *
+ *  Create stream in the kernel tracer.
+ */
+int lttng_kernel_create_stream(void)
+{
+       return ask_sessiond(KERNEL_CREATE_STREAM, NULL);
+}
+
+/*
+ *  lttng_kernel_start_tracing
+ *
+ *  Start kernel tracing.
+ */
+int lttng_kernel_start_tracing(void)
+{
+       return ask_sessiond(KERNEL_START_TRACE, NULL);
+}
+
+/*
+ *  lttng_kernel_stop_tracing
+ *
+ *  Stop kernel tracing.
+ */
+int lttng_kernel_stop_tracing(void)
+{
+       return ask_sessiond(KERNEL_STOP_TRACE, NULL);
+}
+
+/*
+ * END KERNEL CONTROL
+ */
+
 /*
  *  lttng_get_readable_code
  *
@@ -263,10 +352,9 @@ int lttng_list_traces(uuid_t *uuid, struct lttng_trace **traces)
 /*
  *  lttng_create_session
  *
- *  Create a brand new session using name. Allocate
- *  the session_id param pointing to the UUID.
+ *  Create a brand new session using name.
  */
-int lttng_create_session(char *name, uuid_t *session_id)
+int lttng_create_session(char *name)
 {
        int ret;
 
@@ -278,8 +366,6 @@ int lttng_create_session(char *name, uuid_t *session_id)
                goto end;
        }
 
-       uuid_copy(*session_id, llm.session_uuid);
-
 end:
        return ret;
 }
@@ -502,5 +588,5 @@ end:
 static void __attribute__((constructor)) init()
 {
        /* Set default session group */
-       lttng_set_tracing_group(DEFAULT_TRACING_GROUP);
+       lttng_set_tracing_group(LTTNG_DEFAULT_TRACING_GROUP);
 }
This page took 0.025386 seconds and 5 git commands to generate.