From 58d168e52c3de9f3a53d0aea802be5cab492ade6 Mon Sep 17 00:00:00 2001 From: Mac Mollison Date: Fri, 26 Mar 2010 13:51:39 -0400 Subject: Add inversion IDs and print them Makes it easier to find inversion records in output --- unit_trace/gedf_test.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'unit_trace/gedf_test.py') diff --git a/unit_trace/gedf_test.py b/unit_trace/gedf_test.py index 41bab96..3f4e150 100644 --- a/unit_trace/gedf_test.py +++ b/unit_trace/gedf_test.py @@ -88,20 +88,26 @@ class Job(object): self.is_complete = False self.inversion_start = None self.inversion_end = None + self.inversion_start_id = None def __str__(self): return "(%d.%d:%d)" % (self.pid,self.job,self.deadline) # G-EDF errors: the start or end of an inversion class Error(object): + id = 0 def __init__(self, job, eligible, on_cpu): + Error.id += 1 + self.id = Error.id self.job = copy.copy(job) self.eligible = copy.copy(eligible) self.on_cpu = copy.copy(on_cpu) self.record_type = 'error' if job.inversion_end is None: self.type_name = 'inversion_start' + job.inversion_start_id = self.id else: self.type_name = 'inversion_end' + self.inversion_start_id = job.inversion_start_id # Returns the position of a Job in a list, or None def _find_job(record,list): -- cgit v1.2.2