aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/profiling/latency_profile
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-11-03 11:03:48 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-11-03 11:03:48 -0800
commit61ead3e061f685f87e284bf41f7ed1cb44f347b4 (patch)
tree612acee4fed0ca0e594843c9b3260cd10eeecb8b /tools/profiling/latency_profile
parent4b65b1dec305edf96b05375155dc918c974a626a (diff)
Lower latency profiling
Current latency profiles have their tails dominated by writing latency logs, which is hugely undesirable. Now when a thread log fills up, push it to a background thread to write to disk. At shutdown, wait for all latency traces to be flushed.
Diffstat (limited to 'tools/profiling/latency_profile')
-rwxr-xr-xtools/profiling/latency_profile/profile_analyzer.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/profiling/latency_profile/profile_analyzer.py b/tools/profiling/latency_profile/profile_analyzer.py
index b12e1074e5..b2a38ea60a 100755
--- a/tools/profiling/latency_profile/profile_analyzer.py
+++ b/tools/profiling/latency_profile/profile_analyzer.py
@@ -49,7 +49,7 @@ class ScopeBuilder(object):
self.call_stack_builder.lines.append(line_item)
def finish(self, line):
- assert line['tag'] == self.top_line.tag, 'expected %s, got %s' % (self.top_line.tag, line['tag'])
+ assert line['tag'] == self.top_line.tag, 'expected %s, got %s; thread=%s; t0=%f t1=%f' % (self.top_line.tag, line['tag'], line['thd'], self.top_line.start_time, line['t'])
final_time_stamp = line['t']
assert self.top_line.end_time is None
self.top_line.end_time = final_time_stamp
@@ -84,6 +84,7 @@ class CallStackBuilder(object):
self.stk.append(ScopeBuilder(self, line))
return False
elif line_type == '}':
+ assert self.stk, 'expected non-empty stack for closing %s; thread=%s; t=%f' % (line['tag'], line['thd'], line['t'])
self.stk.pop().finish(line)
if not self.stk:
self.finish()