diff options
Diffstat (limited to 'unit_trace/sanitizer.py')
| -rw-r--r-- | unit_trace/sanitizer.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/unit_trace/sanitizer.py b/unit_trace/sanitizer.py index 598379a..fc66170 100644 --- a/unit_trace/sanitizer.py +++ b/unit_trace/sanitizer.py | |||
| @@ -14,6 +14,8 @@ def sanitizer(stream): | |||
| 14 | job_2s_released = [] # list of tasks which have released their job 2s | 14 | job_2s_released = [] # list of tasks which have released their job 2s |
| 15 | jobs_switched_to = [] | 15 | jobs_switched_to = [] |
| 16 | 16 | ||
| 17 | released = False | ||
| 18 | |||
| 17 | for record in stream: | 19 | for record in stream: |
| 18 | 20 | ||
| 19 | # Ignore records which are not events (e.g. the num_cpus record) | 21 | # Ignore records which are not events (e.g. the num_cpus record) |
| @@ -21,6 +23,13 @@ def sanitizer(stream): | |||
| 21 | yield record | 23 | yield record |
| 22 | continue | 24 | continue |
| 23 | 25 | ||
| 26 | if record.type_name == 'release': | ||
| 27 | released = released or True | ||
| 28 | |||
| 29 | if record.type_name == 'action' and released: | ||
| 30 | yield record | ||
| 31 | continue | ||
| 32 | |||
| 24 | # All records with job < 2 are garbage | 33 | # All records with job < 2 are garbage |
| 25 | if record.job < 2: | 34 | if record.job < 2: |
| 26 | continue | 35 | continue |
| @@ -50,4 +59,5 @@ def sanitizer(stream): | |||
| 50 | if (record.pid,record.job) not in jobs_switched_to: | 59 | if (record.pid,record.job) not in jobs_switched_to: |
| 51 | record.job -= 1 | 60 | record.job -= 1 |
| 52 | 61 | ||
| 62 | |||
| 53 | yield record | 63 | yield record |
