diff options
| author | Gary Bressler <garybressler@nc.rr.com> | 2010-03-20 16:46:39 -0400 |
|---|---|---|
| committer | Gary Bressler <garybressler@nc.rr.com> | 2010-03-20 16:46:39 -0400 |
| commit | 7fdb4dbbbca577efbeec47cd1364eb319346a0cc (patch) | |
| tree | 06001712dc9580e5e7118d224a6839b9149099fb | |
| parent | 58573c2a7e7595b952f6f23f22c3b9ddab36748d (diff) | |
More minor cleanup
| -rw-r--r-- | unit_trace/viz/schedule.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/unit_trace/viz/schedule.py b/unit_trace/viz/schedule.py index 5efee7d..f134562 100644 --- a/unit_trace/viz/schedule.py +++ b/unit_trace/viz/schedule.py | |||
| @@ -180,7 +180,6 @@ class Schedule(object): | |||
| 180 | for event_time in sorted(job.get_events().keys()): | 180 | for event_time in sorted(job.get_events().keys()): |
| 181 | # could have multiple events at the same time (unlikely but possible) | 181 | # could have multiple events at the same time (unlikely but possible) |
| 182 | for event in job.get_events()[event_time]: | 182 | for event in job.get_events()[event_time]: |
| 183 | print 'task, job, event:', task.name, job.job_no, event.__class__.__name__ | ||
| 184 | event.scan(cur_cpu, switches) | 183 | event.scan(cur_cpu, switches) |
| 185 | 184 | ||
| 186 | # What if one of the initial "span events" (switch to or inversion starting) never got a | 185 | # What if one of the initial "span events" (switch to or inversion starting) never got a |
| @@ -366,7 +365,7 @@ class SuspendEvent(Event): | |||
| 366 | def scan(self, cur_cpu, switches): | 365 | def scan(self, cur_cpu, switches): |
| 367 | if self.get_cpu() != cur_cpu[0]: | 366 | if self.get_cpu() != cur_cpu[0]: |
| 368 | self.erroneous = True | 367 | self.erroneous = True |
| 369 | print "suspending on a CPU different from the CPU we are on!" | 368 | #fprint "suspending on a CPU different from the CPU we are on!" |
| 370 | super(SuspendEvent, self).scan(cur_cpu, switches) | 369 | super(SuspendEvent, self).scan(cur_cpu, switches) |
| 371 | 370 | ||
| 372 | def render(self, graph, layer, prev_events, selectable=False): | 371 | def render(self, graph, layer, prev_events, selectable=False): |
| @@ -391,7 +390,7 @@ class ResumeEvent(Event): | |||
| 391 | def scan(self, cur_cpu, switches): | 390 | def scan(self, cur_cpu, switches): |
| 392 | if cur_cpu[0] != Event.NO_CPU and cur_cpu[0] != self.get_cpu(): | 391 | if cur_cpu[0] != Event.NO_CPU and cur_cpu[0] != self.get_cpu(): |
| 393 | self.erroneous = True | 392 | self.erroneous = True |
| 394 | print "Resuming when currently scheduled on a CPU, but on a different CPU from the current CPU!" | 393 | #print "Resuming when currently scheduled on a CPU, but on a different CPU from the current CPU!" |
| 395 | super(ResumeEvent, self).scan(cur_cpu, switches) | 394 | super(ResumeEvent, self).scan(cur_cpu, switches) |
| 396 | 395 | ||
| 397 | def render(self, graph, layer, prev_events, selectable=False): | 396 | def render(self, graph, layer, prev_events, selectable=False): |
| @@ -448,7 +447,7 @@ class SwitchToEvent(Event): | |||
| 448 | 447 | ||
| 449 | if old_cur_cpu != Event.NO_CPU: | 448 | if old_cur_cpu != Event.NO_CPU: |
| 450 | self.erroneous = True | 449 | self.erroneous = True |
| 451 | print "currently scheduled somewhere, can't switch to a CPU" | 450 | #print "currently scheduled somewhere, can't switch to a CPU" |
| 452 | 451 | ||
| 453 | super(SwitchToEvent, self).scan(cur_cpu, switches) | 452 | super(SwitchToEvent, self).scan(cur_cpu, switches) |
| 454 | 453 | ||
| @@ -498,13 +497,13 @@ class SwitchAwayEvent(Event): | |||
| 498 | 497 | ||
| 499 | if self.get_cpu() != old_cur_cpu: | 498 | if self.get_cpu() != old_cur_cpu: |
| 500 | self.erroneous = True | 499 | self.erroneous = True |
| 501 | print "switching away from a CPU different from the CPU we are currently on" | 500 | #print "switching away from a CPU different from the CPU we are currently on" |
| 502 | if self.corresp_start_event is None: | 501 | if self.corresp_start_event is None: |
| 503 | self.erroneous = True | 502 | self.erroneous = True |
| 504 | print "switch away was not matched by a corresponding switch to" | 503 | #print "switch away was not matched by a corresponding switch to" |
| 505 | elif self.get_time() < self.corresp_start_event.get_time(): | 504 | elif self.get_time() < self.corresp_start_event.get_time(): |
| 506 | self.erroneous = True | 505 | self.erroneous = True |
| 507 | print "switching away from a processor before we switched to it?!" | 506 | #print "switching away from a processor before we switched to it?!" |
| 508 | 507 | ||
| 509 | super(SwitchAwayEvent, self).scan(cur_cpu, switches) | 508 | super(SwitchAwayEvent, self).scan(cur_cpu, switches) |
| 510 | 509 | ||
| @@ -582,7 +581,7 @@ class InversionStartEvent(ErrorEvent): | |||
| 582 | 581 | ||
| 583 | def __str__(self): | 582 | def __str__(self): |
| 584 | if self.corresp_end_event is None: | 583 | if self.corresp_end_event is None: |
| 585 | print 'Inversion Start (w/o Inversion End)' + self._common_str() \ | 584 | return 'Inversion Start (w/o Inversion End)' + self._common_str() \ |
| 586 | + ', TIME=' + util.format_float(self.get_time(), Event.NUM_DEC_PLACES) | 585 | + ', TIME=' + util.format_float(self.get_time(), Event.NUM_DEC_PLACES) |
| 587 | return 'Priority Inversion' + self._common_str() + ', START=' \ | 586 | return 'Priority Inversion' + self._common_str() + ', START=' \ |
| 588 | + util.format_float(self.get_time(), Event.NUM_DEC_PLACES) \ | 587 | + util.format_float(self.get_time(), Event.NUM_DEC_PLACES) \ |
| @@ -626,7 +625,7 @@ class InversionEndEvent(ErrorEvent): | |||
| 626 | 625 | ||
| 627 | def __str__(self): | 626 | def __str__(self): |
| 628 | if self.corresp_start_event is None: | 627 | if self.corresp_start_event is None: |
| 629 | print 'Inversion End (w/o Inversion Start)' + self._common_str() \ | 628 | return 'Inversion End (w/o Inversion Start)' + self._common_str() \ |
| 630 | + ', TIME=' + util.format_float(self.get_time(), Event.NUM_DEC_PLACES) | 629 | + ', TIME=' + util.format_float(self.get_time(), Event.NUM_DEC_PLACES) |
| 631 | 630 | ||
| 632 | return str(self.corresp_start_event) | 631 | return str(self.corresp_start_event) |
