summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMac Mollison <mollison@cs.unc.edu>2009-02-26 14:52:31 -0500
committerMac Mollison <mollison@cs.unc.edu>2009-02-26 14:52:31 -0500
commitb303b1faf08dcd6a7d91022716505dc2aaed36e2 (patch)
tree1c821a8ce3d6c81e2202fa3309f6d877c2c74625
parent8229614b9f316e811740bf6c0f9e3c227524399c (diff)
Added "side effect remover" function. This is currently used to remove
switch_aways immediately following completions. Now, the switch_aways + completions == switch_tos, except that job1 does an additional switch_away and because the last side-effect switch-away is /before/ the completion and thus not removed. In the future, it will be good to also make sure the switch_away being removed is on the same CPU
-rwxr-xr-xsta.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/sta.py b/sta.py
index 152faeb..34ed2f1 100755
--- a/sta.py
+++ b/sta.py
@@ -88,6 +88,15 @@ class Trace:
88 """Slice the trace iterator""" 88 """Slice the trace iterator"""
89 self.iter = list(self.iter)[start:end] 89 self.iter = list(self.iter)[start:end]
90 90
91 def remove_side_effects(self, type1, type2):
92 """Remove records of type2 immediately following records of type1"""
93 self.iter = list(self.iter)
94 i = 0
95 while i < len(self.iter) - 1:
96 if self.iter[i]['type'] == type1 and self.iter[i+1]['type']==type2:
97 del self.iter[i+1]
98 i += 1
99
91 def print_records(self): 100 def print_records(self):
92 """Prints all records in the trace""" 101 """Prints all records in the trace"""
93 for record in self.iter: 102 for record in self.iter: