Revert "Compat layer for gettid"
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Feb 2012 22:10:29 +0000 (17:10 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Feb 2012 22:10:29 +0000 (17:10 -0500)
This reverts commit 36e2ba2a19ec6698ed8dfb8c9bde683368334372.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/Makefile.am
include/lttng/ust-tid.h [deleted file]
include/usterr-signal-safe.h
include/usterr.h
liblttng-ust/lttng-context-vtid.c

index 571e32f92066d4a6f582f448195b8d67e7f623c6..66b9ab0a043e6798768384d5bfa736e5780a50fe 100644 (file)
@@ -25,7 +25,6 @@ noinst_HEADERS = \
        usterr-signal-safe.h \
        ust_snprintf.h \
        ust-comm.h \
-       lttng/ust-tid.h \
        lttng/bitfield.h \
        helper.h \
        share.h
diff --git a/include/lttng/ust-tid.h b/include/lttng/ust-tid.h
deleted file mode 100644 (file)
index c6819f2..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef _LTTNG_UST_TID_H
-#define _LTTNG_UST_TID_H
-
-/*
- * lttng/ust-tid.h
- *
- * Copyright 2012 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * gettid compatibility layer.
- *
- * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
- * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
- *
- * Permission is hereby granted to use or copy this program
- * for any purpose,  provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is granted,
- * provided the above notices are retained, and a notice that the code was
- * modified is included with the above copyright notice.
- */
-
-#ifdef __linux__
-#include <syscall.h>
-#endif
-
-#if defined(_syscall0)
-_syscall0(pid_t, gettid)
-#elif defined(__NR_gettid)
-#include <unistd.h>
-static inline pid_t gettid(void)
-{
-       return syscall(__NR_gettid);
-}
-#else
-#include <sys/types.h>
-#include <unistd.h>
-
-#warning "use pid as tid"
-static inline pid_t gettid(void)
-{
-       return getpid();
-}
-#endif
-
-#endif /* _LTTNG_UST_TID_H */
index d46b0f6a7af8929fbd9296dfc3bf29d37bdf179d..375eff7c569b63d5794a6cc7932de4da81548499 100644 (file)
@@ -26,8 +26,8 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
+
 #include <share.h>
-#include "lttng/ust-tid.h"
 
 enum ust_loglevel {
        UST_LOGLEVEL_UNKNOWN = 0,
@@ -85,7 +85,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) syscall(SYS_gettid),     \
                ## args, __func__);             \
                fflush(stderr);                 \
        } while(0)
index 86c9bf866a256dcff7f2b2ae6bf9893381db702a..35d576ec1815ab755cd80b8a8b2659fbacfe62ee 100644 (file)
@@ -27,7 +27,6 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#include "lttng/ust-tid.h"
 #include "share.h"
 
 enum ust_loglevel {
@@ -58,7 +57,7 @@ static inline int ust_debug(void)
        do {                                                    \
                fprintf(stderr, UST_STR_COMPONENT "[%ld/%ld]: " fmt " (in %s() at " __FILE__ ":" XSTR(__LINE__) ")\n",                          \
                        (long) getpid(),                        \
-                       (long) gettid(),                        \
+                       (long) syscall(SYS_gettid),             \
                        ## args,                                \
                        __func__);                              \
        } while(0)
index 3fe86405c112307a47e6c1abe0a9c62fe8b2175b..6f7e078d22d2910072748adfd0ee59b8c9a695b4 100644 (file)
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-tid.h>
+
+#ifdef __linux__
+#include <syscall.h>
+#endif
+
+#if defined(_syscall0)
+_syscall0(pid_t, gettid)
+#elif defined(__NR_gettid)
+static inline pid_t gettid(void)
+{
+       return syscall(__NR_gettid);
+}
+#else
+#warning "use pid as tid"
+static inline pid_t gettid(void)
+{
+       return getpid();
+}
+#endif
 
 /*
  * We cache the result to ensure we don't trigger a system call for
This page took 0.028098 seconds and 4 git commands to generate.