Fix benchmark scripts to run on Mac OS X

- perf: bypass the regex interpreting error of 'sed'.
- rss-measure: use alternative way to measure approx. RSS.

JerryScript-DCO-1.0-Signed-off-by: Sung-Jae Lee sjlee@mail.com
This commit is contained in:
Sung-Jae Lee
2015-09-21 11:48:14 +09:00
parent 66975236bc
commit a007b6800c
3 changed files with 21 additions and 4 deletions
+7 -1
View File
@@ -17,6 +17,7 @@
JERRY=$1
TEST=$2
SLEEP=0.1
OS=`uname -s | tr [:upper:] [:lower:]`
Rss_OUT=""
@@ -25,7 +26,12 @@ function collect_entry()
OUT_NAME="$1_OUT";
OUT=$OUT_NAME;
SUM=$(grep -o -e "^[0-9a-f][0-9a-f]*.*" -e "^Rss.*" /proc/$PID/smaps 2>/dev/null | grep -A 1 -- "r[w-]-p " | grep "^Rss"|awk '{s += $2;} END {print s;}')
if [ "$OS" == "darwin" ]
then
SUM=`ps -o rss $PID | grep [0-9]`
else
SUM=$(grep -o -e "^[0-9a-f][0-9a-f]*.*" -e "^Rss.*" /proc/$PID/smaps 2>/dev/null | grep -A 1 -- "r[w-]-p " | grep "^Rss"|awk '{s += $2;} END {print s;}')
fi;
if [ "$SUM" != "" ];
then