OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import copy | 5 import copy |
6 import datetime | 6 import datetime |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import re | 9 import re |
10 import time | 10 import time |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 Args: | 144 Args: |
145 path: A file path string to load. | 145 path: A file path string to load. |
146 log_header: A preceding string for log messages. | 146 log_header: A preceding string for log messages. |
147 | 147 |
148 Returns: | 148 Returns: |
149 A loaded Dump object. | 149 A loaded Dump object. |
150 | 150 |
151 Raises: | 151 Raises: |
152 ParsingException for invalid heap profile dumps. | 152 ParsingException for invalid heap profile dumps. |
153 """ | 153 """ |
154 dump = Dump(path, os.stat(path).st_mtime) | 154 dump = DeepDump(path, os.stat(path).st_mtime) |
155 with open(path, 'r') as f: | 155 with open(path, 'r') as f: |
156 dump.load_file(f, log_header) | 156 dump.load_file(f, log_header) |
157 return dump | 157 return dump |
158 | 158 |
159 def load_file(self, f, log_header): | 159 def load_file(self, f, log_header): |
160 self._lines = [line for line in f | 160 self._lines = [line for line in f |
161 if line and not line.startswith('#')] | 161 if line and not line.startswith('#')] |
162 | 162 |
163 try: | 163 try: |
164 self._version, ln = self._parse_version() | 164 self._version, ln = self._parse_version() |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 Returns: | 456 Returns: |
457 A pair of an integer indicating a line number after skipped, and a | 457 A pair of an integer indicating a line number after skipped, and a |
458 boolean value which is True if found a line which skipping_condition | 458 boolean value which is True if found a line which skipping_condition |
459 is False for. | 459 is False for. |
460 """ | 460 """ |
461 while skipping_condition(index): | 461 while skipping_condition(index): |
462 index += 1 | 462 index += 1 |
463 if index >= max_index: | 463 if index >= max_index: |
464 return index, False | 464 return index, False |
465 return index, True | 465 return index, True |
OLD | NEW |