Sfoglia il codice sorgente

tools: do not count events which happen afther the Deinitializing one

Samuel Pitoiset 9 anni fa
parent
commit
af31622dc4
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7 1
      tools/starpu_trace_state_stats.py

+ 7 - 1
tools/starpu_trace_state_stats.py

@@ -106,7 +106,13 @@ class Worker():
     def calc_stats(self, start_profiling_times, stop_profiling_times):
         num_events = len(self._events)
 	use_start_stop = len(start_profiling_times) != 0
-	for event in self._events:
+	for i in xrange(0, num_events):
+	    event = self._events[i]
+	    if i > 0 and self._events[i-1]._name == "Deinitializing":
+		# Drop all events after the Deinitializing event is found
+		# because they do not make sense.
+		break
+
             if not use_start_stop:
                 self.add_event_to_stats(event)
 		continue