- * ask_sessiond
- *
- * Ask the session daemon a specific command and put the data into buf.
- *
- * Return size of data (only payload, not header).
- */
-static int ask_sessiond(enum lttcomm_sessiond_command lct, void **buf)
-{
- int ret;
- size_t size;
- void *data = NULL;
-
- ret = lttng_connect_sessiond();
- if (ret < 0) {
- goto end;
- }
-
- lsm.cmd_type = lct;
-
- /* Send command to session daemon */
- ret = send_data_sessiond();
- if (ret < 0) {
- goto end;
- }
-
- /* Get header from data transmission */
- ret = recv_data_sessiond(&llm, sizeof(llm));
- if (ret < 0) {
- goto end;
- }
-
- /* Check error code if OK */
- if (llm.ret_code != LTTCOMM_OK) {
- ret = -llm.ret_code;
- goto end;
- }
-
- size = llm.trace_name_offset + llm.data_size;
- if (size == 0) {
- goto end;
- }
-
- data = (void*) malloc(size);
-
- /* Get payload data */
- ret = recv_data_sessiond(data, size);
- if (ret < 0) {
- free(data);
- goto end;
- }
-
- *buf = data;
- ret = size;
-
-end:
- lttng_disconnect_sessiond();
- return ret;
-}
-
-/*
- * check_tracing_group
- *