Rename symbols.h to vmalloc.h
[lttng-modules.git] / ltt-events.c
index c2a6a9206304f6e5a06b4b30e55a465d0f70f589..512e7a24676214e09063a35566cef322eca8644a 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/mutex.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
-#include <linux/vmalloc.h>     /* For vmalloc_sync_all */
+#include "wrapper/vmalloc.h"   /* for wrapper_vmalloc_sync_all() */
 #include "ltt-events.h"
 
 static LIST_HEAD(sessions);
@@ -49,7 +49,7 @@ void ltt_session_destroy(struct ltt_session *session)
        int ret;
 
        mutex_lock(&sessions_mutex);
-       session->active = 0;
+       ACCESS_ONCE(session->active) = 0;
        list_for_each_entry(event, &session->events, list) {
                ret = _ltt_event_unregister(event);
                WARN_ON(ret);
@@ -73,7 +73,7 @@ int ltt_session_start(struct ltt_session *session)
                ret = -EBUSY;
                goto end;
        }
-       session->active = 1;
+       ACCESS_ONCE(session->active) = 1;
        synchronize_trace();    /* Wait for in-flight events to complete */
 end:
        mutex_unlock(&sessions_mutex);
@@ -89,14 +89,14 @@ int ltt_session_stop(struct ltt_session *session)
                ret = -EBUSY;
                goto end;
        }
-       session->active = 0;
+       ACCESS_ONCE(session->active) = 0;
        synchronize_trace();    /* Wait for in-flight events to complete */
 end:
        mutex_unlock(&sessions_mutex);
        return ret;
 }
 
-static struct ltt_transport *ltt_transport_find(char *name)
+static struct ltt_transport *ltt_transport_find(const char *name)
 {
        struct ltt_transport *transport;
 
@@ -108,21 +108,20 @@ static struct ltt_transport *ltt_transport_find(char *name)
 }
 
 struct ltt_channel *ltt_channel_create(struct ltt_session *session,
-                                      int overwrite, void *buf_addr,
+                                      const char *transport_name,
+                                      void *buf_addr,
                                       size_t subbuf_size, size_t num_subbuf,
                                       unsigned int switch_timer_interval,
                                       unsigned int read_timer_interval)
 {
        struct ltt_channel *chan;
        struct ltt_transport *transport;
-       char *transport_name;
 
        mutex_lock(&sessions_mutex);
        if (session->active) {
                printk(KERN_WARNING "LTTng refusing to add channel to active session\n");
                goto active;    /* Refuse to add channel to active session */
        }
-       transport_name = overwrite ? "relay-overwrite" : "relay-discard";
        transport = ltt_transport_find(transport_name);
        if (!transport) {
                printk(KERN_WARNING "LTTng transport %s not found\n",
@@ -270,7 +269,7 @@ void ltt_transport_register(struct ltt_transport *transport)
         * registered. We deal with this here so we don't have to call
         * vmalloc_sync_all() in each module's init.
         */
-       vmalloc_sync_all();
+       wrapper_vmalloc_sync_all();
 
        mutex_lock(&sessions_mutex);
        list_add_tail(&transport->node, &ltt_transport_list);
This page took 0.024204 seconds and 4 git commands to generate.