Fix: pass private data to context callbacks
[lttng-ust.git] / liblttng-ust / ust-core.c
index 88d4f5589b3426beb030cd56be83d583678126f9..2633832b801bab42ad311b73ab23752449d77caf 100644 (file)
@@ -13,6 +13,8 @@
 #include "ust-events-internal.h"
 #include <usterr-signal-safe.h>
 #include "lttng-tracer-core.h"
+#include "lttng-rb-clients.h"
+#include "lttng-counter-client.h"
 #include "jhash.h"
 
 static CDS_LIST_HEAD(lttng_transport_list);
@@ -88,7 +90,7 @@ void lttng_counter_transport_unregister(struct lttng_counter_transport *transpor
  * Needed by comm layer.
  */
 struct lttng_enum *lttng_ust_enum_get_from_desc(struct lttng_ust_session *session,
-               struct lttng_ust_enum_desc *enum_desc)
+               const struct lttng_ust_enum_desc *enum_desc)
 {
        struct lttng_enum *_enum;
        struct cds_hlist_head *head;
@@ -106,7 +108,8 @@ struct lttng_enum *lttng_ust_enum_get_from_desc(struct lttng_ust_session *sessio
        return NULL;
 }
 
-size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field *field, size_t offset)
+size_t lttng_ust_dummy_get_size(void *priv __attribute__((unused)),
+               size_t offset)
 {
        size_t size = 0;
 
@@ -115,7 +118,7 @@ size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field *field, size_t offset
        return size;
 }
 
-void lttng_ust_dummy_record(struct lttng_ust_ctx_field *field,
+void lttng_ust_dummy_record(void *priv __attribute__((unused)),
                 struct lttng_ust_lib_ring_buffer_ctx *ctx,
                 struct lttng_ust_channel_buffer *chan)
 {
@@ -124,7 +127,7 @@ void lttng_ust_dummy_record(struct lttng_ust_ctx_field *field,
        chan->ops->event_write(ctx, &sel_char, sizeof(sel_char), lttng_ust_rb_alignof(sel_char));
 }
 
-void lttng_ust_dummy_get_value(struct lttng_ust_ctx_field *field,
+void lttng_ust_dummy_get_value(void *priv __attribute__((unused)),
                struct lttng_ust_ctx_value *value)
 {
        value->sel = LTTNG_UST_DYNAMIC_TYPE_NONE;
@@ -190,3 +193,33 @@ void lttng_ust_free_channel_common(struct lttng_ust_channel_common *chan)
                abort();
        }
 }
+
+void lttng_ust_ring_buffer_clients_init(void)
+{
+       lttng_ring_buffer_metadata_client_init();
+       lttng_ring_buffer_client_overwrite_init();
+       lttng_ring_buffer_client_overwrite_rt_init();
+       lttng_ring_buffer_client_discard_init();
+       lttng_ring_buffer_client_discard_rt_init();
+}
+
+void lttng_ust_ring_buffer_clients_exit(void)
+{
+       lttng_ring_buffer_client_discard_rt_exit();
+       lttng_ring_buffer_client_discard_exit();
+       lttng_ring_buffer_client_overwrite_rt_exit();
+       lttng_ring_buffer_client_overwrite_exit();
+       lttng_ring_buffer_metadata_client_exit();
+}
+
+void lttng_ust_counter_clients_init(void)
+{
+       lttng_counter_client_percpu_64_modular_init();
+       lttng_counter_client_percpu_32_modular_init();
+}
+
+void lttng_ust_counter_clients_exit(void)
+{
+       lttng_counter_client_percpu_32_modular_exit();
+       lttng_counter_client_percpu_64_modular_exit();
+}
This page took 0.0259160000000001 seconds and 4 git commands to generate.