Remove application from socket hash table upon unregister
[lttng-tools.git] / include / lttng / lttng-consumer.h
index 1a6afc22aedd2e8a89d3ed852b43a0b472d62689..81fd83e0ff4845574f4ddf3762129a2935bf7138 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <limits.h>
 #include <poll.h>
+#include <unistd.h>
 #include <urcu/list.h>
 #include <lttng/lttng.h>
 
@@ -68,7 +69,8 @@ struct lttng_consumer_stream_list {
 enum lttng_consumer_type {
        LTTNG_CONSUMER_UNKNOWN = 0,
        LTTNG_CONSUMER_KERNEL,
-       LTTNG_CONSUMER_UST,
+       LTTNG_CONSUMER64_UST,
+       LTTNG_CONSUMER32_UST,
 };
 
 struct lttng_consumer_channel {
@@ -118,6 +120,10 @@ struct lttng_consumer_stream {
        /* For UST */
        struct lttng_ust_lib_ring_buffer *buf;
        int cpu;
+       int hangup_flush_done;
+       /* UID/GID of the user owning the session to which stream belongs */
+       uid_t uid;
+       gid_t gid;
 };
 
 /*
@@ -126,7 +132,8 @@ struct lttng_consumer_stream {
  */
 struct lttng_consumer_local_data {
        /* function to call when data is available on a buffer */
-       int (*on_buffer_ready)(struct lttng_consumer_stream *stream);
+       int (*on_buffer_ready)(struct lttng_consumer_stream *stream,
+                       struct lttng_consumer_local_data *ctx);
        /*
         * function to call when we receive a new channel, it receives a
         * newly allocated channel, depending on the return code of this
@@ -262,7 +269,9 @@ extern struct lttng_consumer_stream *consumer_allocate_stream(
                enum lttng_consumer_stream_state state,
                uint64_t mmap_len,
                enum lttng_event_output output,
-               const char *path_name);
+               const char *path_name,
+               uid_t uid,
+               gid_t gid);
 extern int consumer_add_stream(struct lttng_consumer_stream *stream);
 extern void consumer_del_stream(struct lttng_consumer_stream *stream);
 extern void consumer_change_stream_state(int stream_key,
@@ -277,7 +286,8 @@ int consumer_add_channel(struct lttng_consumer_channel *channel);
 
 extern struct lttng_consumer_local_data *lttng_consumer_create(
                enum lttng_consumer_type type,
-               int (*buffer_ready)(struct lttng_consumer_stream *stream),
+               int (*buffer_ready)(struct lttng_consumer_stream *stream,
+                       struct lttng_consumer_local_data *ctx),
                int (*recv_channel)(struct lttng_consumer_channel *channel),
                int (*recv_stream)(struct lttng_consumer_stream *stream),
                int (*update_stream)(int sessiond_key, uint32_t state));
@@ -299,4 +309,8 @@ extern void *lttng_consumer_thread_receive_fds(void *data);
 extern int lttng_consumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                int sock, struct pollfd *consumer_sockpoll);
 
+int lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
+               struct lttng_consumer_local_data *ctx);
+int lttng_consumer_on_recv_stream(struct lttng_consumer_stream *stream);
+
 #endif /* _LTTNG_CONSUMER_H */
This page took 0.023748 seconds and 4 git commands to generate.