OLD | NEW |
1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 }) | 404 }) |
405 | 405 |
406 def PrintEntries(self, entries, condition): | 406 def PrintEntries(self, entries, condition): |
407 # If ignoring unaccounted ticks don't include these in percentage | 407 # If ignoring unaccounted ticks don't include these in percentage |
408 # calculations | 408 # calculations |
409 number_of_accounted_ticks = self.total_number_of_ticks | 409 number_of_accounted_ticks = self.total_number_of_ticks |
410 if self.ignore_unknown: | 410 if self.ignore_unknown: |
411 number_of_accounted_ticks -= self.unaccounted_number_of_ticks | 411 number_of_accounted_ticks -= self.unaccounted_number_of_ticks |
412 | 412 |
413 number_of_non_library_ticks = number_of_accounted_ticks - self.number_of_lib
rary_ticks | 413 number_of_non_library_ticks = number_of_accounted_ticks - self.number_of_lib
rary_ticks |
414 entries.sort(key=lambda e:e.tick_count, reverse=True) | 414 entries.sort(key=lambda e: (e.tick_count, e.ToString()), reverse=True) |
415 for entry in entries: | 415 for entry in entries: |
416 if entry.tick_count > 0 and condition(entry): | 416 if entry.tick_count > 0 and condition(entry): |
417 total_percentage = entry.tick_count * 100.0 / number_of_accounted_ticks | 417 total_percentage = entry.tick_count * 100.0 / number_of_accounted_ticks |
418 if entry.IsSharedLibraryEntry(): | 418 if entry.IsSharedLibraryEntry(): |
419 non_library_percentage = 0 | 419 non_library_percentage = 0 |
420 else: | 420 else: |
421 non_library_percentage = entry.tick_count * 100.0 / number_of_non_libr
ary_ticks | 421 non_library_percentage = entry.tick_count * 100.0 / number_of_non_libr
ary_ticks |
422 print(' %(ticks)5d %(total)5.1f%% %(nonlib)6.1f%% %(name)s' % { | 422 print(' %(ticks)5d %(total)5.1f%% %(nonlib)6.1f%% %(name)s' % { |
423 'ticks' : entry.tick_count, | 423 'ticks' : entry.tick_count, |
424 'total' : total_percentage, | 424 'total' : total_percentage, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 }) | 526 }) |
527 sys.exit(2) | 527 sys.exit(2) |
528 | 528 |
529 def RunLogfileProcessing(self, tick_processor): | 529 def RunLogfileProcessing(self, tick_processor): |
530 tick_processor.ProcessLogfile(self.log_file, self.state, self.ignore_unknown
, | 530 tick_processor.ProcessLogfile(self.log_file, self.state, self.ignore_unknown
, |
531 self.separate_ic, self.call_graph_json) | 531 self.separate_ic, self.call_graph_json) |
532 | 532 |
533 | 533 |
534 if __name__ == '__main__': | 534 if __name__ == '__main__': |
535 sys.exit('You probably want to run windows-tick-processor.py or linux-tick-pro
cessor.py.') | 535 sys.exit('You probably want to run windows-tick-processor.py or linux-tick-pro
cessor.py.') |
OLD | NEW |