Plot machine name, more values in config
This commit is contained in:
parent
f4ce4bd3fc
commit
ef0715fad2
3 changed files with 185 additions and 48 deletions
69
plots.py
69
plots.py
|
|
@ -60,6 +60,10 @@ CRITERION_TITLE = {
|
|||
PLOTS_DIR = "/dev/shm/plots"
|
||||
|
||||
def gnuplot_histogram(**kwargs):
|
||||
if "machine" in kwargs and kwargs["machine"] != None:
|
||||
kwargs["machine"] = ", " + kwargs["machine"]
|
||||
else:
|
||||
kwargs["machine"] = ""
|
||||
cluster = ""
|
||||
for i in range(kwargs["nb_impls"]-1):
|
||||
cluster += """, "" using {}:xticlabels(1) title col""".format(i+4)
|
||||
|
|
@ -71,7 +75,7 @@ set boxwidth 0.9 absolute
|
|||
set style fill solid 1.0 border lt -1
|
||||
set style histogram clustered gap 1 title textcolor lt -1
|
||||
set style data histograms
|
||||
set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side} side) ({unit})"
|
||||
set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side}{machine}) ({unit})"
|
||||
#set xtics border in scale 0,0 nomirror rotate by -45 autojustify
|
||||
set xtics border in scale 0,0 nomirror autojustify
|
||||
#set key fixed right top vertical Right noreverse noenhanced autotitle nobox
|
||||
|
|
@ -88,6 +92,10 @@ plot \
|
|||
os.system("gnuplot {plots_dir}/{object}_by_{criterion}_{side}_{record}.gnuplot".format(plots_dir=PLOTS_DIR, **kwargs))
|
||||
|
||||
def gnuplot_stacked_histogram(**kwargs):
|
||||
if "machine" in kwargs and kwargs["machine"] != None:
|
||||
kwargs["machine"] = ", " + kwargs["machine"]
|
||||
else:
|
||||
kwargs["machine"] = ""
|
||||
cluster = ""
|
||||
#for i in range(kwargs["nb_impls"]-1):
|
||||
# cluster += """, "" using {}:xticlabels(1) title col""".format(i+4)
|
||||
|
|
@ -99,7 +107,7 @@ set boxwidth 0.9 absolute
|
|||
set style fill solid 1.0 border lt -1
|
||||
set style histogram rowstacked
|
||||
set style data histograms
|
||||
set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side} side) ({unit})"
|
||||
set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side}{machine}) ({unit})"
|
||||
set xtics border in scale 0,0 nomirror noenhanced rotate by -15 autojustify
|
||||
set key fixed left top vertical Left noenhanced autotitle nobox invert reverse opaque
|
||||
set colorbox vertical origin screen 0.9, 0.2 size screen 0.05, 0.6 front noinvert bdefault
|
||||
|
|
@ -111,7 +119,7 @@ plot for [i=2:{nb_functions}] "{plots_dir}/{object}_by_{criterion}_{side}_{recor
|
|||
f.close()
|
||||
os.system("gnuplot {plots_dir}/{object}_by_{criterion}_{side}_{record}.gnuplot".format(plots_dir=PLOTS_DIR, **kwargs))
|
||||
|
||||
def make_log_plot(logs, exp, criterion, side, obj, record):
|
||||
def make_log_plot(logs, exp, criterion, side, obj, record, machine=None):
|
||||
f = open(f"/dev/shm/plots/{obj}_by_{criterion}_{side}_{record}.dat", "w")
|
||||
ciphers = {}
|
||||
impls = []
|
||||
|
|
@ -140,6 +148,9 @@ def make_log_plot(logs, exp, criterion, side, obj, record):
|
|||
f.write("{} none {}\n".format(criterion, " ".join(impls)))
|
||||
f.write(plain_line+" -"*len(impls)+"\n")
|
||||
for cipher in ciphers:
|
||||
for impl in impls:
|
||||
if impl not in ciphers[cipher]:
|
||||
ciphers[cipher][impl] = 0
|
||||
f.write("{}({}) - {}\n".format(
|
||||
ALG_LABEL[cipher],
|
||||
VER_LABEL[log["cipher"]],
|
||||
|
|
@ -149,9 +160,19 @@ def make_log_plot(logs, exp, criterion, side, obj, record):
|
|||
]),
|
||||
))
|
||||
f.close()
|
||||
gnuplot_histogram(object=obj, criterion=criterion, side=side, object_title=OBJ_TITLE[obj], criterion_title=CRITERION_TITLE[criterion], unit=UNIT[obj], nb_impls=len(impls), record=record)
|
||||
gnuplot_histogram(
|
||||
object=obj,
|
||||
criterion=criterion,
|
||||
side=side,
|
||||
object_title=OBJ_TITLE[obj],
|
||||
criterion_title=CRITERION_TITLE[criterion],
|
||||
unit=UNIT[obj],
|
||||
nb_impls=len(impls),
|
||||
record=record,
|
||||
machine=machine
|
||||
)
|
||||
|
||||
def make_profile_plot(logs, exp, criterion, side, record, no_flamegraph=False):
|
||||
def make_profile_plot(logs, exp, criterion, side, record, no_flamegraph=False, machine=None):
|
||||
f = open(f"/dev/shm/plots/profile_by_{criterion}_{side}_{record}.dat", "w")
|
||||
runs = []
|
||||
functions = []
|
||||
|
|
@ -183,7 +204,23 @@ def make_profile_plot(logs, exp, criterion, side, record, no_flamegraph=False):
|
|||
]),
|
||||
))
|
||||
f.close()
|
||||
gnuplot_stacked_histogram(object="profile", criterion=criterion, side=side, object_title=OBJ_TITLE["profile"], criterion_title=CRITERION_TITLE[criterion], unit=UNIT["profile"], record=record, nb_functions=len(functions)+1)
|
||||
gnuplot_stacked_histogram(
|
||||
object="profile",
|
||||
criterion=criterion,
|
||||
side=side,
|
||||
object_title=OBJ_TITLE["profile"],
|
||||
criterion_title=CRITERION_TITLE[criterion],
|
||||
unit=UNIT["profile"],
|
||||
record=record,
|
||||
nb_functions=len(functions)+1,
|
||||
machine=machine
|
||||
)
|
||||
|
||||
def getargv(arg:str, default="", n:int=1, args:list=sys.argv):
|
||||
if arg in args and len(args) > args.index(arg)+n:
|
||||
return args[args.index(arg)+n]
|
||||
else:
|
||||
return default
|
||||
|
||||
if __name__ == "__main__":
|
||||
cmd = sys.argv[1]
|
||||
|
|
@ -209,18 +246,20 @@ if __name__ == "__main__":
|
|||
|
||||
no_flamegraph = "-f" in sys.argv
|
||||
|
||||
machine = getargv("-m", None)
|
||||
|
||||
if cmd == "log":
|
||||
for side in ["client", "server"]:
|
||||
for record in records:
|
||||
make_log_plot(logs, "impl-cipher-ver", "cipher", side, "cpu", record)
|
||||
make_log_plot(logs, "impl-cipher-ver", "cipher", side, "energy", record)
|
||||
make_log_plot(logs, "impl-cert-ver", "cert", side, "cpu", record)
|
||||
make_log_plot(logs, "impl-cert-ver", "cert", side, "energy", record)
|
||||
make_log_plot(logs, "impl-kex-ver", "kex", side, "cpu", record)
|
||||
make_log_plot(logs, "impl-kex-ver", "kex", side, "energy", record)
|
||||
make_log_plot(logs, "impl-cipher-ver", "cipher", side, "cpu", record, machine=machine)
|
||||
make_log_plot(logs, "impl-cipher-ver", "cipher", side, "energy", record, machine=machine)
|
||||
make_log_plot(logs, "impl-cert-ver", "cert", side, "cpu", record, machine=machine)
|
||||
make_log_plot(logs, "impl-cert-ver", "cert", side, "energy", record, machine=machine)
|
||||
make_log_plot(logs, "impl-kex-ver", "kex", side, "cpu", record, machine=machine)
|
||||
make_log_plot(logs, "impl-kex-ver", "kex", side, "energy", record, machine=machine)
|
||||
elif cmd == "prof":
|
||||
for side in ["client-local", "server-local"]:
|
||||
for record in records:
|
||||
make_profile_plot(logs, "impl-cipher-ver", "cipher", side, record, no_flamegraph=no_flamegraph)
|
||||
make_profile_plot(logs, "impl-cert-ver", "cert", side, record, no_flamegraph=no_flamegraph)
|
||||
make_profile_plot(logs, "impl-kex-ver", "kex", side, record, no_flamegraph=no_flamegraph)
|
||||
make_profile_plot(logs, "impl-cipher-ver", "cipher", side, record, no_flamegraph=no_flamegraph, machine=machine)
|
||||
make_profile_plot(logs, "impl-cert-ver", "cert", side, record, no_flamegraph=no_flamegraph, machine=machine)
|
||||
make_profile_plot(logs, "impl-kex-ver", "kex", side, record, no_flamegraph=no_flamegraph, machine=machine)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue