Fix: ust-consumer: metadata thread not woken-up after version change
[lttng-tools.git] / src / common / consumer / consumer-metadata-cache.h
index 7dcf6976f3ada26eb4adf05beba86e710bc28752..43136858247e764d98d7ad0a857688043fb06b8a 100644 (file)
 
 #include <common/consumer/consumer.h>
 
+enum consumer_metadata_cache_write_status {
+       CONSUMER_METADATA_CACHE_WRITE_STATUS_ERROR = -1,
+       /*
+        * New metadata content was appended to the cache successfully.
+        * Previously available content remains valid.
+        */
+       CONSUMER_METADATA_CACHE_WRITE_STATUS_APPENDED_CONTENT = 0,
+       /*
+        * The new content pushed to the cache invalidated the content that
+        * was already present. The contents of the cache should be re-read.
+        */
+       CONSUMER_METADATA_CACHE_WRITE_STATUS_INVALIDATED,
+       /*
+        * A metadata cache write can simply overwrite an already existing
+        * section of the cache (and it should be a write-through with identical
+        * data). From the caller's standpoint, there is no change to the state
+        * of the cache.
+        */
+       CONSUMER_METADATA_CACHE_WRITE_STATUS_NO_CHANGE,
+};
+
 struct consumer_metadata_cache {
        char *data;
        uint64_t cache_alloc_size;
@@ -45,7 +66,8 @@ struct consumer_metadata_cache {
        pthread_mutex_t lock;
 };
 
-int consumer_metadata_cache_write(struct lttng_consumer_channel *channel,
+enum consumer_metadata_cache_write_status
+consumer_metadata_cache_write(struct lttng_consumer_channel *channel,
                unsigned int offset, unsigned int len, uint64_t version,
                char *data);
 int consumer_metadata_cache_allocate(struct lttng_consumer_channel *channel);
This page took 0.02596 seconds and 4 git commands to generate.