X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-context-vtid.c;h=9aa36c6c55a30e999c9f60fb3fb7dc88392a8139;hb=1abcee5dc89230e8f9dca4b961e978fe6ac44954;hp=6f7e078d22d2910072748adfd0ee59b8c9a695b4;hpb=69400ac4a4e6575f749c6326df7c2a2c8ac3bdc5;p=lttng-ust.git diff --git a/liblttng-ust/lttng-context-vtid.c b/liblttng-ust/lttng-context-vtid.c index 6f7e078d..9aa36c6c 100644 --- a/liblttng-ust/lttng-context-vtid.c +++ b/liblttng-ust/lttng-context-vtid.c @@ -1,10 +1,23 @@ /* - * (C) Copyright 2009-2011 - - * Mathieu Desnoyers + * lttng-context-vtid.c * * LTTng UST vtid context. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2009-2012 Mathieu Desnoyers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; only + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -12,6 +25,8 @@ #include #include #include +#include "ltt-tracer-core.h" +#include #ifdef __linux__ #include @@ -31,6 +46,7 @@ static inline pid_t gettid(void) return getpid(); } #endif +======= end /* * We cache the result to ensure we don't trigger a system call for @@ -92,3 +108,11 @@ int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx) field->record = vtid_record; return 0; } + +/* + * Force a read (imply TLS fixup for dlopen) of TLS variables. + */ +void lttng_fixup_vtid_tls(void) +{ + asm volatile ("" : : "m" (cached_vtid)); +}