Skip to content

Commit b821037

Browse files
committed
more automated checking, improve output
Signed-off-by: Hugo Lefeuvre <hugo.lefeuvre@manchester.ac.uk>
1 parent df6804e commit b821037

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

explore.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,8 @@ def explore_perf(errno, syscalls):
640640
if u:
641641
info("Final check analysis for stubbing succeeded; the entire set can be stubbed simultaneously.")
642642
else:
643-
info("Final check analysis for stubbing failed; the entire set cannot be stubbed simultaneously.")
644-
info("We recommend a manual pass with seccomp_run to find the culprit.")
643+
warning("Final check analysis for stubbing failed; the entire set cannot be stubbed simultaneously.")
644+
warning("We recommend a manual pass with seccomp_run to find the culprit.")
645645

646646
info("Finding system calls that work when we fake (errno = 0)...")
647647

@@ -654,8 +654,8 @@ def explore_perf(errno, syscalls):
654654
if u:
655655
info("Final check analysis for faking succeeded; the entire set can be faked simultaneously.")
656656
else:
657-
info("Final check analysis for faking failed; the entire set cannot be faked simultaneously.")
658-
info("We recommend a manual pass with seccomp_run to find the culprit.")
657+
warning("Final check analysis for faking failed; the entire set cannot be faked simultaneously.")
658+
warning("We recommend a manual pass with seccomp_run to find the culprit.")
659659

660660
require_impl = list(((set(used)) - set(probably_works_stubbed)) - set(probably_works_lying))
661661
require_impl.sort()

loupe

+27-3
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,9 @@ def run_tests(path_db, application, workload, path_dockerfile, only_build_docker
623623
results = [None] * NUMBER_GENERATE_REPLICAS
624624
static_results_array = [None]
625625
for j in range(NUMBER_GENERATE_REPLICAS // NUMBER_PARALLEL_REPLICAS):
626-
debug("Starting replica batch (%d/%d)" % ((
626+
debug("Starting replica batch (%d/%d), batch size %d" % ((
627627
j * NUMBER_PARALLEL_REPLICAS) + NUMBER_PARALLEL_REPLICAS,
628-
NUMBER_GENERATE_REPLICAS))
628+
NUMBER_GENERATE_REPLICAS, NUMBER_PARALLEL_REPLICAS))
629629

630630
for i in range(NUMBER_PARALLEL_REPLICAS):
631631
t = threading.Thread(target=_run_test, args=(containername,
@@ -784,7 +784,7 @@ def run_tests(path_db, application, workload, path_dockerfile, only_build_docker
784784
with open(os.path.join(runpath, "data", "static_binary.csv"), "a+") as outf:
785785
outf.write(static_results)
786786

787-
debug("Outputing additional reproducibility information...")
787+
debug("Outputing additional reproducibility and debugging information...")
788788

789789
with open(os.path.join(runpath, "cmd.txt"), "a+") as outf:
790790
outf.write(" ".join(sys.argv))
@@ -801,6 +801,25 @@ def run_tests(path_db, application, workload, path_dockerfile, only_build_docker
801801
outf.write(logf.read())
802802
repnum += 1
803803

804+
debug("Checking explorer logs...")
805+
with open(os.path.join(runpath, "explore.logs")) as logf:
806+
content = logf.read()
807+
err = False
808+
809+
if "Final check analysis for faking failed; the entire set cannot" in content:
810+
warning("At least one replica reported issues when consolidating stubbing")
811+
warning("and faking measurements. Please check %s." %
812+
os.path.join(runpath, "explore.logs"))
813+
err = True
814+
815+
if "[E] " in content:
816+
warning("At least one replica reported an error. Please check %s."
817+
% os.path.join(runpath, "explore.logs"))
818+
err = True
819+
820+
if not err:
821+
debug("explorer logs all OK.")
822+
804823
end = datetime.now()
805824

806825
info("Done! Full analysis last %s." % str(end - start))
@@ -1329,6 +1348,7 @@ if (args.cmd == "generate"):
13291348
# check Dockerfile for obvious errors
13301349
# we just provide that as a quick sanity check for confused users
13311350
# hopefully this does reduce the amount of bug reports we get :)
1351+
debug("Checking Dockerfile...")
13321352
with open(args.dockerfile) as dockerf:
13331353
content = dockerf.read()
13341354
if "loupe-base:latest" not in content:
@@ -1345,6 +1365,10 @@ if (args.cmd == "generate"):
13451365
"option, which is mandatory when using the loupe wrapper." % args.dockerfile)
13461366
exit(1)
13471367

1368+
if "--final-check" not in content:
1369+
warning("Dockerfile (%s) calls explore.py without the --final-check "
1370+
"option, which is recommended." % args.dockerfile)
1371+
13481372
# remove potential logs from previous runs
13491373
try:
13501374
os.remove(QUIET_LOG)

0 commit comments

Comments
 (0)