浏览代码

tools: fix wrong assumption in starpu_trace_state_stats.py

Actually a PopState event can appear just after a SetState.
Reported by Martin Khannouz.
Samuel Pitoiset 9 年之前
父节点
当前提交
c96d04799a
共有 1 个文件被更改,包括 3 次插入7 次删除
  1. 3 7
      tools/starpu_trace_state_stats.py

+ 3 - 7
tools/starpu_trace_state_stats.py

@@ -91,12 +91,7 @@ class Worker():
 	    if not is_allowed:
 		continue
 
-	    if curr_event._type == "SetState":
-		if next_event._type == "PopState":
-		    sys.exit("ERROR: The trace is most likely corrupted "
-			     "because a PopState event has been found just "
-			     "after a SetState!")
-	    elif curr_event._type == "PushState":
+	    if curr_event._type == "PushState":
 		self._stack.append(curr_event)
 		continue # Will look later to find a PopState event.
 	    elif curr_event._type == "PopState":
@@ -107,7 +102,8 @@ class Worker():
 		next_event = curr_event
 		curr_event = self._stack.pop()
 	    else:
-		sys.exit("ERROR: Invalid event type!")
+		if curr_event._type != "SetState":
+		    sys.exit("ERROR: Invalid event type!")
 
             # Compute duration with the next event.
             a = curr_event._start_time