lib: compile liblttng-ctl as C++
[lttng-tools.git] / src / common / consumer / consumer.h
index e28c20bf1c397c28384126c849564cde0b27d833..1b0ee000b5bdd944ac4aba946a83d256327a5195 100644 (file)
 #include <common/buffer-view.h>
 #include <common/dynamic-array.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct lttng_consumer_local_data;
 
 /* Commands for consumer */
@@ -299,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).
@@ -321,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
@@ -849,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
@@ -1053,5 +1067,10 @@ 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.023555 seconds and 4 git commands to generate.