Commit efd4dc04 authored by Jasper Chapman-Black's avatar Jasper Chapman-Black Committed by Commit Bot

SuperSize: Set full_name on diffed aggregate padding symbols

Since padding can change somewhat arbitrarily, SuperSize diff doesn't surface
every individual symbol's padding shift - it aggregates padding changes by
section, and gives them a name marking them as an overhead symbol.

Unfortunately these symbols weren't being given a full_name, so they showed up
in the Tiger viewer with no name or record of where they're from.

Change-Id: I9c3056c4358ef487df4411047c98440d38bbeca6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1916687Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Jasper Chapman-Black <jaspercb@chromium.org>
Auto-Submit: Jasper Chapman-Black <jaspercb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715375}
parent 896eac43
...@@ -110,10 +110,10 @@ def _DiffSymbolGroups(before, after): ...@@ -110,10 +110,10 @@ def _DiffSymbolGroups(before, after):
# Create a DeltaSymbol to represent the zero'd out padding of matched symbols. # Create a DeltaSymbol to represent the zero'd out padding of matched symbols.
for section_name, padding in padding_by_section_name.iteritems(): for section_name, padding in padding_by_section_name.iteritems():
if padding != 0: if padding != 0:
after_sym = models.Symbol( after_sym = models.Symbol(section_name, padding)
section_name, # This is after _NormalizeNames() is called, so set |full_name|,
padding, # |template_name|, and |name|.
name="Overhead: aggregate padding of diff'ed symbols") after_sym.SetName("Overhead: aggregate padding of diff'ed symbols")
after_sym.padding = padding after_sym.padding = padding
all_deltas.append(models.DeltaSymbol(None, after_sym)) all_deltas.append(models.DeltaSymbol(None, after_sym))
......
...@@ -422,6 +422,12 @@ class Symbol(BaseSymbol): ...@@ -422,6 +422,12 @@ class Symbol(BaseSymbol):
self.padding, self.full_name, self.object_path, self.source_path, self.padding, self.full_name, self.object_path, self.source_path,
self.FlagsString(), self.num_aliases, self.component) self.FlagsString(), self.num_aliases, self.component)
def SetName(self, full_name, template_name=None, name=None):
# Note that _NormalizeNames() will clobber these values.
self.full_name = full_name
self.template_name = full_name if template_name is None else template_name
self.name = full_name if name is None else name
@property @property
def pss(self): def pss(self):
return float(self.size) / self.num_aliases return float(self.size) / self.num_aliases
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
Entering interactive Python shell. Quick reference: Entering interactive Python shell. Quick reference:
SizeInfo: metadata, native_symbols, pak_symbols, raw_symbols, section_sizes, size_path, symbols SizeInfo: metadata, native_symbols, pak_symbols, raw_symbols, section_sizes, size_path, symbols
Symbol: FlagsString, IsBss, IsDelta, IsDex, IsGeneratedByToolchain, IsGroup, IsNameUnique, IsNative, IsOther, IsOverhead, IsPak, IsStringLiteral, IterLeafSymbols, address, aliases, component, end_address, flags, full_name, generated_source, is_anonymous, name, num_aliases, object_path, padding, padding_pss, pss, pss_without_padding, section, section_name, size, size_without_padding, source_path, template_name Symbol: FlagsString, IsBss, IsDelta, IsDex, IsGeneratedByToolchain, IsGroup, IsNameUnique, IsNative, IsOther, IsOverhead, IsPak, IsStringLiteral, IterLeafSymbols, SetName, address, aliases, component, end_address, flags, full_name, generated_source, is_anonymous, name, num_aliases, object_path, padding, padding_pss, pss, pss_without_padding, section, section_name, size, size_without_padding, source_path, template_name
SymbolGroup (extends Symbol): CountUniqueSymbols, Filter, GroupedBy, GroupedByAliases, GroupedByComponent, GroupedByFullName, GroupedByName, GroupedByPath, GroupedBySectionName, Inverted, IterUniqueSymbols, SetName, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAddressInRange, WhereComponentMatches, WhereFullNameMatches, WhereGeneratedByToolchain, WhereHasAnyAttribution, WhereHasComponent, WhereHasFlag, WhereHasPath, WhereInSection, WhereIsDex, WhereIsGroup, WhereIsNative, WhereIsPak, WhereIsTemplate, WhereMatches, WhereNameMatches, WhereObjectPathMatches, WherePathMatches, WherePssBiggerThan, WhereSizeBiggerThan, WhereSourceIsGenerated, WhereSourcePathMatches, WhereTemplateNameMatches, index, is_default_sorted SymbolGroup (extends Symbol): CountUniqueSymbols, Filter, GroupedBy, GroupedByAliases, GroupedByComponent, GroupedByFullName, GroupedByName, GroupedByPath, GroupedBySectionName, Inverted, IterUniqueSymbols, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAddressInRange, WhereComponentMatches, WhereFullNameMatches, WhereGeneratedByToolchain, WhereHasAnyAttribution, WhereHasComponent, WhereHasFlag, WhereHasPath, WhereInSection, WhereIsDex, WhereIsGroup, WhereIsNative, WhereIsPak, WhereIsTemplate, WhereMatches, WhereNameMatches, WhereObjectPathMatches, WherePathMatches, WherePssBiggerThan, WhereSizeBiggerThan, WhereSourceIsGenerated, WhereSourcePathMatches, WhereTemplateNameMatches, index, is_default_sorted
DeltaSizeInfo: after, before, native_symbols, pak_symbols, raw_symbols, section_sizes, symbols DeltaSizeInfo: after, before, native_symbols, pak_symbols, raw_symbols, section_sizes, symbols
DeltaSymbol (extends Symbol): after_symbol, before_symbol, diff_status DeltaSymbol (extends Symbol): after_symbol, before_symbol, diff_status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment