Implement check for --end argument before start of trace
authorAntoine Busque <antoinebusque@gmail.com>
Thu, 16 Apr 2015 22:21:20 +0000 (18:21 -0400)
committerAntoine Busque <antoinebusque@gmail.com>
Thu, 16 Apr 2015 22:21:20 +0000 (18:21 -0400)
lttnganalysescli/lttnganalysescli/command.py

index 0ee9c5ebd8e8d8ff9d655c49fd1da03c15a906a4..31a58c4129f677d29cfa2ac36b2ebd202556cee0 100644 (file)
@@ -298,6 +298,15 @@ class Command:
                     print('Invalid timeformat')
                     sys.exit(1)
 
+                # We have to check if timestamp_begin is None, which
+                # it always is in older versions of babeltrace. In
+                # that case, the test is simply skipped and an invalid
+                # --end value will cause an empty analysis
+                if self._traces.timestamp_begin is not None and \
+                   self._arg_end < self._traces.timestamp_begin:
+                    print('--end timestamp before beginning of trace')
+                    sys.exit(1)
+
     def _create_automaton(self):
         self._automaton = linuxautomaton.automaton.Automaton()
         self.state = self._automaton.state
This page took 0.027962 seconds and 5 git commands to generate.