lib: compile liblttng-ctl as C++
[lttng-tools.git] / src / common / consumer / consumer.h
index 6dedb7525fe7724bc709a4fdb45e5ed35a5939b9..1b0ee000b5bdd944ac4aba946a83d256327a5195 100644 (file)
 #include <common/trace-chunk-registry.h>
 #include <common/credentials.h>
 #include <common/buffer-view.h>
+#include <common/dynamic-array.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 struct lttng_consumer_local_data;
 
@@ -64,6 +69,7 @@ enum lttng_consumer_command {
        LTTNG_CONSUMER_CLOSE_TRACE_CHUNK,
        LTTNG_CONSUMER_TRACE_CHUNK_EXISTS,
        LTTNG_CONSUMER_CLEAR_CHANNEL,
+       LTTNG_CONSUMER_OPEN_CHANNEL_PACKETS,
 };
 
 enum lttng_consumer_type {
@@ -94,7 +100,7 @@ enum sync_metadata_status {
        SYNC_METADATA_STATUS_ERROR,
 };
 
-extern struct lttng_consumer_global_data consumer_data;
+extern struct lttng_consumer_global_data the_consumer_data;
 
 struct stream_list {
        struct cds_list_head head;
@@ -158,7 +164,7 @@ struct lttng_consumer_channel {
 
        /* For UST */
        uid_t ust_app_uid;      /* Application UID. */
-       struct ustctl_consumer_channel *uchan;
+       struct lttng_ust_ctl_consumer_channel *uchan;
        unsigned char uuid[LTTNG_UUID_STR_LEN];
        /*
         * Temporary stream list used to store the streams once created and waiting
@@ -297,6 +303,12 @@ struct stream_subbuffer {
        } info;
 };
 
+enum get_next_subbuffer_status {
+       GET_NEXT_SUBBUFFER_STATUS_OK,
+       GET_NEXT_SUBBUFFER_STATUS_NO_DATA,
+       GET_NEXT_SUBBUFFER_STATUS_ERROR,
+};
+
 /*
  * Perform any operation required to acknowledge
  * the wake-up of a consumer stream (e.g. consume a byte on a wake-up pipe).
@@ -319,8 +331,8 @@ typedef int (*on_sleep_cb)(struct lttng_consumer_stream *,
  *
  * Stream and channel locks are acquired during this call.
  */
-typedef int (*get_next_subbuffer_cb)(struct lttng_consumer_stream *,
-               struct stream_subbuffer *);
+typedef enum get_next_subbuffer_status (*get_next_subbuffer_cb)(
+               struct lttng_consumer_stream *, struct stream_subbuffer *);
 
 /*
  * Populate the stream_subbuffer's info member. The info to populate
@@ -538,7 +550,7 @@ struct lttng_consumer_stream {
        /* Stream name. Format is: <channel_name>_<cpu_number> */
        char name[LTTNG_SYMBOL_NAME_LEN];
        /* Internal state of libustctl. */
-       struct ustctl_consumer_stream *ustream;
+       struct lttng_ust_ctl_consumer_stream *ustream;
        struct cds_list_head send_node;
        /* On-disk circular buffer */
        uint64_t tracefile_size_current;
@@ -635,7 +647,7 @@ struct lttng_consumer_stream {
                reset_metadata_cb reset_metadata;
                consume_subbuffer_cb consume_subbuffer;
                put_next_subbuffer_cb put_next_subbuffer;
-               post_consume_cb post_consume;
+               struct lttng_dynamic_array post_consume_cbs;
                send_live_beacon_cb send_live_beacon;
                on_sleep_cb on_sleep;
                unlock_cb unlock;
@@ -847,8 +859,12 @@ extern int consumer_quit;
  */
 extern int consumer_quit;
 
-/* Flag used to temporarily pause data consumption from testpoints. */
-extern int data_consumption_paused;
+/*
+ * Flag used to temporarily pause data consumption from testpoints.
+ *
+ * This variable is dlsym-ed from a test, so needs to be exported.
+ */
+LTTNG_EXPORT extern int data_consumption_paused;
 
 /* Return a human-readable consumer type string that is suitable for logging. */
 static inline
@@ -1048,5 +1064,13 @@ enum lttcomm_return_code lttng_consumer_init_command(
                struct lttng_consumer_local_data *ctx,
                const lttng_uuid sessiond_uuid);
 int lttng_consumer_clear_channel(struct lttng_consumer_channel *channel);
+enum lttcomm_return_code lttng_consumer_open_channel_packets(
+               struct lttng_consumer_channel *channel);
+int consumer_metadata_wakeup_pipe(const struct lttng_consumer_channel *channel);
+void lttng_consumer_sigbus_handle(void *addr);
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* LIB_CONSUMER_H */
This page took 0.027636 seconds and 4 git commands to generate.