Change list kernel events to list tracepoints
authorDavid Goulet <david.goulet@polymtl.ca>
Wed, 3 Aug 2011 20:28:21 +0000 (16:28 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Wed, 3 Aug 2011 20:28:21 +0000 (16:28 -0400)
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>
include/lttng/lttng.h
liblttngctl/liblttngctl.c
lttng/commands/list.c

index bd8cf45a8414e0a450ccc01398804be76c89f6eb..89f9db3d3e5c8b70a24e913b187f0bbcd81e5e9a 100644 (file)
@@ -218,7 +218,7 @@ extern int lttng_destroy_session(const char *name);
 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).
  */
@@ -243,11 +243,12 @@ extern int lttng_list_events(struct lttng_domain *domain,
                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.
@@ -332,11 +333,4 @@ extern int lttng_disable_event(struct lttng_domain *domain, const char *name,
 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 */
index 0cc3268f78e4520bed4d9f5b70177772737c46be..17bb4105ae0f9045907ca492565c579962278d5b 100644 (file)
@@ -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);
 }
index bce40ff6c91596cb1c209003a06ef0bf339696c3..3c779c3a3444bfcc42dabd26a8236435cd191a7b 100644 (file)
@@ -113,10 +113,13 @@ static int list_kernel_events(void)
 {
        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;
This page took 0.027698 seconds and 4 git commands to generate.