aboutsummaryrefslogtreecommitdiffstats
path: root/erts/aclocal.m4
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-05-15 16:32:26 +0200
committerLukas Larsson <[email protected]>2018-05-15 16:36:48 +0200
commitd5dc5584884488c8fcb5710997a14c2c418692f3 (patch)
tree1058b4ef8953d6b814d898b890873ae2627a16d3 /erts/aclocal.m4
parent3b3e2f46841e3e86c991be92d62cbb0360ca80e3 (diff)
downloadotp-d5dc5584884488c8fcb5710997a14c2c418692f3.tar.gz
otp-d5dc5584884488c8fcb5710997a14c2c418692f3.tar.bz2
otp-d5dc5584884488c8fcb5710997a14c2c418692f3.zip
erts: Make cpu_timestamp use per thread on Linux
If we don't use per thread the value becomes completely nonsensical on systems with more than one scheduler. We keep the old solaris behaviour in order to support the option, but it only really works when using a single scheduler.
Diffstat (limited to 'erts/aclocal.m4')
-rw-r--r--erts/aclocal.m48
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index a4d09810bd..99b96eb5bc 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -2645,7 +2645,7 @@ case $erl_gethrvtime in
dnl Check if clock_gettime (linux) is working
dnl
- AC_MSG_CHECKING([if clock_gettime can be used to get process CPU time])
+ AC_MSG_CHECKING([if clock_gettime can be used to get thread CPU time])
save_libs=$LIBS
LIBS="-lrt"
AC_TRY_RUN([
@@ -2659,11 +2659,11 @@ case $erl_gethrvtime in
int i;
struct timespec tp;
- if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp) < 0)
+ if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp) < 0)
exit(1);
start = ((long long)tp.tv_sec * 1000000000LL) + (long long)tp.tv_nsec;
for (i = 0; i < 100; i++)
- clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp);
+ clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp);
stop = ((long long)tp.tv_sec * 1000000000LL) + (long long)tp.tv_nsec;
if (start == 0)
exit(4);
@@ -2686,7 +2686,7 @@ case $erl_gethrvtime in
case $erl_clock_gettime_cpu_time in
yes)
AC_DEFINE(HAVE_CLOCK_GETTIME_CPU_TIME,[],
- [define if clock_gettime() works for getting process time])
+ [define if clock_gettime() works for getting thread time])
LIBRT=-lrt
;;
cross)