Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
90adf2aa
Commit
90adf2aa
authored
May 26, 2021
by
Daniel Black
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perfschema: use glibc gettid if available
parent
68eac8a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
cmake/os/WindowsCache.cmake
cmake/os/WindowsCache.cmake
+1
-0
storage/perfschema/CMakeLists.txt
storage/perfschema/CMakeLists.txt
+3
-0
storage/perfschema/my_thread.h
storage/perfschema/my_thread.h
+7
-4
storage/perfschema/pfs_config.h.cmake
storage/perfschema/pfs_config.h.cmake
+1
-0
No files found.
cmake/os/WindowsCache.cmake
View file @
90adf2aa
...
...
@@ -322,6 +322,7 @@ SET(HAVE_SCHED_GETCPU CACHE INTERNAL "")
SET
(
HAVE_NANOSLEEP CACHE INTERNAL
""
)
SET
(
HAVE_PTHREAD_THREADID_NP CACHE INTERNAL
""
)
SET
(
HAVE_SYS_GETTID CACHE INTERNAL
""
)
SET
(
HAVE_GETTID CACHE INTERNAL
""
)
SET
(
HAVE_INTEGER_PTHREAD_SELF CACHE INTERNAL
""
)
SET
(
HAVE_PTHREAD_GETTHREADID_NP CACHE INTERNAL
""
)
SET
(
HAVE_TIMER_DELETE CACHE INTERNAL
""
)
...
...
storage/perfschema/CMakeLists.txt
View file @
90adf2aa
...
...
@@ -290,6 +290,9 @@ int main(int ac, char **av)
}"
HAVE_PTHREAD_THREADID_NP
)
# gettid() library function (glibc-2.30+)
CHECK_SYMBOL_EXISTS
(
gettid unistd.h HAVE_GETTID
)
# Check for gettid() system call
CHECK_C_SOURCE_COMPILES
(
"
#include <sys/types.h>
...
...
storage/perfschema/my_thread.h
View file @
90adf2aa
...
...
@@ -50,12 +50,14 @@ static inline my_thread_os_id_t my_thread_os_id()
pthread_threadid_np
(
nullptr
,
&
tid64
);
return
(
pid_t
)
tid64
;
#else
#ifdef HAVE_GETTID
/* Linux glibc-2.30+ */
return
gettid
();
#else
#ifdef HAVE_SYS_GETTID
/*
Linux
.
Linux
before glibc-2.30
See man gettid
See GLIBC Bug 6399 - gettid() should have a wrapper
https://sourceware.org/bugzilla/show_bug.cgi?id=6399
*/
return
syscall
(
SYS_gettid
);
#else
...
...
@@ -82,7 +84,8 @@ static inline my_thread_os_id_t my_thread_os_id()
#endif
/* HAVE_PTHREAD_GETTHREADID_NP */
#endif
/* _WIN32 */
#endif
/* HAVE_SYS_GETTID */
#endif
/* HAVE_SYS_THREAD_SELFID */
#endif
/* HAVE_GETTID */
#endif
/* HAVE_PTHREAD_THREADID_NP */
}
#define CHANNEL_NAME_LENGTH MAX_CONNECTION_NAME
...
...
storage/perfschema/pfs_config.h.cmake
View file @
90adf2aa
#cmakedefine HAVE_PTHREAD_THREADID_NP 1
#cmakedefine HAVE_SYS_GETTID 1
#cmakedefine HAVE_GETTID
#cmakedefine HAVE_GETTHRID 1
#cmakedefine HAVE_PTHREAD_GETTHREADID_NP 1
#cmakedefine HAVE_INTEGER_PTHREAD_SELF 1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment