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

Unified Diff: tools/cygprofile/patch_orderfile.py

Issue 297063002: Fix patch_orderfile.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Egor's comments Created 6 years, 7 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/cygprofile/patch_orderfile.py
diff --git a/tools/cygprofile/patch_orderfile.py b/tools/cygprofile/patch_orderfile.py
index 17cde76b96e9960b9d7a5a1e97d8a2ab0598ec70..a06955680bc259ab0beefcb6ae3ec82a7c43be07 100755
--- a/tools/cygprofile/patch_orderfile.py
+++ b/tools/cygprofile/patch_orderfile.py
@@ -39,7 +39,6 @@ while nm_index < len(nmlines):
nm_index = nm_index + 1
def binary_search (addr, start, end):
- # print "addr: " + str(addr) + " start: " + str(start) + " end: " + str(end)
if start >= end or start == end - 1:
(nm_addr, size) = uniqueAddrs[start]
if not (addr >= nm_addr and addr < nm_addr + size):
@@ -51,7 +50,6 @@ def binary_search (addr, start, end):
else:
halfway = start + ((end - start) / 2)
(nm_addr, size) = uniqueAddrs[halfway]
- # print "nm_addr: " + str(nm_addr) + " halfway: " + str(halfway)
if (addr >= nm_addr and addr < nm_addr + size):
return (addressMap[nm_addr], size)
elif (addr < nm_addr):
@@ -107,11 +105,13 @@ sys.stderr.write ("symbols found: " + str(symbols_found) + "\n")
sys.stderr.write ("number of addresses: " + str(len(addresses)) + "\n")
total_size = 0
for addr in addresses:
- # if (count % 500 == 0):
- # print "current count: " + str(count)
(functions, size) = binary_search (addr, 0, len(uniqueAddrs))
total_size = total_size + size
+ prefixes = ['.text.', '.text.startup.', '.text.hot.', '.text.unlikely.']
for function in functions:
- print ".text." + function
- print ""
+ for prefix in prefixes:
+ print prefix + function
+
+# The following is needed otherwise Gold only applies a partial sort.
+print '.text.*'
sys.stderr.write ("total_size: " + str(total_size) + "\n")
« 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