X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttngctl%2Fliblttngctl.c;h=17bb4105ae0f9045907ca492565c579962278d5b;hp=0cc3268f78e4520bed4d9f5b70177772737c46be;hb=2a71efd5ae4e4bc9fe52154782d4a0a8f867d55a;hpb=4b2221858653255be812d5a4e55c2ec05ec1819e diff --git a/liblttngctl/liblttngctl.c b/liblttngctl/liblttngctl.c index 0cc3268f7..17bb4105a 100644 --- a/liblttngctl/liblttngctl.c +++ b/liblttngctl/liblttngctl.c @@ -468,16 +468,32 @@ int lttng_disable_channel(struct lttng_domain *domain, const char *name) } /* - * List all available kernel events. + * List all available tracepoints of domain. * - * Return the size (bytes) of the list and set the event_list array. + * Return the size (bytes) of the list and set the events array. * On error, return negative value. */ -int lttng_list_kernel_events(struct lttng_event **events) +int lttng_list_tracepoints(struct lttng_domain *domain, + struct lttng_event **events) { int ret; - ret = ask_sessiond(LTTNG_KERNEL_LIST_EVENTS, (void **) events); + ret = copy_lttng_domain(domain); + if (ret < 0) { + return -LTTCOMM_UNKNOWN_DOMAIN; + } + + switch (domain->type) { + case LTTNG_DOMAIN_KERNEL: + ret = ask_sessiond(LTTNG_KERNEL_LIST_EVENTS, (void **) events); + break; + case LTTNG_DOMAIN_UST: + ret = LTTCOMM_NOT_IMPLEMENTED; + break; + default: + ret = LTTCOMM_UNKNOWN_DOMAIN; + break; + }; return ret / sizeof(struct lttng_event); }