Cleanup the JNI interface options in configure.ac
[lttng-ust.git] / liblttng-ust / lttng-ust-abi.c
index 6a568ba85690d77fcd351bc93c022a4c1a7f93d6..d146e1023efda3c70ee21db5be17a61d63070dc5 100644 (file)
@@ -28,9 +28,9 @@
 #include <urcu/compiler.h>
 #include <urcu/list.h>
 #include <lttng/ust-events.h>
-#include <lttng/usterr-signal-safe.h>
-#include "lttng/core.h"
 #include <lttng/ust-version.h>
+#include <usterr-signal-safe.h>
+#include <helper.h>
 #include "ltt-tracer.h"
 #include "tracepoint-internal.h"
 
@@ -334,13 +334,14 @@ void lttng_metadata_create_events(int channel_objd)
                .name = "lttng_ust:metadata",
        };
        struct ltt_event *event;
+       int ret;
 
        /*
         * We tolerate no failure path after event creation. It will stay
         * invariant for the rest of the session.
         */
-       event = ltt_event_create(channel, &metadata_params, NULL);
-       if (!event) {
+       ret = ltt_event_create(channel, &metadata_params, NULL, &event);
+       if (ret < 0) {
                goto create_error;
        }
        return;
@@ -509,7 +510,7 @@ static const struct lttng_ust_objd_ops lttng_session_ops = {
  */
 static
 void ltt_tracepoint_list_get(struct ltt_tracepoint_list *list,
-               char *tp_list_entry)
+               struct lttng_ust_tracepoint_iter *tracepoint)
 {
 next:
        if (!list->got_first) {
@@ -520,13 +521,27 @@ next:
        tracepoint_iter_next(&list->iter);
 copy:
        if (!list->iter.tracepoint) {
-               tp_list_entry[0] = '\0';        /* end of list */
+               tracepoint->name[0] = '\0';     /* end of list */
        } else {
                if (!strcmp((*list->iter.tracepoint)->name,
                                "lttng_ust:metadata"))
                        goto next;
-               memcpy(tp_list_entry, (*list->iter.tracepoint)->name,
+               memcpy(tracepoint->name, (*list->iter.tracepoint)->name,
                        LTTNG_UST_SYM_NAME_LEN);
+#if 0
+               if ((*list->iter.tracepoint)->loglevel) {
+                       memcpy(tracepoint->loglevel,
+                               (*list->iter.tracepoint)->loglevel->identifier,
+                               LTTNG_UST_SYM_NAME_LEN);
+                       tracepoint->loglevel_value =
+                               (*list->iter.tracepoint)->loglevel->value;
+               } else {
+#endif
+                       tracepoint->loglevel[0] = '\0';
+                       tracepoint->loglevel_value = 0;
+#if 0
+               }
+#endif
        }
 }
 
@@ -534,12 +549,13 @@ static
 long lttng_tracepoint_list_cmd(int objd, unsigned int cmd, unsigned long arg)
 {
        struct ltt_tracepoint_list *list = objd_private(objd);
-       char *str = (char *) arg;
+       struct lttng_ust_tracepoint_iter *tp =
+               (struct lttng_ust_tracepoint_iter *) arg;
 
        switch (cmd) {
        case LTTNG_UST_TRACEPOINT_LIST_GET:
-               ltt_tracepoint_list_get(list, str);
-               if (str[0] == '\0')
+               ltt_tracepoint_list_get(list, tp);
+               if (tp->name[0] == '\0')
                        return -ENOENT;
                return 0;
        default:
@@ -656,9 +672,8 @@ int lttng_abi_create_event(int channel_objd,
         * We tolerate no failure path after event creation. It will stay
         * invariant for the rest of the session.
         */
-       event = ltt_event_create(channel, event_param, NULL);
-       if (!event) {
-               ret = -EINVAL;
+       ret = ltt_event_create(channel, event_param, NULL, &event);
+       if (ret < 0) {
                goto event_error;
        }
        objd_set_private(event_objd, event);
This page took 0.025108 seconds and 4 git commands to generate.