Chromium Code Reviews| 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 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 dmprof json [-p POLICY] <first-dump> | 54 dmprof json [-p POLICY] <first-dump> |
| 55 dmprof list [-p POLICY] <first-dump> | 55 dmprof list [-p POLICY] <first-dump> |
| 56 dmprof map <first-dump> <policy> | 56 dmprof map <first-dump> <policy> |
| 57 dmprof pprof [-c COMPONENT] <dump> <policy> | 57 dmprof pprof [-c COMPONENT] <dump> <policy> |
| 58 dmprof stacktrace <dump> | 58 dmprof stacktrace <dump> |
| 59 dmprof upload [--gsutil path/to/gsutil] <first-dump> <destination-gs-path> | 59 dmprof upload [--gsutil path/to/gsutil] <first-dump> <destination-gs-path> |
| 60 """) | 60 """) |
| 61 sys.exit(1) | 61 sys.exit(1) |
| 62 action = sys.argv.pop(1) | 62 action = sys.argv.pop(1) |
| 63 | 63 |
| 64 LOGGER.setLevel(logging.DEBUG) | 64 logging.basicConfig() |
|
Dai Mikurube (NOT FULLTIME)
2014/01/28 01:49:29
No. Here, I name LOGGER as 'dmprof' at line 17. Th
| |
| 65 handler = logging.StreamHandler() | |
| 66 handler.setLevel(logging.INFO) | |
| 67 formatter = logging.Formatter('%(message)s') | |
| 68 handler.setFormatter(formatter) | |
| 69 LOGGER.addHandler(handler) | |
| 70 | 65 |
| 71 try: | 66 try: |
| 72 errorcode = COMMANDS[action]().do(sys.argv) | 67 errorcode = COMMANDS[action]().do(sys.argv) |
| 73 except ParsingException, e: | 68 except ParsingException, e: |
| 74 errorcode = 1 | 69 errorcode = 1 |
| 75 sys.stderr.write('Exit by parsing error: %s\n' % e) | 70 sys.stderr.write('Exit by parsing error: %s\n' % e) |
| 76 | 71 |
| 77 return errorcode | 72 return errorcode |
| 78 | 73 |
| 79 | 74 |
| 80 if __name__ == '__main__': | 75 if __name__ == '__main__': |
| 81 sys.exit(main()) | 76 sys.exit(main()) |
| OLD | NEW |