Test: Add syscall listing
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 0050ef50b1169c9b3b16545aee2c8e48e950ccfc..dcb79dda2ab9be31cb75f523691640d3055b6293 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.
  */
@@ -3036,6 +3055,7 @@ int cmd_snapshot_record(struct ltt_session *session,
        uint64_t session_max_size = 0, max_stream_size = 0;
 
        assert(session);
+       assert(output);
 
        DBG("Cmd snapshot record for session %s", session->name);
 
@@ -3055,7 +3075,7 @@ int cmd_snapshot_record(struct ltt_session *session,
        }
 
        /* Use temporary output for the session. */
-       if (output && *output->ctrl_url != '\0') {
+       if (*output->ctrl_url != '\0') {
                ret = snapshot_output_init(output->max_size, output->name,
                                output->ctrl_url, output->data_url, session->consumer,
                                &tmp_output, NULL);
This page took 0.023871 seconds and 4 git commands to generate.