diff options
author | Ben Cheng <bccheng@google.com> | 2012-01-09 13:41:10 -0800 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2012-01-09 13:41:10 -0800 |
commit | f0d3b7aa5413763a254f1bf032ba50542506abfc (patch) | |
tree | 307dc4318ff1e66447deddf46b1dd64a647882d2 | |
parent | 49e77ac26c5e021feb1d860557033e9e89bc338a (diff) | |
download | oprofile-f0d3b7aa5413763a254f1bf032ba50542506abfc.tar.gz |
Allow setting symbols path explicitly through -p/--image-path.
As long as all arguments to opreport are still pass-through there is no
need to add explcit getopt cases.
Change-Id: Iac2d3ec2805f5207a089f623e9559c01abe7c7c0
-rwxr-xr-x | oprofile_android | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/oprofile_android b/oprofile_android index 4f1a940..efdadde 100755 --- a/oprofile_android +++ b/oprofile_android @@ -439,12 +439,15 @@ class Tool: def _execute_opannotate(self, command_args): try: - opts, args = getopt.getopt(command_args, 'sa', ['source', 'assembly', - 'help']) + opts, args = getopt.getopt(command_args, 'sap:', + ['source', 'assembly', 'help', 'image-path=']) except getopt.GetoptError, e: print '* Unsupported opannotate command arguments:', str(e) return 2 + # Start with the default symbols directory + symbols_dirs = symbols_dir + anno_flag = [] for o, a in opts: if o in ('-s', '--source'): @@ -454,10 +457,12 @@ class Tool: anno_flag.append('--objdump-params=-Cd') if o in ('--help'): anno_flag.append('--help') + if o in ('p', '--image-path'): + symbols_dirs = a + ',' + symbols_dir return execute([opannotate_bin, '--session-dir=' + self.session_dir, - '--image-path=' + symbols_dir + ',' + system_dir] + anno_flag + args) + '--image-path=' + symbols_dirs + ',' + system_dir] + anno_flag + args) # Main entry point tool = Tool(sys.argv) |