X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=liblttngctl%2Fliblttngctl.c;h=bd02a13b2c451fad17d6b0612472bba7b5652023;hb=ee0326c0c46f4b02e9eab0b2917b62d2c55aa346;hp=a586b34f53a61d2ba6dd630204325d1f71a31835;hpb=df0da1392bb6c77fff7fc65be518dce7de457ed7;p=lttng-tools.git diff --git a/liblttngctl/liblttngctl.c b/liblttngctl/liblttngctl.c index a586b34f5..bd02a13b2 100644 --- a/liblttngctl/liblttngctl.c +++ b/liblttngctl/liblttngctl.c @@ -167,6 +167,36 @@ const char *lttng_get_readable_code(int code) return lttcomm_get_readable_code(code); } +/* + * lttng_ust_start_trace + * + * Request a trace start for pid. + */ +int lttng_ust_start_trace(pid_t pid) +{ + int ret; + + lsm.pid = pid; + ret = ask_sessiond(UST_START_TRACE, NULL); + + return ret; +} + +/* + * lttng_ust_stop_trace + * + * Request a trace stop for pid. + */ +int lttng_ust_stop_trace(pid_t pid) +{ + int ret; + + lsm.pid = pid; + ret = ask_sessiond(UST_STOP_TRACE, NULL); + + return ret; +} + /* * lttng_ust_create_trace * @@ -203,6 +233,28 @@ int lttng_ust_list_apps(pid_t **pids) return ret / sizeof(pid_t); } +/* + * lttng_list_traces + * + * Ask the session daemon for all traces (kernel and ust) + * for the session identified by uuid. + * + * Return the number of traces. + */ +int lttng_list_traces(uuid_t *uuid, struct lttng_trace **traces) +{ + int ret; + + uuid_copy(lsm.session_id, *uuid); + + ret = ask_sessiond(LTTNG_LIST_TRACES, (void **) traces); + if (ret < 0) { + return ret; + } + + return ret / sizeof(struct lttng_trace); +} + /* * lttng_create_session *