* Re: [PATCH lttng-ust] Fix: namespace our gettid wrapper
[not found] <20190603192532.18903-1-mjeanson@efficios.com>
@ 2019-06-03 21:40 ` Mathieu Desnoyers
0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2019-06-03 21:40 UTC (permalink / raw)
To: Michael Jeanson; +Cc: lttng-dev
Merged into master, backported to 2.11, 2.10, 2.9 branches, thanks!
Mathieu
----- On Jun 3, 2019, at 3:25 PM, Michael Jeanson mjeanson@efficios.com wrote:
> Since glibc 2.30, a gettid wrapper was added that conflicts with our
> static declaration. Namespace our wrapper so there is no conflict,
> we'll add support for the glibc provided wrapper in a further commit.
>
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
> include/lttng/ust-tid.h | 12 +++++++-----
> include/usterr-signal-safe.h | 2 +-
> liblttng-ust/lttng-context-vtid.c | 2 +-
> 3 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/include/lttng/ust-tid.h b/include/lttng/ust-tid.h
> index e669d7e7..e637718a 100644
> --- a/include/lttng/ust-tid.h
> +++ b/include/lttng/ust-tid.h
> @@ -31,23 +31,25 @@
> #include <syscall.h>
> #endif
>
> -#if defined(_syscall0)
> -_syscall0(pid_t, gettid)
> -#elif defined(__NR_gettid)
> +#if defined(__NR_gettid)
> +
> #include <unistd.h>
> -static inline pid_t gettid(void)
> +static inline pid_t lttng_gettid(void)
> {
> return syscall(__NR_gettid);
> }
> +
> #else
> +
> #include <sys/types.h>
> #include <unistd.h>
>
> /* Fall-back on getpid for tid if not available. */
> -static inline pid_t gettid(void)
> +static inline pid_t lttng_gettid(void)
> {
> return getpid();
> }
> +
> #endif
>
> #endif /* _LTTNG_UST_TID_H */
> diff --git a/include/usterr-signal-safe.h b/include/usterr-signal-safe.h
> index 1df5ada0..d987c1f0 100644
> --- a/include/usterr-signal-safe.h
> +++ b/include/usterr-signal-safe.h
> @@ -95,7 +95,7 @@ do { \
> do { \
> sigsafe_print_err(UST_STR_COMPONENT "[%ld/%ld]: " fmt " (in %s() at " __FILE__
> ":" UST_XSTR(__LINE__) ")\n", \
> (long) getpid(), \
> - (long) gettid(), \
> + (long) lttng_gettid(), \
> ## args, __func__); \
> } while(0)
>
> diff --git a/liblttng-ust/lttng-context-vtid.c
> b/liblttng-ust/lttng-context-vtid.c
> index 80661f63..36e5695d 100644
> --- a/liblttng-ust/lttng-context-vtid.c
> +++ b/liblttng-ust/lttng-context-vtid.c
> @@ -63,7 +63,7 @@ pid_t wrapper_getvtid(void)
>
> vtid = CMM_LOAD_SHARED(URCU_TLS(cached_vtid));
> if (caa_unlikely(!vtid)) {
> - vtid = gettid();
> + vtid = lttng_gettid();
> CMM_STORE_SHARED(URCU_TLS(cached_vtid), vtid);
> }
> return vtid;
> --
> 2.17.1
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH lttng-ust] Fix: namespace our gettid wrapper
@ 2019-06-03 19:25 Michael Jeanson
0 siblings, 0 replies; 2+ messages in thread
From: Michael Jeanson @ 2019-06-03 19:25 UTC (permalink / raw)
To: lttng-dev
Since glibc 2.30, a gettid wrapper was added that conflicts with our
static declaration. Namespace our wrapper so there is no conflict,
we'll add support for the glibc provided wrapper in a further commit.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
include/lttng/ust-tid.h | 12 +++++++-----
include/usterr-signal-safe.h | 2 +-
liblttng-ust/lttng-context-vtid.c | 2 +-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/lttng/ust-tid.h b/include/lttng/ust-tid.h
index e669d7e7..e637718a 100644
--- a/include/lttng/ust-tid.h
+++ b/include/lttng/ust-tid.h
@@ -31,23 +31,25 @@
#include <syscall.h>
#endif
-#if defined(_syscall0)
-_syscall0(pid_t, gettid)
-#elif defined(__NR_gettid)
+#if defined(__NR_gettid)
+
#include <unistd.h>
-static inline pid_t gettid(void)
+static inline pid_t lttng_gettid(void)
{
return syscall(__NR_gettid);
}
+
#else
+
#include <sys/types.h>
#include <unistd.h>
/* Fall-back on getpid for tid if not available. */
-static inline pid_t gettid(void)
+static inline pid_t lttng_gettid(void)
{
return getpid();
}
+
#endif
#endif /* _LTTNG_UST_TID_H */
diff --git a/include/usterr-signal-safe.h b/include/usterr-signal-safe.h
index 1df5ada0..d987c1f0 100644
--- a/include/usterr-signal-safe.h
+++ b/include/usterr-signal-safe.h
@@ -95,7 +95,7 @@ do { \
do { \
sigsafe_print_err(UST_STR_COMPONENT "[%ld/%ld]: " fmt " (in %s() at " __FILE__ ":" UST_XSTR(__LINE__) ")\n", \
(long) getpid(), \
- (long) gettid(), \
+ (long) lttng_gettid(), \
## args, __func__); \
} while(0)
diff --git a/liblttng-ust/lttng-context-vtid.c b/liblttng-ust/lttng-context-vtid.c
index 80661f63..36e5695d 100644
--- a/liblttng-ust/lttng-context-vtid.c
+++ b/liblttng-ust/lttng-context-vtid.c
@@ -63,7 +63,7 @@ pid_t wrapper_getvtid(void)
vtid = CMM_LOAD_SHARED(URCU_TLS(cached_vtid));
if (caa_unlikely(!vtid)) {
- vtid = gettid();
+ vtid = lttng_gettid();
CMM_STORE_SHARED(URCU_TLS(cached_vtid), vtid);
}
return vtid;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-03 21:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20190603192532.18903-1-mjeanson@efficios.com>
2019-06-03 21:40 ` [PATCH lttng-ust] Fix: namespace our gettid wrapper Mathieu Desnoyers
2019-06-03 19:25 Michael Jeanson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.