X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttngctl%2Fliblttngctl.c;h=eb606166c214c9bd850ca7889d961547974ab4cf;hp=31edc982ea8ca07f57f5b2a39ab3cc31bc6e5965;hb=33a2b85433875769e92ca44a680c46b9498f5174;hpb=947308c48c77d6dfd601cfc575d61ea833ed0b6e diff --git a/liblttngctl/liblttngctl.c b/liblttngctl/liblttngctl.c index 31edc982e..eb606166c 100644 --- a/liblttngctl/liblttngctl.c +++ b/liblttngctl/liblttngctl.c @@ -235,8 +235,16 @@ static int set_session_daemon_path(void) */ int lttng_kernel_enable_event(char *event_name) { - strncpy(lsm.u.event.event_name, event_name, NAME_MAX); - return ask_sessiond(KERNEL_ENABLE_EVENT, NULL); + int ret; + + if (event_name == NULL) { + ret = ask_sessiond(KERNEL_ENABLE_ALL_EVENT, NULL); + } else { + strncpy(lsm.u.event.event_name, event_name, NAME_MAX); + ret = ask_sessiond(KERNEL_ENABLE_EVENT, NULL); + } + + return ret; } /* @@ -290,6 +298,19 @@ int lttng_kernel_create_stream(void) return ask_sessiond(KERNEL_CREATE_STREAM, NULL); } +/* + * lttng_kernel_list_events + * + * List all available events in the kernel. + * + * Return the size (bytes) of the list and set the event_list array. + * On error, return negative value. + */ +int lttng_kernel_list_events(char **event_list) +{ + return ask_sessiond(KERNEL_LIST_EVENTS, (void **) event_list); +} + /* * lttng_kernel_start_tracing *