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

Unified Diff: tools/tickprocessor.py

Issue 21410: Include all the code in code creation log events. The code object header size... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 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 | « tools/linux-tick-processor.py ('k') | tools/windows-tick-processor.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tickprocessor.py
===================================================================
--- tools/tickprocessor.py (revision 1294)
+++ tools/tickprocessor.py (working copy)
@@ -156,10 +156,14 @@
self.number_of_library_ticks = 0
self.unaccounted_number_of_ticks = 0
self.excluded_number_of_ticks = 0
+ # Flag indicating whether to ignore unaccounted ticks in the report
+ self.ignore_unknown = False
- def ProcessLogfile(self, filename, included_state = None):
+ def ProcessLogfile(self, filename, included_state = None, ignore_unknown = False):
self.log_file = filename
self.included_state = included_state
+ self.ignore_unknown = ignore_unknown
+
try:
logfile = open(filename, 'rb')
except IOError:
@@ -253,7 +257,7 @@
return entry
max = self.js_entries.FindMax()
min = self.js_entries.FindMin()
- if max != None and pc < max.key and pc > min.key:
+ if max != None and pc < (max.key + max.value.size) and pc > min.key:
return self.js_entries.FindGreatestsLessThan(pc).value
return None
@@ -289,6 +293,13 @@
js_entries = self.js_entries.ExportValueList()
js_entries.extend(self.deleted_code)
cpp_entries = self.cpp_entries.ExportValueList()
+ # Print the unknown ticks percentage if they are not ignored.
+ if not self.ignore_unknown and self.unaccounted_number_of_ticks > 0:
+ self.PrintHeader('Unknown')
+ unknown_percentage = self.unaccounted_number_of_ticks * 100.0 / self.total_number_of_ticks
+ print(' %(total)5.1f%%' % {
+ 'total' : unknown_percentage,
+ })
# Print the library ticks.
self.PrintHeader('Shared libraries')
self.PrintEntries(cpp_entries, lambda e:e.IsSharedLibraryEntry())
@@ -309,7 +320,12 @@
print(' total nonlib name')
def PrintEntries(self, entries, condition):
- number_of_accounted_ticks = self.total_number_of_ticks - self.unaccounted_number_of_ticks
+ # If ignoring unaccounted ticks don't include these in percentage
+ # calculations
+ number_of_accounted_ticks = self.total_number_of_ticks
+ if self.ignore_unknown:
+ number_of_accounted_ticks -= self.unaccounted_number_of_ticks
+
number_of_non_library_ticks = number_of_accounted_ticks - self.number_of_library_ticks
entries.sort(key=lambda e:e.tick_count, reverse=True)
for entry in entries:
« no previous file with comments | « tools/linux-tick-processor.py ('k') | tools/windows-tick-processor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698