aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-03-06 12:19:40 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-03-06 12:19:40 +0100
commit6027198427d77ae48932104eed2615968ae74616 (patch)
tree3b1ce5d47685703311fea8fef4a2544e3ab7786a
parent4a735ff18724789c1c5d599b8e6a4d0b53103518 (diff)
downloadallocbench-6027198427d77ae48932104eed2615968ae74616.tar.gz
allocbench-6027198427d77ae48932104eed2615968ae74616.zip
use timestamps in allocator build system
-rw-r--r--src/allocator.py6
-rw-r--r--src/globalvars.py11
2 files changed, 14 insertions, 3 deletions
diff --git a/src/allocator.py b/src/allocator.py
index 7887272..bb5106a 100644
--- a/src/allocator.py
+++ b/src/allocator.py
@@ -15,7 +15,7 @@ for l in subprocess.run(["ldconfig", "-v"], stdout=subprocess.PIPE,
if not l.startswith('\t'):
library_path += l
-builddir = os.path.join(os.getcwd(), "build", "allocators")
+builddir = os.path.join(src.globalvars.builddir, "allocators")
srcdir = os.path.join(builddir, "src")
if not os.path.isdir(srcdir):
@@ -104,7 +104,7 @@ class Allocator (object):
print_info2("Old build found. Comparing build time with mtime")
with open(buildtimestamp_file, "r") as f:
- timestamp = datetime.fromisoformat(f.read())
+ timestamp = datetime.fromtimestamp(float(f.read()))
# print(globals())
modtime = os.stat(os.path.realpath(src.globalvars.allocators_file)).st_mtime
@@ -141,7 +141,7 @@ class Allocator (object):
with open(buildtimestamp_file, "w") as f:
print_info2("Save build time to:", buildtimestamp_file)
- f.write(str(datetime.now().isoformat()))
+ f.write(str(datetime.now().timestamp()))
print_info2("Create allocator dictionary")
for attr in ["LD_PRELOAD", "cmd_prefix"]:
diff --git a/src/globalvars.py b/src/globalvars.py
index afc8bf6..fb80a26 100644
--- a/src/globalvars.py
+++ b/src/globalvars.py
@@ -1,3 +1,14 @@
+import os
+
+
+"""Dict holding facts about the current benchmark run"""
+facts = {}
+
+"""Verbosity level -1: quiet, 0: status, 1: info, 2: stdout of subcommands, 3: debug info"""
verbosity = 0
+"""File were the allocators definitions are loaded from"""
allocators_file = None
+
+"""Path of the build directory"""
+builddir = os.path.join(os.getcwd(), "build")