Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: tools/ll_prof.py

Issue 1007613005: Fix ll_prof.py for static binaries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Explicitly return false. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ll_prof.py
diff --git a/tools/ll_prof.py b/tools/ll_prof.py
index 409b39691775ff898d4f93ecb3fd2283976a051e..f9bea4a61f2fc561f6f98070a840b7673f47e281 100755
--- a/tools/ll_prof.py
+++ b/tools/ll_prof.py
@@ -711,6 +711,23 @@ class LibraryRepo(object):
self.names = set()
self.ticks = {}
+
+ def HasDynamicSymbols(self, filename):
+ if filename.endswith(".ko"): return False
+ process = subprocess.Popen(
+ "%s -h %s" % (OBJDUMP_BIN, filename),
+ shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ pipe = process.stdout
+ try:
+ for line in pipe:
+ match = OBJDUMP_SECTION_HEADER_RE.match(line)
+ if match and match.group(1) == 'dynsym': return True
+ finally:
+ pipe.close()
+ assert process.wait() == 0, "Failed to objdump -h %s" % filename
+ return False
+
+
def Load(self, mmap_info, code_map, options):
# Skip kernel mmaps when requested using the fact that their tid
# is 0.
@@ -730,10 +747,10 @@ class LibraryRepo(object):
# Unfortunately, section headers span two lines, so we have to
# keep the just seen section name (from the first line in each
# section header) in the after_section variable.
- if mmap_info.filename.endswith(".ko"):
- dynamic_symbols = ""
- else:
+ if self.HasDynamicSymbols(mmap_info.filename):
dynamic_symbols = "-T"
+ else:
+ dynamic_symbols = ""
process = subprocess.Popen(
"%s -h -t %s -C %s" % (OBJDUMP_BIN, dynamic_symbols, mmap_info.filename),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698