X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=liblttngctl%2Flttngctl.c;h=ed685966ee43c606e11d60669a4e8f20ccfba9a7;hb=6a4f824d3317497f00cd7065ab9905fbb86ea58f;hp=9c3735f38f9a2896b2f4e0d611adef2a682e76ca;hpb=9d697d3d9ce4cf53fe9102bf7d7b44d196f46eca;p=lttng-tools.git diff --git a/liblttngctl/lttngctl.c b/liblttngctl/lttngctl.c index 9c3735f38..ed685966e 100644 --- a/liblttngctl/lttngctl.c +++ b/liblttngctl/lttngctl.c @@ -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); } @@ -666,17 +670,17 @@ int lttng_create_session(const char *name, const char *path) /* * Destroy session using name. */ -int lttng_destroy_session(struct lttng_handle *handle) +int lttng_destroy_session(const char *session_name) { struct lttcomm_session_msg lsm; - if (handle == NULL) { + if (session_name == NULL) { return -1; } lsm.cmd_type = LTTNG_DESTROY_SESSION; - 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); }