#ifndef LTTNG_TRACE_CHUNK_REGISTRY_H
#define LTTNG_TRACE_CHUNK_REGISTRY_H
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
#include <common/macros.hpp>
#include <common/trace-chunk.hpp>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
struct lttng_trace_chunk_registry;
/*
*
* Note that a trace chunk registry may only be accessed by an RCU thread.
*/
-struct lttng_trace_chunk_registry *lttng_trace_chunk_registry_create(void);
+struct lttng_trace_chunk_registry *lttng_trace_chunk_registry_create();
/*
* Destroy an lttng trace chunk registry. The registry must be emptied
* (i.e. all references to the trace chunks it contains must be released) before
* it is destroyed.
*/
-void lttng_trace_chunk_registry_destroy(
- struct lttng_trace_chunk_registry *registry);
+void lttng_trace_chunk_registry_destroy(struct lttng_trace_chunk_registry *registry);
/*
* Publish a trace chunk for a given session id.
*
* Returns an lttng_trace_chunk on success, NULL on error.
*/
-struct lttng_trace_chunk *lttng_trace_chunk_registry_publish_chunk(
- struct lttng_trace_chunk_registry *registry,
- uint64_t session_id, struct lttng_trace_chunk *chunk);
+struct lttng_trace_chunk *
+lttng_trace_chunk_registry_publish_chunk(struct lttng_trace_chunk_registry *registry,
+ uint64_t session_id,
+ struct lttng_trace_chunk *chunk);
/*
* Adds the `previously_published` parameter which allows the caller
* to know if a trace chunk equivalent to `chunk` was previously published.
- *
+ *
* The registry holds a reference to the published trace chunks it contains.
* Trace chunks automatically unpublish themselves from their registry on
* destruction.
* This information is necessary to drop the reference of newly published
* chunks when a user doesn't wish to explicitly maintain all references
* to a given trace chunk.
- *
+ *
* For instance, the relay daemon doesn't need the registry to hold a
* reference since it controls the lifetime of its trace chunks.
* Conversely, the consumer daemons rely on the session daemon to inform
* belong to a specific top-level object: they are always retrieved from
* the registry by `id`.
*/
-struct lttng_trace_chunk *lttng_trace_chunk_registry_publish_chunk(
- struct lttng_trace_chunk_registry *registry,
- uint64_t session_id, struct lttng_trace_chunk *chunk,
- bool *previously_published);
+struct lttng_trace_chunk *
+lttng_trace_chunk_registry_publish_chunk(struct lttng_trace_chunk_registry *registry,
+ uint64_t session_id,
+ struct lttng_trace_chunk *chunk,
+ bool *previously_published);
/*
* Look-up a trace chunk by session_id and chunk_id.
*
* Returns an lttng_trace_chunk on success, NULL if the chunk does not exist.
*/
-struct lttng_trace_chunk *
-lttng_trace_chunk_registry_find_chunk(
- const struct lttng_trace_chunk_registry *registry,
- uint64_t session_id, uint64_t chunk_id);
+struct lttng_trace_chunk *lttng_trace_chunk_registry_find_chunk(
+ const struct lttng_trace_chunk_registry *registry, uint64_t session_id, uint64_t chunk_id);
/*
* Query the existence of a trace chunk by session_id and chunk_id.
*
* Returns 0 on success, a negative value on error.
*/
-int lttng_trace_chunk_registry_chunk_exists(
- const struct lttng_trace_chunk_registry *registry,
- uint64_t session_id, uint64_t chunk_id, bool *chunk_exists);
+int lttng_trace_chunk_registry_chunk_exists(const struct lttng_trace_chunk_registry *registry,
+ uint64_t session_id,
+ uint64_t chunk_id,
+ bool *chunk_exists);
/*
* Look-up an anonymous trace chunk by session_id.
* Returns an lttng_trace_chunk on success, NULL if the chunk does not exist.
*/
struct lttng_trace_chunk *
-lttng_trace_chunk_registry_find_anonymous_chunk(
- const struct lttng_trace_chunk_registry *registry,
- uint64_t session_id);
+lttng_trace_chunk_registry_find_anonymous_chunk(const struct lttng_trace_chunk_registry *registry,
+ uint64_t session_id);
-unsigned int lttng_trace_chunk_registry_put_each_chunk(
- const struct lttng_trace_chunk_registry *registry);
+unsigned int
+lttng_trace_chunk_registry_put_each_chunk(const struct lttng_trace_chunk_registry *registry);
#endif /* LTTNG_TRACE_CHUNK_REGISTRY_H */