aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-09-05 14:47:58 +0200
committerSverker Eriksson <[email protected]>2013-09-05 14:47:58 +0200
commitabba9d918ab3377a9c895e05924612724c105c26 (patch)
tree01aadc96a20ac733ef6d3fcb19b2be8821c6f86a /erts
parent327a59841c5fba85d49492fc86186f79ef4d60ca (diff)
parentf47f8e3813a6dda5db94c9704c74e8a809dd2313 (diff)
downloadotp-abba9d918ab3377a9c895e05924612724c105c26.tar.gz
otp-abba9d918ab3377a9c895e05924612724c105c26.tar.bz2
otp-abba9d918ab3377a9c895e05924612724c105c26.zip
Merge branch 'sverk/valgrind-single-core' into maint
* sverk/valgrind-single-core: erts: Speed up valgrind with asynch threads
Diffstat (limited to 'erts')
-rw-r--r--erts/etc/unix/cerl.src15
1 files changed, 14 insertions, 1 deletions
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index 0d45917e4b..41baa323ed 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -283,6 +283,19 @@ if [ "x$GDB" = "x" ]; then
else
valgrind_misc_flags="$VALGRIND_MISC_FLAGS"
fi
+ if which taskset > /dev/null && test -e /proc/cpuinfo; then
+ # We only let valgrind utilize one core with "taskset 1" as it can be very slow
+ # on multiple cores (especially with async threads). Valgrind only run one pthread
+ # at a time anyway so there is no point letting it utilize more than one core.
+ # Use $sched_arg to force all schedulers online to emulate multicore.
+ taskset1="taskset 1"
+ ncpu=`cat /proc/cpuinfo | grep -w processor | wc -l`
+ sched_arg="-S$ncpu:$ncpu"
+ else
+ taskset1=
+ sched_arg=
+ fi
+
beam_args=`$EXEC -emu_args_exit ${1+"$@"}`
# Time for some argument passing voodoo:
@@ -293,7 +306,7 @@ if [ "x$GDB" = "x" ]; then
'
set -- $beam_args
IFS="$SAVE_IFS"
- exec valgrind $valgrind_xml $valgrind_log $valgrind_misc_flags $BINDIR/$EMU_NAME $emu_xargs "$@" -pz $PRELOADED
+ exec $taskset1 valgrind $valgrind_xml $valgrind_log $valgrind_misc_flags $BINDIR/$EMU_NAME $sched_arg $emu_xargs "$@" -pz $PRELOADED
else
exec $EXEC $eeargs $xargs ${1+"$@"}
fi