X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=fc1d82001e111befe11b2b7c75ea9e802654d519;hb=c69130a8727d8ede046f7f8d8d10a1366a2a6945;hp=13a5d91f3ca2668125369ca982e979b19f857514;hpb=755066c271c15091a9fad9e065a05970733f5593;p=lttng-tools.git diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 13a5d91f3..fc1d82001 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -340,8 +340,8 @@ static int mi_list_agent_ust_events(struct lttng_event *events, int count, goto end; } - /* Open processes element */ - ret = mi_lttng_processes_open(writer); + /* Open pids element element */ + ret = mi_lttng_pids_open(writer); if (ret) { goto end; } @@ -366,7 +366,7 @@ static int mi_list_agent_ust_events(struct lttng_event *events, int count, if (!pid_element_open) { /* Open and write a pid element */ - ret = mi_lttng_process(writer, cur_pid, cmdline, 1); + ret = mi_lttng_pid(writer, cur_pid, cmdline, 1); if (ret) { goto error; } @@ -389,7 +389,7 @@ static int mi_list_agent_ust_events(struct lttng_event *events, int count, } } - /* Close processes */ + /* Close pids */ ret = mi_lttng_writer_close_element(writer); if (ret) { goto end; @@ -493,7 +493,7 @@ static int list_ust_events(void) int i, size, ret = CMD_SUCCESS; struct lttng_domain domain; struct lttng_handle *handle; - struct lttng_event *event_list; + struct lttng_event *event_list = NULL; pid_t cur_pid = 0; char *cmdline = NULL; @@ -577,8 +577,8 @@ static int mi_list_ust_event_fields(struct lttng_event_field *fields, int count, goto end; } - /* Open processes element */ - ret = mi_lttng_processes_open(writer); + /* Open pids element */ + ret = mi_lttng_pids_open(writer); if (ret) { goto end; } @@ -606,8 +606,8 @@ static int mi_list_ust_event_fields(struct lttng_event_field *fields, int count, cur_pid = fields[i].event.pid; cmdline = get_cmdline_by_pid(cur_pid); if (!pid_element_open) { - /* Open and write a process element */ - ret = mi_lttng_process(writer, cur_pid, cmdline, 1); + /* Open and write a pid element */ + ret = mi_lttng_pid(writer, cur_pid, cmdline, 1); if (ret) { goto error; } @@ -661,7 +661,7 @@ static int mi_list_ust_event_fields(struct lttng_event_field *fields, int count, } } - /* Close processes, domain, domains */ + /* Close pid, domain, domains */ ret = mi_lttng_close_multi_element(writer, 3); end: return ret; @@ -1855,7 +1855,8 @@ int cmd_list(int argc, const char **argv) if (ret) { goto end; } - continue; + + goto next_domain; } switch (domains[i].type) { @@ -1875,6 +1876,7 @@ int cmd_list(int argc, const char **argv) goto end; } +next_domain: if (lttng_opt_mi) { /* Close domain element */ ret = mi_lttng_writer_close_element(writer);