about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJordy Ruiz <jruiz@ic.ac.uk>2020-08-08 10:04:55 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-08-23 10:51:48 +0100
commit729ecede246be700bd483ff47d5462814df08b82 (patch)
treeb9287894b6bbf2e58b417125c87a710601dc0d42
parent085c54b980a2f62c7c475d32b5d0ce9c6f97904f (diff)
downloadklee-729ecede246be700bd483ff47d5462814df08b82.tar.gz
klee-stats: check for a run.stats file in the klee-out directory, to prevent outputting wrong data.
When KLEE crashes, it produces an empty info file, so it is not enough to check for the existence of an info file.
Previously, table columns would mismatch and return data labeled with the wrong directory names.
-rwxr-xr-xtools/klee-stats/klee-stats7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/klee-stats/klee-stats b/tools/klee-stats/klee-stats
index 5a855705..49b101b3 100755
--- a/tools/klee-stats/klee-stats
+++ b/tools/klee-stats/klee-stats
@@ -99,16 +99,19 @@ def stripCommonPathPrefix(paths):
     return ['/'.join(p[i:]) for p in paths]
 
 
+def isValidKleeOutDir(dir):
+    return os.path.exists(os.path.join(dir, 'info')) and os.path.exists(os.path.join(dir, 'run.stats'))
+
 def getKleeOutDirs(dirs):
     kleeOutDirs = []
     for dir in dirs:
-        if os.path.exists(os.path.join(dir, 'info')):
+        if isValidKleeOutDir(dir):
             kleeOutDirs.append(dir)
         else:
             for root, subdirs, _ in os.walk(dir):
                 for d in subdirs:
                     path = os.path.join(root, d)
-                    if os.path.exists(os.path.join(path, 'info')):
+                    if isValidKleeOutDir(path):
                         kleeOutDirs.append(path)
     return kleeOutDirs