Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: tools/ll_prof.py

Issue 1607323003: [ll_prof] show tick count (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ll_prof.py
diff --git a/tools/ll_prof.py b/tools/ll_prof.py
index 7dac2e05eba77e1925b0fa76cb532d9914bb296e..3c4d6acd5b3916ec36bd82ddc2a2358d77d47008 100755
--- a/tools/ll_prof.py
+++ b/tools/ll_prof.py
@@ -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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698