Cleanup: apply `include-what-you-use` guideline for `uint*_t`
[lttng-ust.git] / liblttng-ust / lttng-ust-abi.c
index c5cc42b727c107a26d1466cea45227072643aa0c..0459d7a3f29bf22fcef79f12605834b877feeb10 100644 (file)
  *     - Takes instrumentation source specific arguments.
  */
 
-#include <lttng/ust-abi.h>
-#include <lttng/ust-error.h>
+#define _LGPL_SOURCE
+#include <stdint.h>
+
 #include <urcu/compiler.h>
 #include <urcu/list.h>
+
+#include <helper.h>
+#include <lttng/tracepoint.h>
+#include <lttng/ust-abi.h>
+#include <lttng/ust-error.h>
 #include <lttng/ust-events.h>
 #include <lttng/ust-version.h>
-#include <lttng/tracepoint.h>
-#include "tracepoint-internal.h"
+#include <ust-fd.h>
 #include <usterr-signal-safe.h>
-#include <helper.h>
-#include "lttng-tracer.h"
-#include "../libringbuffer/shm.h"
+
 #include "../libringbuffer/frontend_types.h"
+#include "../libringbuffer/shm.h"
+#include "lttng-tracer.h"
+#include "string-utils.h"
 
 #define OBJ_NAME_LEN   16
 
@@ -208,7 +214,7 @@ int lttng_ust_objd_unref(int id, int is_owner)
        }
        if ((--obj->u.s.f_count) == 1) {
                const struct lttng_ust_objd_ops *ops = objd_ops(id);
-               
+
                if (ops->release)
                        ops->release(id);
                objd_free(id);
@@ -335,9 +341,10 @@ long lttng_abi_tracer_version(int objd,
 static
 long lttng_abi_add_context(int objd,
        struct lttng_ust_context *context_param,
+       union ust_args *uargs,
        struct lttng_ctx **ctx, struct lttng_session *session)
 {
-       return lttng_attach_context(context_param, ctx, session);
+       return lttng_attach_context(context_param, uargs, ctx, session);
 }
 
 /**
@@ -512,7 +519,6 @@ int lttng_abi_map_channel(int session_objd,
        /* error path after channel was created */
 objd_error:
 notransport:
-       free(lttng_chan);
 alloc_error:
        channel_destroy(chan, channel_handle, 0);
        return ret;
@@ -527,7 +533,9 @@ invalid:
        {
                int close_ret;
 
+               lttng_ust_lock_fd_tracker();
                close_ret = close(wakeup_fd);
+               lttng_ust_unlock_fd_tracker();
                if (close_ret) {
                        PERROR("close");
                }
@@ -572,6 +580,8 @@ long lttng_session_cmd(int objd, unsigned int cmd, unsigned long arg,
        case LTTNG_UST_SESSION_STOP:
        case LTTNG_UST_DISABLE:
                return lttng_session_disable(session);
+       case LTTNG_UST_SESSION_STATEDUMP:
+               return lttng_session_statedump(session);
        default:
                return -EINVAL;
        }
@@ -874,10 +884,14 @@ long lttng_channel_cmd(int objd, unsigned int cmd, unsigned long arg,
        {
                struct lttng_ust_event *event_param =
                        (struct lttng_ust_event *) arg;
-               if (event_param->name[strlen(event_param->name) - 1] == '*') {
-                       /* If ends with wildcard, create wildcard. */
+
+               if (strutils_is_star_glob_pattern(event_param->name)) {
+                       /*
+                        * If the event name is a star globbing pattern,
+                        * we create the special star globbing enabler.
+                        */
                        return lttng_abi_create_enabler(objd, event_param,
-                                       owner, LTTNG_ENABLER_WILDCARD);
+                                       owner, LTTNG_ENABLER_STAR_GLOB);
                } else {
                        return lttng_abi_create_enabler(objd, event_param,
                                        owner, LTTNG_ENABLER_EVENT);
@@ -885,7 +899,7 @@ long lttng_channel_cmd(int objd, unsigned int cmd, unsigned long arg,
        }
        case LTTNG_UST_CONTEXT:
                return lttng_abi_add_context(objd,
-                               (struct lttng_ust_context *) arg,
+                               (struct lttng_ust_context *) arg, uargs,
                                &channel->ctx, channel->session);
        case LTTNG_UST_ENABLE:
                return lttng_channel_enable(channel);
This page took 0.0262019999999999 seconds and 4 git commands to generate.