Remove lttng_list_kernel_events to lttng_list_tracepoints(domain).
Make it generic to lttng domain and specific for tracepoints which are
static instrumentation.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
extern int lttng_list_sessions(struct lttng_session **sessions);
/*
- * List registered domain(s) of the session.
+ * List registered domain(s) of a session.
*
* Return the size of the "lttng_domain" array. Caller must free(3).
*/
struct lttng_event **events);
/*
- * List available kernel tracing events
+ * List available tracepoints of domain.
*
* Return the size of the "lttng_event" array. Caller must free(3).
*/
-extern int lttng_list_kernel_events(struct lttng_event **events);
+extern int lttng_list_tracepoints(struct lttng_domain *domain,
+ struct lttng_event **events);
/*
* Check if a session daemon is alive.
extern int lttng_disable_channel(struct lttng_domain *domain,
const char *name);
-/*
- * List kernel events.
- *
- * Return the size of the allocated event list. Caller must free(3) the data.
- */
-//extern int lttng_list_events(struct lttng_domain *domain, char **event_list);
-
#endif /* _LTTNG_H */
}
/*
- * 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);
}
{
int i, size;
struct lttng_event *event_list;
+ struct lttng_domain dom;
DBG("Getting all tracing events");
- size = lttng_list_kernel_events(&event_list);
+ dom.type = LTTNG_DOMAIN_KERNEL;
+
+ size = lttng_list_tracepoints(&dom, &event_list);
if (size < 0) {
ERR("Unable to list kernel events");
return size;