X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=1fd799f0d819e375fdc05e672dfec14cccc275e6;hp=0050ef50b1169c9b3b16545aee2c8e48e950ccfc;hb=834978fd9e2392f20867351ca99bf7bdf31b4f56;hpb=5a510c9fc5ac8b5292a497192bd47aeec07112e3 diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 0050ef50b..1fd799f0d 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -35,6 +35,7 @@ #include "kernel-consumer.h" #include "lttng-sessiond.h" #include "utils.h" +#include "syscall.h" #include "cmd.h" @@ -360,7 +361,8 @@ static int list_lttng_kernel_events(char *channel_name, DBG("Listing events for channel %s", kchan->channel->name); if (nb_event == 0) { - goto end; + *events = NULL; + goto syscall; } *events = zmalloc(nb_event * sizeof(struct lttng_event)); @@ -407,7 +409,19 @@ static int list_lttng_kernel_events(char *channel_name, i++; } -end: +syscall: + if (syscall_table) { + ssize_t new_size; + + new_size = syscall_list_channel(kchan, events, nb_event); + if (new_size < 0) { + free(events); + ret = -new_size; + goto error; + } + nb_event = new_size; + } + return nb_event; error: @@ -1787,6 +1801,11 @@ error: return -ret; } +ssize_t cmd_list_syscalls(struct lttng_event **events) +{ + return syscall_table_list(events); +} + /* * Command LTTNG_START_TRACE processed by the client thread. */