From 7545402506aa76261e18d85af585ff0ac1cf05c1 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Tue, 23 Apr 2013 14:01:35 -0400 Subject: Improved accuracy of sched_trace measurement parsing. * Measurements from tasks missing > 20% of their scheduling records are ignored. This is configurable in config/config.py. * Measurements which only have zero values are ignored. * If either of these 2 situations are encountered print out a message the first time using the common.log_once() method. See parse_exps.py for how this is used with multiple threads. * Measurements from a task's last job are ignored. * Miss ratio is calculated only as a fraction of the number of jobs whose matching release and completion records were found, not just release. --- common.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'common.py') diff --git a/common.py b/common.py index a2c6224..7abf0f2 100644 --- a/common.py +++ b/common.py @@ -193,3 +193,20 @@ def is_device(dev): return False mode = os.stat(dev)[stat.ST_MODE] return not (not mode & stat.S_IFCHR) + +__logged = [] + +def set_logged_list(logged): + global __logged + __logged = logged + +def log_once(id, msg = None, indent = True): + global __logged + + msg = msg if msg else id + + if id not in __logged: + __logged += [id] + if indent: + msg = ' ' + msg.strip('\t').replace('\n', '\n\t') + sys.stderr.write('\n' + msg.strip('\n') + '\n') -- cgit v1.2.2