Index: tools/cygprofile/patch_orderfile.py |
diff --git a/tools/cygprofile/patch_orderfile.py b/tools/cygprofile/patch_orderfile.py |
index f4b590f49c799a46ff467a82fdb2144ff3f7177e..799bb2fc3be391f4740b92051f8744a713695a44 100755 |
--- a/tools/cygprofile/patch_orderfile.py |
+++ b/tools/cygprofile/patch_orderfile.py |
@@ -26,6 +26,7 @@ The general pipeline is: |
import collections |
import logging |
+import optparse |
import sys |
import symbol_extractor |
@@ -204,11 +205,17 @@ def _PrintSymbolsWithPrefixes(symbol_names, output_file): |
def main(argv): |
+ parser = optparse.OptionParser() |
+ parser.add_option('--target_arch', action='store', type='string', |
+ dest='arch', default='arm', |
+ help='The target architecture for libchrome.so') |
+ options, argv = parser.parse_args(argv) |
if len(argv) != 3: |
print 'Usage: %s <unpatched_orderfile> <libchrome.so>' % argv[0] |
return 1 |
orderfile_filename = argv[1] |
binary_filename = argv[2] |
+ symbol_extractor.SetArchitecture(options.arch) |
(offset_to_symbol_infos, name_to_symbol_infos) = _GroupSymbolInfosFromBinary( |
binary_filename) |
profiled_symbols = GetSymbolsFromOrderfile(orderfile_filename) |