X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=e88ad0d0de4b3439f88d417ad58e82f58b9c99f3;hp=4ae8a1a35a1ba57d4b2b7e6c364ddff61efe9cb2;hb=2b2694892c10cdb632afac2b2f1aabf7cb9673d9;hpb=b955b4d4c416bfa4db1915b51834c24ee2f35df1 diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 4ae8a1a35..e88ad0d0d 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -490,7 +490,7 @@ static int list_lttng_agent_events(struct agent *agt, int i = 0, ret = 0; unsigned int nb_event = 0; struct agent_event *event; - struct lttng_event *tmp_events; + struct lttng_event *tmp_events = NULL; struct lttng_ht_iter iter; size_t extended_len = 0; void *extended_at; @@ -562,9 +562,12 @@ static int list_lttng_agent_events(struct agent *agt, ret = nb_event; assert(nb_event == i); -error: +end: rcu_read_unlock(); return ret; +error: + free(tmp_events); + goto end; } /* @@ -5044,58 +5047,6 @@ end: return ret; } -/* - * Command ROTATE_GET_CURRENT_PATH from the lttng-ctl library. - * - * Configure the automatic rotation parameters. - * Set to -1ULL to disable them. - * - * Return LTTNG_OK on success or else a LTTNG_ERR code. - */ -int cmd_session_get_current_output(struct ltt_session *session, - struct lttng_session_get_current_output_return *output_return) -{ - int ret; - const char *path; - - if (!session->snapshot_mode) { - if (session->current_archive_id == 0) { - if (session->kernel_session) { - path = session_get_base_path(session); - } else if (session->ust_session) { - path = session_get_base_path(session); - } else { - abort(); - } - assert(path); - } else { - path = session->rotation_chunk.active_tracing_path; - } - } else { - /* - * A snapshot session does not have a "current" trace archive - * location. - */ - path = ""; - } - - DBG("Cmd get current output for session %s, returning %s", - session->name, path); - - ret = lttng_strncpy(output_return->path, - path, - sizeof(output_return->path)); - if (ret) { - ERR("Failed to copy trace output path to session get current output command reply"); - ret = -LTTNG_ERR_UNK; - goto end; - } - - ret = LTTNG_OK; -end: - return ret; -} - /* Wait for a given path to be removed before continuing. */ static enum lttng_error_code wait_on_path(void *path_data) {