wrapper: remove time.h wrapper
[lttng-modules.git] / lttng-events.c
index c14ea3f20060e4f470e0b8d00c91cc9a7faf222d..61439ec7c788efa49b3a4c910fe2d9c0a2cf79d6 100644 (file)
 #include <wrapper/file.h>
 #include <linux/jhash.h>
 #include <linux/uaccess.h>
-#include <linux/vmalloc.h>
 #include <linux/uuid.h>
 #include <linux/dmi.h>
+#include <linux/vmalloc.h>
 
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
 #include <wrapper/random.h>
 #include <wrapper/tracepoint.h>
 #include <wrapper/list.h>
@@ -43,7 +42,6 @@
 #include <lttng-string-utils.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/ringbuffer/frontend.h>
-#include <wrapper/time.h>
 
 #define METADATA_CACHE_DEFAULT_SIZE 4096
 
@@ -129,12 +127,13 @@ struct lttng_session *lttng_session_create(void)
        int i;
 
        mutex_lock(&sessions_mutex);
-       session = lttng_kvzalloc(sizeof(struct lttng_session), GFP_KERNEL);
+       session = kvzalloc_node(sizeof(struct lttng_session), GFP_KERNEL,
+                               NUMA_NO_NODE);
        if (!session)
                goto err;
        INIT_LIST_HEAD(&session->chan);
        INIT_LIST_HEAD(&session->events);
-       uuid_le_gen(&session->uuid);
+       guid_gen(&session->uuid);
 
        metadata_cache = kzalloc(sizeof(struct lttng_metadata_cache),
                        GFP_KERNEL);
@@ -172,7 +171,7 @@ struct lttng_session *lttng_session_create(void)
 err_free_cache:
        kfree(metadata_cache);
 err_free_session:
-       lttng_kvfree(session);
+       kvfree(session);
 err:
        mutex_unlock(&sessions_mutex);
        return NULL;
@@ -225,7 +224,7 @@ void lttng_session_destroy(struct lttng_session *session)
        kref_put(&session->metadata_cache->refcount, metadata_cache_destroy);
        list_del(&session->list);
        mutex_unlock(&sessions_mutex);
-       lttng_kvfree(session);
+       kvfree(session);
 }
 
 int lttng_session_statedump(struct lttng_session *session)
@@ -2511,20 +2510,12 @@ int64_t measure_clock_offset(void)
        uint64_t tcf = trace_clock_freq();
        int64_t offset;
        unsigned long flags;
-#ifdef LTTNG_KERNEL_HAS_TIMESPEC64
        struct timespec64 rts = { 0, 0 };
-#else
-       struct timespec rts = { 0, 0 };
-#endif
 
        /* Disable interrupts to increase correlation precision. */
        local_irq_save(flags);
        monotonic[0] = trace_clock_read64();
-#ifdef LTTNG_KERNEL_HAS_TIMESPEC64
        ktime_get_real_ts64(&rts);
-#else
-       getnstimeofday(&rts);
-#endif
        monotonic[1] = trace_clock_read64();
        local_irq_restore(flags);
 
@@ -2793,22 +2784,10 @@ end:
  * @transport: transport structure
  *
  * Registers a transport which can be used as output to extract the data out of
- * LTTng. The module calling this registration function must ensure that no
- * trap-inducing code will be executed by the transport functions. E.g.
- * vmalloc_sync_all() must be called between a vmalloc and the moment the memory
- * is made visible to the transport function. This registration acts as a
- * vmalloc_sync_all. Therefore, only if the module allocates virtual memory
- * after its registration must it synchronize the TLBs.
+ * LTTng.
  */
 void lttng_transport_register(struct lttng_transport *transport)
 {
-       /*
-        * Make sure no page fault can be triggered by the module about to be
-        * registered. We deal with this here so we don't have to call
-        * vmalloc_sync_all() in each module's init.
-        */
-       wrapper_vmalloc_sync_all();
-
        mutex_lock(&sessions_mutex);
        list_add_tail(&transport->node, &lttng_transport_list);
        mutex_unlock(&sessions_mutex);
This page took 0.02385 seconds and 4 git commands to generate.