Commit 42cab11e authored by bratell's avatar bratell Committed by Commit bot

binarysize tool: Cleaning up some progress output.

R=primiano

BUG=

Review URL: https://codereview.chromium.org/399683004

Cr-Commit-Position: refs/heads/master@{#292999}
parent 4c43a285
...@@ -13,6 +13,7 @@ import re ...@@ -13,6 +13,7 @@ import re
import subprocess import subprocess
import sys import sys
import threading import threading
import time
# addr2line builds a possibly infinite memory cache that can exhaust # addr2line builds a possibly infinite memory cache that can exhaust
...@@ -184,12 +185,17 @@ class ELFSymbolizer(object): ...@@ -184,12 +185,17 @@ class ELFSymbolizer(object):
def _CreateDisambiguationTable(self): def _CreateDisambiguationTable(self):
""" Non-unique file names will result in None entries""" """ Non-unique file names will result in None entries"""
start_time = time.time()
logging.info('Collecting information about available source files...')
self.disambiguation_table = {} self.disambiguation_table = {}
for root, _, filenames in os.walk(self.source_root_path): for root, _, filenames in os.walk(self.source_root_path):
for f in filenames: for f in filenames:
self.disambiguation_table[f] = os.path.join(root, f) if (f not in self.disambiguation_table[f] = os.path.join(root, f) if (f not in
self.disambiguation_table) else None self.disambiguation_table) else None
logging.info('Finished collecting information about '
'possible files (took %.1f s).',
(time.time() - start_time))
class Addr2Line(object): class Addr2Line(object):
......
...@@ -541,7 +541,7 @@ def RunElfSymbolizer(outfile, library, addr2line_binary, nm_binary, jobs, ...@@ -541,7 +541,7 @@ def RunElfSymbolizer(outfile, library, addr2line_binary, nm_binary, jobs,
sys.stdout.write('\r%.1f%%: Looked up %d symbols (%d collisions, ' sys.stdout.write('\r%.1f%%: Looked up %d symbols (%d collisions, '
'%d disambiguations where %.1f%% succeeded)' '%d disambiguations where %.1f%% succeeded)'
'- %.1f lookups/s.' % ' - %.1f lookups/s.' %
(progress_percent, progress.count, progress.collisions, (progress_percent, progress.count, progress.collisions,
progress.disambiguations, disambiguation_percent, speed)) progress.disambiguations, disambiguation_percent, speed))
...@@ -618,7 +618,6 @@ def RunElfSymbolizer(outfile, library, addr2line_binary, nm_binary, jobs, ...@@ -618,7 +618,6 @@ def RunElfSymbolizer(outfile, library, addr2line_binary, nm_binary, jobs,
def RunNm(binary, nm_binary): def RunNm(binary, nm_binary):
print('Starting nm')
cmd = [nm_binary, '-C', '--print-size', '--size-sort', '--reverse-sort', cmd = [nm_binary, '-C', '--print-size', '--size-sort', '--reverse-sort',
binary] binary]
nm_process = subprocess.Popen(cmd, nm_process = subprocess.Popen(cmd,
...@@ -632,7 +631,6 @@ def RunNm(binary, nm_binary): ...@@ -632,7 +631,6 @@ def RunNm(binary, nm_binary):
else: else:
raise Exception, process_output raise Exception, process_output
print('Finished nm')
return process_output return process_output
......
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