From: David Goulet Date: Tue, 7 Feb 2012 21:44:30 +0000 (-0500) Subject: Fix session syscall listing X-Git-Tag: v2.0-pre20~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2c425ff76ee434cf386fd7ee40a727480be95dff;p=lttng-tools.git Fix session syscall listing 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 --- diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index 86a1957cf..dfc0be958 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -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: diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 4a5396874..5f58f10f6 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -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: