summaryrefslogtreecommitdiff
path: root/erts/etc/unix/cerl.src
diff options
context:
space:
mode:
Diffstat (limited to 'erts/etc/unix/cerl.src')
-rw-r--r--erts/etc/unix/cerl.src9
1 files changed, 7 insertions, 2 deletions
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index 59de9bdec8..d85a36acd4 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -315,8 +315,13 @@ if [ "x$GDB" = "x" ]; then
ncpu=`cat /proc/cpuinfo | grep -w processor | wc -l`
# Choose a random core in order to not collide with any other valgrind
# run on the same machine.
- taskset1=$((1 << (`shuf -i 1-$ncpu -n 1` - 1) ))
- taskset1="taskset $taskset1"
+ cpu=`shuf -i 1-$ncpu -n 1`
+ mask=1
+ while [ $cpu -gt 1 ]; do
+ mask=`expr $mask \* 2`
+ cpu=`expr $cpu - 1`
+ done
+ taskset1="taskset $mask"
sched_arg="-S$ncpu:$ncpu"
else
taskset1=