OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """The Deep Memory Profiler analyzer script. | 5 """The Deep Memory Profiler analyzer script. |
6 | 6 |
7 See http://dev.chromium.org/developers/deep-memory-profiler for details. | 7 See http://dev.chromium.org/developers/deep-memory-profiler for details. |
8 """ | 8 """ |
9 | 9 |
10 import logging | 10 import logging |
11 import sys | 11 import sys |
12 | 12 |
13 from lib.exceptions import ParsingException | 13 from lib.exceptions import ParsingException |
14 import subcommands | 14 import subcommands |
15 | 15 |
16 | 16 |
17 LOGGER = logging.getLogger('dmprof') | 17 LOGGER = logging.getLogger('dmprof') |
18 | 18 |
19 | 19 |
20 def main(): | 20 def main(): |
21 COMMANDS = { | 21 COMMANDS = { |
| 22 'addr': subcommands.AddrCommand, |
22 'buckets': subcommands.BucketsCommand, | 23 'buckets': subcommands.BucketsCommand, |
23 'cat': subcommands.CatCommand, | 24 'cat': subcommands.CatCommand, |
24 'csv': subcommands.CSVCommand, | 25 'csv': subcommands.CSVCommand, |
25 'expand': subcommands.ExpandCommand, | 26 'expand': subcommands.ExpandCommand, |
26 'json': subcommands.JSONCommand, | 27 'json': subcommands.JSONCommand, |
27 'list': subcommands.ListCommand, | 28 'list': subcommands.ListCommand, |
28 'map': subcommands.MapCommand, | 29 'map': subcommands.MapCommand, |
29 'pprof': subcommands.PProfCommand, | 30 'pprof': subcommands.PProfCommand, |
30 'stacktrace': subcommands.StacktraceCommand, | 31 'stacktrace': subcommands.StacktraceCommand, |
31 'upload': subcommands.UploadCommand, | 32 'upload': subcommands.UploadCommand, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 errorcode = COMMANDS[action]().do(sys.argv) | 73 errorcode = COMMANDS[action]().do(sys.argv) |
73 except ParsingException, e: | 74 except ParsingException, e: |
74 errorcode = 1 | 75 errorcode = 1 |
75 sys.stderr.write('Exit by parsing error: %s\n' % e) | 76 sys.stderr.write('Exit by parsing error: %s\n' % e) |
76 | 77 |
77 return errorcode | 78 return errorcode |
78 | 79 |
79 | 80 |
80 if __name__ == '__main__': | 81 if __name__ == '__main__': |
81 sys.exit(main()) | 82 sys.exit(main()) |
OLD | NEW |