aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-07-20 12:31:04 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-07-20 12:51:38 +0200
commite0666c6466b01498e578a6eabcd1c536c8375090 (patch)
tree0549583818884fa2c0137986e34d56dfc1515082
parent98ffb2ff73ed532884dad86e9210f6cee4ab1e8a (diff)
downloadallocbench-e0666c6466b01498e578a6eabcd1c536c8375090.tar.gz
allocbench-e0666c6466b01498e578a6eabcd1c536c8375090.zip
[make] use python to calculate total available memory
-rw-r--r--allocbench/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/allocbench/Makefile b/allocbench/Makefile
index 4d67fbf..3d6c94b 100644
--- a/allocbench/Makefile
+++ b/allocbench/Makefile
@@ -10,7 +10,8 @@ CFLAGS ?= $(OPTFLAGS) $(WARNFLAGS) $(COMMONFLAGS)
LDFLAGS ?= -pthread -static-libgcc
-MEMSIZE_KB=$(shell grep -E "MemTotal|SwapTotal" /proc/meminfo | grep -o "[0-9]*" | paste -sd+ | bc)
+MEMSIZE_KB=$(shell grep -E "MemTotal|SwapTotal" /proc/meminfo | grep -o "[0-9]*"\
+ | python -c "import sys; print(sum([int(x) for x in sys.stdin.readlines()]))")
MEMSIZE="$(MEMSIZE_KB) * 1024l"
TOOLS = print_status_on_exit.so exec sig_handlers.so