X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust-libc-wrapper%2Flttng-ust-pthread.c;h=06bf791b20c2c66f6b3a6b95f3f11dbc99c53be0;hb=7433d32d5a8f0e8833461b586a8c8b2274da0141;hp=fd3af1105a961422e276671a483b18c81a80389a;hpb=35176231371af091768378a09d28c556bfe7e663;p=lttng-ust.git diff --git a/liblttng-ust-libc-wrapper/lttng-ust-pthread.c b/liblttng-ust-libc-wrapper/lttng-ust-pthread.c index fd3af110..06bf791b 100644 --- a/liblttng-ust-libc-wrapper/lttng-ust-pthread.c +++ b/liblttng-ust-libc-wrapper/lttng-ust-pthread.c @@ -1,23 +1,16 @@ /* - * Copyright (C) 2013 Mentor Graphics - * - * 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; either - * version 2.1 of the License, or (at your option) any later version. - * - * 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. + * SPDX-License-Identifier: LGPL-2.1-or-later * - * 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 + * Copyright (C) 2013 Mentor Graphics */ -#define _GNU_SOURCE -#include +/* + * Do _not_ define _LGPL_SOURCE because we don't want to create a + * circular dependency loop between this malloc wrapper, liburcu and + * libc. + */ +#include +#include #include #define TRACEPOINT_DEFINE @@ -48,10 +41,10 @@ int pthread_mutex_lock(pthread_mutex_t *mutex) thread_in_trace = 1; tracepoint(lttng_ust_pthread, pthread_mutex_lock_req, mutex, - __builtin_return_address(0)); + LTTNG_UST_CALLER_IP()); retval = mutex_lock(mutex); tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex, - retval, __builtin_return_address(0)); + retval, LTTNG_UST_CALLER_IP()); thread_in_trace = 0; return retval; } @@ -78,7 +71,7 @@ int pthread_mutex_trylock(pthread_mutex_t *mutex) thread_in_trace = 1; retval = mutex_trylock(mutex); tracepoint(lttng_ust_pthread, pthread_mutex_trylock, mutex, - retval, __builtin_return_address(0)); + retval, LTTNG_UST_CALLER_IP()); thread_in_trace = 0; return retval; } @@ -105,7 +98,7 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex) thread_in_trace = 1; retval = mutex_unlock(mutex); tracepoint(lttng_ust_pthread, pthread_mutex_unlock, mutex, - retval, __builtin_return_address(0)); + retval, LTTNG_UST_CALLER_IP()); thread_in_trace = 0; return retval; }