Fix: coherent state not changed atomically with metadata written
[lttng-modules.git] / include / lttng / events.h
index 80358e920d3d7a83f646c1da63d01c5364177d59..4c376b395da8f9e22769ef5e17176aa23321d254 100644 (file)
@@ -530,7 +530,7 @@ struct lttng_metadata_cache {
        char *data;                     /* Metadata cache */
        unsigned int cache_alloc;       /* Metadata allocated size (bytes) */
        unsigned int metadata_written;  /* Number of bytes written in metadata cache */
-       int producing;                  /* Metadata being produced (incomplete) */
+       atomic_t producing;             /* Metadata being produced (incomplete) */
        struct kref refcount;           /* Metadata cache usage */
        struct list_head metadata_stream;       /* Metadata stream list */
        uuid_le uuid;                   /* Trace session unique ID (copy) */
@@ -805,6 +805,17 @@ int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx)
 }
 #endif
 
+#if defined(CONFIG_TIME_NS) && \
+       (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
+int lttng_add_time_ns_to_ctx(struct lttng_ctx **ctx);
+#else
+static inline
+int lttng_add_time_ns_to_ctx(struct lttng_ctx **ctx)
+{
+       return -ENOSYS;
+}
+#endif
+
 int lttng_add_uid_to_ctx(struct lttng_ctx **ctx);
 int lttng_add_euid_to_ctx(struct lttng_ctx **ctx);
 int lttng_add_suid_to_ctx(struct lttng_ctx **ctx);
This page took 0.024592 seconds and 4 git commands to generate.