Reproduce certs, fixes
This commit is contained in:
parent
5d4d3e8672
commit
aa3bb124fc
5 changed files with 266 additions and 56 deletions
29
plots.py
29
plots.py
|
|
@ -54,7 +54,7 @@ COL = {
|
|||
# Physical units by object
|
||||
UNIT = {
|
||||
"cpu": "s",
|
||||
"energy": "W",
|
||||
"energy": "J",
|
||||
"profile": "samples",
|
||||
}
|
||||
# Titles for criteria
|
||||
|
|
@ -115,6 +115,7 @@ def gnuplot_stacked_histogram(**kwargs):
|
|||
kwargs["machine"] = ", " + kwargs["machine"]
|
||||
else:
|
||||
kwargs["machine"] = ""
|
||||
titleline = ""
|
||||
if kwargs["maketitle"]:
|
||||
titleline = 'set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side}{machine}) ({unit})"'.format(**kwargs)
|
||||
cluster = ""
|
||||
|
|
@ -155,14 +156,19 @@ def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version
|
|||
impls = []
|
||||
plain_line = None
|
||||
idle_val = None
|
||||
conv_factor = 1.0
|
||||
if obj == "energy":
|
||||
# Convert Wh to Ws
|
||||
conv_factor = 3600.0
|
||||
|
||||
for log in logs:
|
||||
if log["exp"] == "idle":
|
||||
idle_val = float(log[COL[obj]]) / float(log["time"])
|
||||
idle_val = float(log[COL[obj]]) / float(log["time"]) * conv_factor
|
||||
if log["exp"] != exp or log["record"] != record:
|
||||
continue
|
||||
if log["side"] == side and log["tls"] == "0":
|
||||
plain_line = "plain {}".format(float(log[COL[obj]]) - idle_val * float(log["time"]))
|
||||
n = float(log.get("n", "1000"))
|
||||
plain_line = "plain {}".format((float(log[COL[obj]]) * conv_factor - idle_val * float(log["time"])) / n)
|
||||
|
||||
if plain_line == None:
|
||||
return
|
||||
|
|
@ -177,7 +183,8 @@ def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version
|
|||
continue
|
||||
if log[COL[criterion]] not in ciphers:
|
||||
ciphers[log[COL[criterion]]] = {}
|
||||
ciphers[log[COL[criterion]]][log["impl"]] = float(log[COL[obj]]) - idle_val * float(log["time"])
|
||||
n = float(log.get("n", "1000"))
|
||||
ciphers[log[COL[criterion]]][log["impl"]] = (float(log[COL[obj]]) * conv_factor - idle_val * float(log["time"])) / n
|
||||
if log["impl"] not in impls:
|
||||
impls.append(log["impl"])
|
||||
impls.sort()
|
||||
|
|
@ -217,13 +224,15 @@ def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version
|
|||
maketitle=maketitle
|
||||
)
|
||||
|
||||
def make_profile_plot(logs, exp, criterion, side, record, no_flamegraph=False, machine=None, maketitle=False):
|
||||
def make_profile_plot(logs, exp, criterion, side, record, no_flamegraph=False, machine=None, version=None, maketitle=False):
|
||||
f = open(f"/dev/shm/plots/profile_by_{criterion}_{side}_{record}.dat", "w")
|
||||
runs = []
|
||||
functions = []
|
||||
|
||||
for log in logs:
|
||||
if log["exp"] == exp and log["record"] == record and log["setup"] == side:
|
||||
if version != None and VER_LABEL[log["cipher"]] != version:
|
||||
continue
|
||||
if log["exp"] == exp and log["record"] == record and log["side"] == side and log["tls"] == "1":
|
||||
svg_filename = log["prof"] + ".svg"
|
||||
if not no_flamegraph:
|
||||
os.system("flamegraph --perfdata {} -o {}".format(log["prof"], svg_filename))
|
||||
|
|
@ -407,11 +416,11 @@ if __name__ == "__main__":
|
|||
make_log_plot(logs, "zrtt", "ed", side, "energy", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
#cmp_versions(logs, ["impl-cipher-ver", "impl-cert-ver", "impl-kex-ver"], ["side", "cipher", "cert", "kex", "record"], ["cpu", "energy"])
|
||||
elif cmd == "prof":
|
||||
for side in ["client-local", "server-local"]:
|
||||
for side in ["client", "server"]:
|
||||
for record in records:
|
||||
make_profile_plot(logs, "impl-cipher-ver", "cipher", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle)
|
||||
make_profile_plot(logs, "impl-cert-ver", "cert", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle)
|
||||
make_profile_plot(logs, "impl-kex-ver", "kex", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle)
|
||||
make_profile_plot(logs, "impl-cipher-ver", "cipher", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_profile_plot(logs, "impl-cert-ver", "cert", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_profile_plot(logs, "impl-kex-ver", "kex", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle, version="1.3")
|
||||
elif cmd == "correl":
|
||||
from scipy import stats
|
||||
import matplotlib.pyplot as plt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue