Index: tools/cygprofile/patch_orderfile.py |
diff --git a/tools/cygprofile/patch_orderfile.py b/tools/cygprofile/patch_orderfile.py |
index f4b590f49c799a46ff467a82fdb2144ff3f7177e..3870f28ab39e0d7ed13fa89e16fcb4330bb66a83 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,18 @@ def _PrintSymbolsWithPrefixes(symbol_names, output_file): |
def main(argv): |
+ parser = optparse.OptionParser() |
+ parser.add_option('--target_arch', action='store', dest='arch', |
pasko
2015/02/04 19:08:26
please use --target-arch
azarchs
2015/02/05 09:40:02
Done.
|
+ default='arm', |
+ choices=['arm', 'arm64', 'x86', 'x86_64', 'x64', 'mips'], |
+ 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] |
pasko
2015/02/04 19:08:26
This has now changed, it would be better to use pa
azarchs
2015/02/05 09:40:02
Done.
|
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) |