| OLD | NEW |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 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 """Classes that comprise the data model for binary size analysis. | 4 """Classes that comprise the data model for binary size analysis. |
| 5 | 5 |
| 6 The primary classes are Symbol, and SymbolGroup. | 6 The primary classes are Symbol, and SymbolGroup. |
| 7 | 7 |
| 8 Description of common properties: | 8 Description of common properties: |
| 9 * address: The start address of the symbol. | 9 * address: The start address of the symbol. |
| 10 May be 0 (e.g. for .bss or for SymbolGroups). | 10 May be 0 (e.g. for .bss or for SymbolGroups). |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 if self.IsBss(): | 348 if self.IsBss(): |
| 349 self._size = sum(s.size for s in self) | 349 self._size = sum(s.size for s in self) |
| 350 else: | 350 else: |
| 351 self._size = sum(s.size for s in self.IterUniqueSymbols()) | 351 self._size = sum(s.size for s in self.IterUniqueSymbols()) |
| 352 return self._size | 352 return self._size |
| 353 | 353 |
| 354 @property | 354 @property |
| 355 def pss(self): | 355 def pss(self): |
| 356 if self._pss is None: | 356 if self._pss is None: |
| 357 if self.IsBss(): | 357 if self.IsBss(): |
| 358 self._pss = float(self.size) | 358 self._pss = sum(s.pss for s in self) |
| 359 else: | 359 else: |
| 360 self._pss = sum(s.pss for s in self) | 360 self._pss = sum(s.pss for s in self if not s.IsBss()) |
| 361 return self._pss | 361 return self._pss |
| 362 | 362 |
| 363 @property | 363 @property |
| 364 def padding(self): | 364 def padding(self): |
| 365 if self._padding is None: | 365 if self._padding is None: |
| 366 self._padding = sum(s.padding for s in self.IterUniqueSymbols()) | 366 self._padding = sum(s.padding for s in self.IterUniqueSymbols()) |
| 367 return self._padding | 367 return self._padding |
| 368 | 368 |
| 369 @property | 369 @property |
| 370 def aliases(self): | 370 def aliases(self): |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 741 |
| 742 | 742 |
| 743 def _ExtractSuffixAfterSeparator(string, separator, count): | 743 def _ExtractSuffixAfterSeparator(string, separator, count): |
| 744 prev_idx = len(string) + 1 | 744 prev_idx = len(string) + 1 |
| 745 for _ in xrange(count): | 745 for _ in xrange(count): |
| 746 idx = string.rfind(separator, 0, prev_idx - 1) | 746 idx = string.rfind(separator, 0, prev_idx - 1) |
| 747 if idx < 0: | 747 if idx < 0: |
| 748 break | 748 break |
| 749 prev_idx = idx | 749 prev_idx = idx |
| 750 return string[:prev_idx] | 750 return string[:prev_idx] |
| OLD | NEW |