aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile13
-rwxr-xr-xbench.py12
-rw-r--r--src/__init__.py0
-rw-r--r--src/benchmarks/bench_loop.c (renamed from benchmarks/bench_loop.c)0
-rw-r--r--src/benchmarks/cache-scratch.cc (renamed from benchmarks/cache-scratch.cc)0
-rw-r--r--src/benchmarks/cache-thrash.cc (renamed from benchmarks/cache-thrash.cc)0
-rw-r--r--src/benchmarks/cpuinfo.h (renamed from benchmarks/cpuinfo.h)0
-rw-r--r--src/benchmarks/fred.h (renamed from benchmarks/fred.h)0
-rw-r--r--src/benchmarks/larson.cc (renamed from benchmarks/larson.cc)0
-rw-r--r--src/benchmarks/timer.h (renamed from benchmarks/timer.h)0
-rw-r--r--src/chattymalloc.c (renamed from chattymalloc.c)0
-rw-r--r--src/chattyparser.py (renamed from chattyparser.py)0
-rw-r--r--src/larson.py (renamed from larson.py)2
-rw-r--r--src/print_status_on_exit.c (renamed from print_status_on_exit.c)0
-rw-r--r--src/trace_run.c (renamed from trace_run.c)0
16 files changed, 13 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index ec1e700..87a4c50 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
build/*
+results/*
*.png
-__pycache__/*
+*/__pycache__/*
.gdb_history
*.save
*.data
diff --git a/Makefile b/Makefile
index 5c37556..3f06d6c 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,10 @@
.DEFAULT_GOAL = all
-SRCDIR=benchmarks
-BENCH_C_SOURCES = $(shell find $(SRCDIR) -name "*.c")
-BENCH_CC_SOURCES = $(shell find $(SRCDIR) -name "*.cc")
+SRCDIR=src/
+BENCHSRCDIR=$(SRCDIR)/benchmarks
+BENCH_C_SOURCES = $(shell find $(BENCHSRCDIR) -name "*.c")
+BENCH_CC_SOURCES = $(shell find $(BENCHSRCDIR) -name "*.cc")
OBJDIR = ./build
@@ -34,13 +35,13 @@ NOTC_TARGETS = $(BENCH_TARGETS:=-glibc-notc)
all: $(BENCH_TARGETS) $(NOTC_TARGETS) $(OBJDIR)/chattymalloc.so $(OBJDIR)/print_status_on_exit.so
-$(OBJDIR)/print_status_on_exit.so: print_status_on_exit.c $(MAKEFILE_LIST)
+$(OBJDIR)/print_status_on_exit.so: $(SRCDIR)/print_status_on_exit.c $(MAKEFILE_LIST)
$(CC) -shared $(CFLAGS) -o $@ $< -ldl
-$(OBJDIR)/chattymalloc.so: chattymalloc.c $(MAKEFILE_LIST)
+$(OBJDIR)/chattymalloc.so: $(SRCDIR)/chattymalloc.c $(MAKEFILE_LIST)
$(CC) -shared $(CFLAGS) -o $@ $< -ldl
-$(OBJDIR)/trace_run: trace_run.c $(MAKEFILE_LIST)
+$(OBJDIR)/trace_run: $(SRCDIR)/trace_run.c $(MAKEFILE_LIST)
$(CC) -pthread $(CFLAGS) -o $@ $<
$(OBJDIR)/trace_run-glibc-notc: $(OBJDIR)/trace_run $(MAKEFILE_LIST)
diff --git a/bench.py b/bench.py
index 2f23b31..93535b4 100755
--- a/bench.py
+++ b/bench.py
@@ -1,17 +1,10 @@
#!/usr/bin/env python3
import argparse
+import importlib
import os
-import common_targets
-
-from falsesharing import falsesharing
-from loop import loop
-from mysql import mysql
-from dj_trace import dj_trace
-from larson import larson
-
-benchmarks = [loop, mysql, falsesharing, dj_trace, larson]
+benchmarks = ["loop", "mysql", "falsesharing", "dj_trace", "larson"]
parser = argparse.ArgumentParser(description="benchmark memory allocators")
parser.add_argument("-s", "--save", help="save benchmark results to disk", action='store_true')
@@ -32,6 +25,7 @@ def main():
os.makedirs(args.summarydir)
for bench in benchmarks:
+ bench = eval("importlib.import_module('src.{0}').{0}".format(bench))
if args.benchmarks and not bench.name in args.benchmarks:
continue
if args.load:
diff --git a/src/__init__.py b/src/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/__init__.py
diff --git a/benchmarks/bench_loop.c b/src/benchmarks/bench_loop.c
index bc15808..bc15808 100644
--- a/benchmarks/bench_loop.c
+++ b/src/benchmarks/bench_loop.c
diff --git a/benchmarks/cache-scratch.cc b/src/benchmarks/cache-scratch.cc
index 2cb9b28..2cb9b28 100644
--- a/benchmarks/cache-scratch.cc
+++ b/src/benchmarks/cache-scratch.cc
diff --git a/benchmarks/cache-thrash.cc b/src/benchmarks/cache-thrash.cc
index 79242eb..79242eb 100644
--- a/benchmarks/cache-thrash.cc
+++ b/src/benchmarks/cache-thrash.cc
diff --git a/benchmarks/cpuinfo.h b/src/benchmarks/cpuinfo.h
index 1ed1f36..1ed1f36 100644
--- a/benchmarks/cpuinfo.h
+++ b/src/benchmarks/cpuinfo.h
diff --git a/benchmarks/fred.h b/src/benchmarks/fred.h
index b0198a7..b0198a7 100644
--- a/benchmarks/fred.h
+++ b/src/benchmarks/fred.h
diff --git a/benchmarks/larson.cc b/src/benchmarks/larson.cc
index be8038f..be8038f 100644
--- a/benchmarks/larson.cc
+++ b/src/benchmarks/larson.cc
diff --git a/benchmarks/timer.h b/src/benchmarks/timer.h
index d4d42c7..d4d42c7 100644
--- a/benchmarks/timer.h
+++ b/src/benchmarks/timer.h
diff --git a/chattymalloc.c b/src/chattymalloc.c
index 54708d6..54708d6 100644
--- a/chattymalloc.c
+++ b/src/chattymalloc.c
diff --git a/chattyparser.py b/src/chattyparser.py
index 3406b44..3406b44 100644
--- a/chattyparser.py
+++ b/src/chattyparser.py
diff --git a/larson.py b/src/larson.py
index f915495..713818b 100644
--- a/larson.py
+++ b/src/larson.py
@@ -1,7 +1,7 @@
import multiprocessing
import re
-from benchmark import Benchmark
+from src.benchmark import Benchmark
throughput_re = re.compile("^Throughput =\s*(?P<throughput>\d+) operations per second.$")
diff --git a/print_status_on_exit.c b/src/print_status_on_exit.c
index 1d72384..1d72384 100644
--- a/print_status_on_exit.c
+++ b/src/print_status_on_exit.c
diff --git a/trace_run.c b/src/trace_run.c
index 604d01e..604d01e 100644
--- a/trace_run.c
+++ b/src/trace_run.c