Fix session syscall listing
authorDavid Goulet <dgoulet@efficios.com>
Tue, 7 Feb 2012 21:44:30 +0000 (16:44 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 7 Feb 2012 21:44:30 +0000 (16:44 -0500)
This problem occured because the "syscall" event was not added to the
event list since his kernel FD is not valid (fd=0). However, this fd is
only usefull if we want to add context or disable events. Those two
operations are not supported for now.

So, we can safely add the event to the list and add a hardcoded name in
the lttng cli list command.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/kernel.c
src/bin/lttng/commands/list.c

index 86a1957cf400a2f8c6cd080ff42c28a864dda427..dfc0be958addc895bc1bd68384530002a6d501ac 100644 (file)
@@ -204,12 +204,11 @@ int kernel_create_event(struct lttng_event *ev,
        }
 
        /*
-        * LTTNG_KERNEL_SYSCALL event creation will return 0 on success. However
-        * this FD must not be added to the event list.
+        * LTTNG_KERNEL_SYSCALL event creation will return 0 on success.
         */
        if (ret == 0 && event->event->instrumentation == LTTNG_KERNEL_SYSCALL) {
                DBG2("Kernel event syscall creation success");
-               goto end;
+               goto add_list;
        }
 
        event->fd = ret;
@@ -219,13 +218,13 @@ int kernel_create_event(struct lttng_event *ev,
                perror("fcntl session fd");
        }
 
+add_list:
        /* Add event to event list */
        cds_list_add(&event->list, &channel->events_list.head);
        channel->event_count++;
 
        DBG("Event %s created (fd: %d)", ev->name, event->fd);
 
-end:
        return 0;
 
 free_event:
index 4a53968740bd789aa8216bfda39029396c346b72..5f58f10f662aaf40b848c8dc11a217c31836a2bc 100644 (file)
@@ -221,7 +221,7 @@ static void print_events(struct lttng_event *event)
                MSG("%ssymbol: \"%s\"", indent8, event->attr.ftrace.symbol_name);
                break;
        case LTTNG_EVENT_SYSCALL:
-               MSG("%s (type: syscall)%s", indent6,
+               MSG("%ssyscalls (type: syscall)%s", indent6,
                                enabled_string(event->enabled));
                break;
        case LTTNG_EVENT_NOOP:
This page took 0.028137 seconds and 4 git commands to generate.