Commit 018a1f88 authored by mtrofin's avatar mtrofin Committed by Commit bot

[ll_prof] show tick count

Show tick count, besides the percentage spent on an
instruction. Aids perf investigations where we deal with
stalls, for example. Percentage-wise, the execution appears
distributed similarly, but the regression becomes more
apparent in the tick counts.

Review URL: https://codereview.chromium.org/1607323003

Cr-Commit-Position: refs/heads/master@{#33452}
parent adb2fa87
......@@ -173,11 +173,19 @@ class Code(object):
break
count += cnt
total_count += count
count = 100.0 * count / self.self_ticks
if count >= 0.01:
print "%15.2f %x: %s" % (count, lines[i][0], lines[i][1])
percent = 100.0 * count / self.self_ticks
offset = lines[i][0]
if percent >= 0.01:
# 5 spaces for tick count
# 1 space following
# 1 for '|'
# 1 space following
# 6 for the percentage number, incl. the '.'
# 1 for the '%' sign
# => 15
print "%5d | %6.2f%% %x: %s" % (count, percent, offset, lines[i][1])
else:
print "%s %x: %s" % (" " * 15, lines[i][0], lines[i][1])
print "%s %x: %s" % (" " * 15, offset, lines[i][1])
print
assert total_count == self.self_ticks, \
"Lost ticks (%d != %d) in %s" % (total_count, self.self_ticks, self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment