Add syscall listing support
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 0050ef50b1169c9b3b16545aee2c8e48e950ccfc..1fd799f0d819e375fdc05e672dfec14cccc275e6 100644 (file)
@@ -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.
  */
This page took 0.023658 seconds and 4 git commands to generate.