Support creds passing between lttng and sessiond
[lttng-tools.git] / liblttngctl / lttngctl.c
index 48e82def7570ef225c6b83de8f3962fe858c6c7f..c65760155347d4ca7e576ea7b24132b580d47e7f 100644 (file)
@@ -93,7 +93,7 @@ static int send_session_msg(struct lttcomm_session_msg *lsm)
                goto end;
        }
 
-       ret = lttcomm_send_unix_sock(sessiond_socket, lsm,
+       ret = lttcomm_send_creds_unix_sock(sessiond_socket, lsm,
                        sizeof(struct lttcomm_session_msg));
 
 end:
@@ -425,17 +425,17 @@ int lttng_register_consumer(struct lttng_handle *handle,
 /*
  *  Start tracing for all trace of the session.
  */
-int lttng_start_tracing(struct lttng_handle *handle)
+int lttng_start_tracing(const char *session_name)
 {
        struct lttcomm_session_msg lsm;
 
-       if (handle == NULL) {
+       if (session_name == NULL) {
                return -1;
        }
 
        lsm.cmd_type = LTTNG_START_TRACE;
-       copy_string(lsm.session.name, handle->session_name,
-                       sizeof(lsm.session.name));
+
+       copy_string(lsm.session.name, session_name, sizeof(lsm.session.name));
 
        return ask_sessiond(&lsm, NULL);
 }
@@ -443,13 +443,17 @@ int lttng_start_tracing(struct lttng_handle *handle)
 /*
  *  Stop tracing for all trace of the session.
  */
-int lttng_stop_tracing(struct lttng_handle *handle)
+int lttng_stop_tracing(const char *session_name)
 {
        struct lttcomm_session_msg lsm;
 
+       if (session_name == NULL) {
+               return -1;
+       }
+
        lsm.cmd_type = LTTNG_STOP_TRACE;
-       copy_string(lsm.session.name, handle->session_name,
-                       sizeof(lsm.session.name));
+
+       copy_string(lsm.session.name, session_name, sizeof(lsm.session.name));
 
        return ask_sessiond(&lsm, NULL);
 }
@@ -704,20 +708,19 @@ int lttng_list_sessions(struct lttng_session **sessions)
 /*
  * List domain of a session.
  */
-int lttng_list_domains(struct lttng_handle *handle,
+int lttng_list_domains(const char *session_name,
                struct lttng_domain **domains)
 {
        int ret;
        struct lttcomm_session_msg lsm;
 
-       if (handle == NULL) {
+       if (session_name == NULL) {
                return -1;
        }
 
        lsm.cmd_type = LTTNG_LIST_DOMAINS;
 
-       copy_string(lsm.session.name, handle->session_name,
-                       sizeof(lsm.session.name));
+       copy_string(lsm.session.name, session_name, sizeof(lsm.session.name));
 
        ret = ask_sessiond(&lsm, (void**) domains);
        if (ret < 0) {
This page took 0.024044 seconds and 4 git commands to generate.