aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-08-19 16:15:32 +0200
committerRickard Green <[email protected]>2015-08-21 10:01:08 +0200
commit08f8b454596d51de367e5559b7104300c2a7b954 (patch)
tree3ba3c8b7c6bfe777ea0b799650ec353e81682a3a
parent61828f77ca2542109ece006d730a4f8fe3300616 (diff)
downloadotp-08f8b454596d51de367e5559b7104300c2a7b954.tar.gz
otp-08f8b454596d51de367e5559b7104300c2a7b954.tar.bz2
otp-08f8b454596d51de367e5559b7104300c2a7b954.zip
Improve choice of clock sources at build time
- Documented the configure switch --with-clock-resolution=<RES> - Changed default clock source for OS system time on Darwin to gettimeofday(). In order to use clock_get_time(CALENDER_CLOCK, ...) on Darwin, the user has to pass --with-clock-resolution=high when configuring the build.
-rw-r--r--HOWTO/INSTALL.md4
-rw-r--r--erts/aclocal.m421
2 files changed, 16 insertions, 9 deletions
diff --git a/HOWTO/INSTALL.md b/HOWTO/INSTALL.md
index 837e6cbd76..6434eda253 100644
--- a/HOWTO/INSTALL.md
+++ b/HOWTO/INSTALL.md
@@ -406,6 +406,10 @@ Some of the available `configure` options are:
time source with elapsed time during suspend.
* `--disable-prefer-elapsed-monotonic-time-during-suspend` - Do not prefer an OS
monotonic time source with elapsed time during suspend.
+* `--with-clock-resolution=high|low` - Try to find clock sources for OS system
+ time, and OS monotonic time with higher or lower resolution than chosen by
+ default. Note that both alternatives may have a negative impact on the performance
+ and scalability compared to the default clock sources chosen.
* `--enable-dirty-schedulers` - Enable the **experimental** dirty schedulers
functionality. Note that the dirty schedulers functionality is experimental,
and **not supported**. This functionality **will** be subject to backward
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index 0714ce6030..7634cc0228 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -940,16 +940,16 @@ AC_DEFUN(ERL_WALL_CLOCK,
erl_wall_clock_low_resolution=no
erl_wall_clock_id=
- case $erl_cv_clock_gettime_wall_$1-$erl_cv_mach_clock_get_time_wall-$ac_cv_func_gettimeofday-$host_os in
- *-*-*-win32)
+ case $1-$erl_cv_clock_gettime_wall_$1-$erl_cv_mach_clock_get_time_wall-$ac_cv_func_gettimeofday-$host_os in
+ *-*-*-*-win32)
erl_wall_clock_func=WindowsAPI
erl_wall_clock_low_resolution=yes
;;
- no-yes-*-*)
+ high_resolution-no-yes-*-*)
erl_wall_clock_func=mach_clock_get_time
erl_wall_clock_id=CALENDAR_CLOCK
;;
- CLOCK_*-*-*-*)
+ *-CLOCK_*-*-*-*)
erl_wall_clock_func=clock_gettime
erl_wall_clock_id=$erl_cv_clock_gettime_wall_$1
for low_res_id in $low_resolution_clock_gettime_wall; do
@@ -959,7 +959,7 @@ AC_DEFUN(ERL_WALL_CLOCK,
fi
done
;;
- no-no-yes-*)
+ *-no-*-yes-*)
erl_wall_clock_func=gettimeofday
;;
*)
@@ -2219,10 +2219,10 @@ AS_HELP_STRING([--with-clock-gettime-monotonic-id=CLOCKID],
[specify clock id to use with clock_gettime() for monotonic time)]))
AC_ARG_ENABLE(prefer-elapsed-monotonic-time-during-suspend,
- AS_HELP_STRING([--enable-prefer-elapsed-monotonic-time-during-suspend],
- [Prefer an OS monotonic time source with elapsed time during suspend])
- AS_HELP_STRING([--disable-prefer-elapsed-monotonic-time-during-suspend],
- [Do not prefer an OS monotonic time source with elapsed time during suspend]),
+AS_HELP_STRING([--enable-prefer-elapsed-monotonic-time-during-suspend],
+ [Prefer an OS monotonic time source with elapsed time during suspend])
+AS_HELP_STRING([--disable-prefer-elapsed-monotonic-time-during-suspend],
+ [Do not prefer an OS monotonic time source with elapsed time during suspend]),
[ case "$enableval" in
yes) prefer_elapsed_monotonic_time_during_suspend=yes ;;
*) prefer_elapsed_monotonic_time_during_suspend=no ;;
@@ -2296,6 +2296,9 @@ case "$erl_wall_clock_func-$erl_wall_clock_id-$with_clock_gettime_realtime_id" i
esac
case $erl_wall_clock_func in
+ none)
+ AC_MSG_ERROR([No wall clock source found])
+ ;;
mach_clock_get_time)
AC_DEFINE(OS_SYSTEM_TIME_USING_MACH_CLOCK_GET_TIME, [1], [Define if you want to implement erts_os_system_time() using mach clock_get_time()])
;;