diff options
Diffstat (limited to 'unit_trace/sanitizer.py')
| -rw-r--r-- | unit_trace/sanitizer.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/unit_trace/sanitizer.py b/unit_trace/sanitizer.py index 598379a..3245e70 100644 --- a/unit_trace/sanitizer.py +++ b/unit_trace/sanitizer.py | |||
| @@ -17,37 +17,37 @@ def sanitizer(stream): | |||
| 17 | for record in stream: | 17 | for record in stream: |
| 18 | 18 | ||
| 19 | # Ignore records which are not events (e.g. the num_cpus record) | 19 | # Ignore records which are not events (e.g. the num_cpus record) |
| 20 | if record.record_type != 'event': | 20 | if record['record_type'] != 'event': |
| 21 | yield record | 21 | yield record |
| 22 | continue | 22 | continue |
| 23 | 23 | ||
| 24 | # All records with job < 2 are garbage | 24 | # All records with job < 2 are garbage |
| 25 | if record.job < 2: | 25 | if record['job'] < 2: |
| 26 | continue | 26 | continue |
| 27 | 27 | ||
| 28 | # Some records with job == 2 are garbage | 28 | # Some records with job == 2 are garbage |
| 29 | if record.job==2: | 29 | if record['job']==2: |
| 30 | 30 | ||
| 31 | # There is a duplicate release of every job 2 | 31 | # There is a duplicate release of every job 2 |
| 32 | # This will throw away the second one | 32 | # This will throw away the second one |
| 33 | if record.type_name == 'release': | 33 | if record['type_name'] == 'release': |
| 34 | if record.pid in job_2s_released: | 34 | if record['pid'] in job_2s_released: |
| 35 | continue | 35 | continue |
| 36 | else: | 36 | else: |
| 37 | job_2s_released.append(record.pid) | 37 | job_2s_released.append(record['pid']) |
| 38 | 38 | ||
| 39 | # Job 2 has a resume that is garbage | 39 | # Job 2 has a resume that is garbage |
| 40 | if record.type_name == 'resume': | 40 | if record['type_name'] == 'resume': |
| 41 | continue | 41 | continue |
| 42 | 42 | ||
| 43 | # By default, the switch_away for a job (after it has completed) | 43 | # By default, the switch_away for a job (after it has completed) |
| 44 | # is maked as being for job+1, which has never been switched to. | 44 | # is maked as being for job+1, which has never been switched to. |
| 45 | # We can correct this if we note which jobs really | 45 | # We can correct this if we note which jobs really |
| 46 | # have been switched to. | 46 | # have been switched to. |
| 47 | if record.type_name == 'switch_to': | 47 | if record['type_name'] == 'switch_to': |
| 48 | jobs_switched_to.append((record.pid,record.job)) | 48 | jobs_switched_to.append((record['pid'],record['job'])) |
| 49 | if record.type_name == 'switch_away': | 49 | if record['type_name'] == 'switch_away': |
| 50 | if (record.pid,record.job) not in jobs_switched_to: | 50 | if (record['pid'],record['job']) not in jobs_switched_to: |
| 51 | record.job -= 1 | 51 | record['job'] -= 1 |
| 52 | 52 | ||
| 53 | yield record | 53 | yield record |
