Remove runtime dependency on liburcu shared objects
[lttng-ust.git] / liblttng-ust / ust-core.c
index 255ad96371d8b63c6bfcb1275140ac9050b1bb40..e8dff983279e3ec869ca9bb7b15274852e300919 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #define _LGPL_SOURCE
+#include <stdint.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <lttng/ust-events.h>
@@ -27,6 +28,7 @@
 #include "jhash.h"
 
 static CDS_LIST_HEAD(lttng_transport_list);
+static CDS_LIST_HEAD(lttng_counter_transport_list);
 
 struct lttng_transport *lttng_transport_find(const char *name)
 {
@@ -39,6 +41,17 @@ struct lttng_transport *lttng_transport_find(const char *name)
        return NULL;
 }
 
+struct lttng_counter_transport *lttng_counter_transport_find(const char *name)
+{
+       struct lttng_counter_transport *transport;
+
+       cds_list_for_each_entry(transport, &lttng_counter_transport_list, node) {
+               if (!strcmp(transport->name, name))
+                       return transport;
+       }
+       return NULL;
+}
+
 /**
  * lttng_transport_register - LTT transport registration
  * @transport: transport structure
@@ -61,6 +74,28 @@ void lttng_transport_unregister(struct lttng_transport *transport)
        cds_list_del(&transport->node);
 }
 
+/**
+ * lttng_counter_transport_register - LTTng counter transport registration
+ * @transport: transport structure
+ *
+ * Registers a counter transport which can be used as output to extract
+ * the data out of LTTng. Called with ust_lock held.
+ */
+void lttng_counter_transport_register(struct lttng_counter_transport *transport)
+{
+       cds_list_add_tail(&transport->node, &lttng_counter_transport_list);
+}
+
+/**
+ * lttng_counter_transport_unregister - LTTng counter transport unregistration
+ * @transport: transport structure
+ * Called with ust_lock held.
+ */
+void lttng_counter_transport_unregister(struct lttng_counter_transport *transport)
+{
+       cds_list_del(&transport->node);
+}
+
 /*
  * Needed by comm layer.
  */
This page took 0.02408 seconds and 4 git commands to generate.