/*
* 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);
}
/*
* 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);
}