aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-08-22 11:30:29 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-08-22 16:08:00 +0200
commit326511906e3587e0f5590aa3e23a7109e9170010 (patch)
treed1fd4f762deb42e557c8b2effe37a8762a8a17dd
parent060edd1af805edde02491a93319e64fa1278c117 (diff)
downloadallocbench-326511906e3587e0f5590aa3e23a7109e9170010.tar.gz
allocbench-326511906e3587e0f5590aa3e23a7109e9170010.zip
return requested_size as numpy array and plot memory in KB
-rw-r--r--src/chattyparser.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/chattyparser.py b/src/chattyparser.py
index 89ab441..8eba3a2 100644
--- a/src/chattyparser.py
+++ b/src/chattyparser.py
@@ -1,5 +1,6 @@
import re
import matplotlib.pyplot as plt
+import numpy as np
ptr = "(?:0x)?(?P<ptr>(?:\w+)|(?:\(nil\)))"
size = "(?P<size>\d+)"
@@ -115,7 +116,7 @@ def parse(path="chattymalloc.txt", coll_size=True, req_size=None, nohist=False):
if not valid_line:
print("\ninvalid line at", ln, ":", l)
- return hist, calls, requested_size
+ return hist, calls, np.array(requested_size)
def plot(path):
@@ -133,14 +134,14 @@ def plot(path):
def plot_profile(total_sizes, trace_path, plot_path, sizes):
x_vals = range(0, len(total_sizes))
- plt.plot(x_vals, total_sizes, marker='',
+ plt.plot(x_vals, total_sizes / 1000, marker='',
linestyle='-', label="Total requested")
for s in sizes:
_, _, total_size = parse(path=trace_path, nohist=True, req_size=s)
- plt.plot(x_vals, total_size, label=s)
+ plt.plot(x_vals, total_size / 1000, label=s)
- plt.legend()
+ plt.legend(loc="lower center")
plt.xlabel("Allocations")
plt.ylabel("mem in kb")
plt.title("Memusage profile")