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

Side by Side Diff: tools/deep_memory_profiler/dmprof

Issue 10411047: Type profiler by intercepting 'new' and 'delete' expressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """The deep heap profiler script for Chrome.""" 6 """The deep heap profiler script for Chrome."""
7 7
8 from datetime import datetime 8 from datetime import datetime
9 import json 9 import json
10 import optparse 10 import optparse
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 'nonprofiled-anonymous_committed', 543 'nonprofiled-anonymous_committed',
544 'nonprofiled-file-exec_committed', 544 'nonprofiled-file-exec_committed',
545 'nonprofiled-file-nonexec_committed', 545 'nonprofiled-file-nonexec_committed',
546 'nonprofiled-stack_committed', 546 'nonprofiled-stack_committed',
547 'nonprofiled-other_committed') 547 'nonprofiled-other_committed')
548 sizes['mustbezero'] = ( 548 sizes['mustbezero'] = (
549 self.counters['total_committed'] - 549 self.counters['total_committed'] -
550 sum(self.counters[i] for i in removed)) 550 sum(self.counters[i] for i in removed))
551 if 'total-exclude-profiler' in sizes: 551 if 'total-exclude-profiler' in sizes:
552 sizes['total-exclude-profiler'] = ( 552 sizes['total-exclude-profiler'] = (
553 self.counters['total_committed'] - sizes['mmap-profiler']) 553 self.counters['total_committed'] -
554 (sizes['mmap-profiler'] + sizes['mmap-type-profiler']))
554 if 'hour' in sizes: 555 if 'hour' in sizes:
555 sizes['hour'] = (self.dump_time - first_dump_time) / 60.0 / 60.0 556 sizes['hour'] = (self.dump_time - first_dump_time) / 60.0 / 60.0
556 if 'minute' in sizes: 557 if 'minute' in sizes:
557 sizes['minute'] = (self.dump_time - first_dump_time) / 60.0 558 sizes['minute'] = (self.dump_time - first_dump_time) / 60.0
558 if 'second' in sizes: 559 if 'second' in sizes:
559 sizes['second'] = self.dump_time - first_dump_time 560 sizes['second'] = self.dump_time - first_dump_time
560 561
561 return sizes 562 return sizes
562 563
563 @staticmethod 564 @staticmethod
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 dmprof stacktrace [--keep] <dump> 1139 dmprof stacktrace [--keep] <dump>
1139 """ % (sys.argv[0])) 1140 """ % (sys.argv[0]))
1140 sys.exit(1) 1141 sys.exit(1)
1141 action = sys.argv.pop(1) 1142 action = sys.argv.pop(1)
1142 1143
1143 return COMMANDS[action](sys.argv) 1144 return COMMANDS[action](sys.argv)
1144 1145
1145 1146
1146 if __name__ == '__main__': 1147 if __name__ == '__main__':
1147 sys.exit(main()) 1148 sys.exit(main())
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/type_profiler_map.cc ('k') | tools/deep_memory_profiler/policy.l0.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698