void lttng_destroy_context(struct lttng_ctx *ctx);
int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx);
int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx);
+void lttng_context_vtid_reset(void);
#endif /* _UST_LTTNG_EVENTS_H */
*/
static __thread pid_t cached_vtid;
+/*
+ * Upon fork or clone, the TID assigned to our thread is not the same as
+ * we kept in cache. Luckily, we are the only thread surviving in the
+ * child process, so we can simply clear our cached version.
+ */
+void lttng_context_vtid_reset(void)
+{
+ cached_vtid = 0;
+}
+
static
size_t vtid_get_size(size_t offset)
{
#include <urcu/futex.h>
#include <lttng-ust-comm.h>
+#include <ust/lttng-events.h>
#include <ust/usterr-signal-safe.h>
#include <ust/lttng-ust-abi.h>
#include <ust/tracepoint.h>
/* Release urcu mutexes */
rcu_bp_after_fork_child();
lttng_ust_cleanup(0);
+ lttng_context_vtid_reset();
/* Release mutexes and reenable signals */
ust_after_fork_common(fork_info);
lttng_ust_init();