| 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 def PrintCallProfile(self, entries): | 380 def PrintCallProfile(self, entries): |
| 381 all_stacks = {} | 381 all_stacks = {} |
| 382 total_stacks = 0 | 382 total_stacks = 0 |
| 383 for entry in entries: | 383 for entry in entries: |
| 384 all_stacks.update(entry.stacks) | 384 all_stacks.update(entry.stacks) |
| 385 for count in entry.stacks.itervalues(): | 385 for count in entry.stacks.itervalues(): |
| 386 total_stacks += count | 386 total_stacks += count |
| 387 all_stacks_items = all_stacks.items(); | 387 all_stacks_items = all_stacks.items(); |
| 388 all_stacks_items.sort(key = itemgetter(1), reverse=True) | 388 all_stacks_items.sort(key = itemgetter(1), reverse=True) |
| 389 missing_percentage = (self.total_number_of_ticks - total_stacks) * 100.0 / s
elf.total_number_of_ticks |
| 390 print(' %(ticks)5d %(total)5.1f%% <no call path information>' % { |
| 391 'ticks' : self.total_number_of_ticks - total_stacks, |
| 392 'total' : missing_percentage |
| 393 }) |
| 389 for stack, count in all_stacks_items: | 394 for stack, count in all_stacks_items: |
| 390 total_percentage = count * 100.0 / total_stacks | 395 total_percentage = count * 100.0 / self.total_number_of_ticks |
| 391 print(' %(total)5.1f%% %(call_path)s' % { | 396 print(' %(ticks)5d %(total)5.1f%% %(call_path)s' % { |
| 397 'ticks' : count, |
| 392 'total' : total_percentage, | 398 'total' : total_percentage, |
| 393 'call_path' : stack[0] + ' <- ' + stack[1] | 399 'call_path' : stack[0] + ' <- ' + stack[1] |
| 394 }) | 400 }) |
| 395 | 401 |
| 396 | 402 |
| 397 class CmdLineProcessor(object): | 403 class CmdLineProcessor(object): |
| 398 | 404 |
| 399 def __init__(self): | 405 def __init__(self): |
| 400 self.options = ["js", "gc", "compiler", "other", "ignore-unknown", "separate
-ic"] | 406 self.options = ["js", "gc", "compiler", "other", "ignore-unknown", "separate
-ic"] |
| 401 # default values | 407 # default values |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 'req_opts': self.GetRequiredArgsNames() | 443 'req_opts': self.GetRequiredArgsNames() |
| 438 }) | 444 }) |
| 439 sys.exit(2) | 445 sys.exit(2) |
| 440 | 446 |
| 441 def RunLogfileProcessing(self, tick_processor): | 447 def RunLogfileProcessing(self, tick_processor): |
| 442 tick_processor.ProcessLogfile(self.log_file, self.state, self.ignore_unknown
, self.separate_ic) | 448 tick_processor.ProcessLogfile(self.log_file, self.state, self.ignore_unknown
, self.separate_ic) |
| 443 | 449 |
| 444 | 450 |
| 445 if __name__ == '__main__': | 451 if __name__ == '__main__': |
| 446 sys.exit('You probably want to run windows-tick-processor.py or linux-tick-pro
cessor.py.') | 452 sys.exit('You probably want to run windows-tick-processor.py or linux-tick-pro
cessor.py.') |
| OLD | NEW |