Commits

Maciej Fijalkowski committed eac7398 Merge

merge

Comments (0)

Files changed (1)

 
 CUTOFF = 30
 
+class CannotFindFile(Exception):
+    pass
+
 class Server(object):
     def __init__(self, storage):
         self.storage = storage
         self._root_path = kwargs.pop('root_path')
         flask.Flask.__init__(self, *args, **kwargs)
 
+class CheckingLoopStorage(LoopStorage):
+    def disassemble_code(self, fname, startlineno):
+        result = super(CheckingLoopStorage, self).disassemble_code(fname, startlineno)
+        if result is None and fname is not None:
+            raise CannotFindFile(fname)
+        return result
+
 def main():
     PATH = os.path.join(os.path.dirname(
         os.path.dirname(_jitviewer.__file__)))
         port = 5000
     else:
         port = int(sys.argv[2])
-    storage = LoopStorage(extra_path)
+    storage = CheckingLoopStorage(extra_path)
     loops = [ParserWithHtmlRepr.parse_from_input(l)
              for l in extract_category(log, "jit-log-opt-")]
     parse_log_counts(extract_category(log, 'jit-backend-count'), loops)