OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import commands | 6 import commands |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 | 9 |
10 orderfile = sys.argv[1] | 10 orderfile = sys.argv[1] |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 addrs = [] | 100 addrs = [] |
101 # sys.stderr.write ("WARNING: could not find symbol " + function + "\n") | 101 # sys.stderr.write ("WARNING: could not find symbol " + function + "\n") |
102 for addr in addrs: | 102 for addr in addrs: |
103 if not (addr in addresses): | 103 if not (addr in addresses): |
104 addresses.append(addr) | 104 addresses.append(addr) |
105 sys.stderr.write ("symbols found: " + str(symbols_found) + "\n") | 105 sys.stderr.write ("symbols found: " + str(symbols_found) + "\n") |
106 | 106 |
107 sys.stderr.write ("number of addresses: " + str(len(addresses)) + "\n") | 107 sys.stderr.write ("number of addresses: " + str(len(addresses)) + "\n") |
108 total_size = 0 | 108 total_size = 0 |
109 for addr in addresses: | 109 for addr in addresses: |
110 # if (count % 500 == 0): | 110 # if (count % 500 == 0): |
pasko
2014/05/26 14:27:48
please remove this commented-out code
Philippe
2014/05/26 14:37:22
Done.
| |
111 # print "current count: " + str(count) | 111 # print "current count: " + str(count) |
112 (functions, size) = binary_search (addr, 0, len(uniqueAddrs)) | 112 (functions, size) = binary_search (addr, 0, len(uniqueAddrs)) |
113 total_size = total_size + size | 113 total_size = total_size + size |
114 prefixes = ['.text.', '.text.startup.', '.text.hot.', '.text.unlikely.'] | |
114 for function in functions: | 115 for function in functions: |
115 print ".text." + function | 116 for prefix in prefixes: |
116 print "" | 117 print prefix + function |
118 | |
119 # The following is needed otherwise Gold only applies a partial sort. | |
120 print '.text.*' | |
117 sys.stderr.write ("total_size: " + str(total_size) + "\n") | 121 sys.stderr.write ("total_size: " + str(total_size) + "\n") |
OLD | NEW |