diff options
author | Narayan Kamath <narayan@google.com> | 2011-08-16 17:53:51 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2011-08-17 10:12:38 +0100 |
commit | a2e215abe628d95138749a4813575f8882c1efd0 (patch) | |
tree | 749a9c8d019f030e506d0bedbbf070fe70d89b80 | |
parent | 801d6dd1bc0b65b8b26c03713592d717877e6d60 (diff) | |
download | oprofile-a2e215abe628d95138749a4813575f8882c1efd0.tar.gz |
Fix a typo in oprofile_androidandroid-sdk-adt_r16.0.1android-sdk-4.0.3_r1android-sdk-4.0.3-tools_r1android-cts-verifier-4.0_r1android-cts-verifier-4.0.3_r1android-cts-4.0_r1android-cts-4.0.3_r2android-cts-4.0.3_r1android-4.0.4_r2.1android-4.0.4_r2android-4.0.4_r1.2android-4.0.4_r1.1android-4.0.4_r1android-4.0.4-aah_r1android-4.0.3_r1.1android-4.0.3_r1android-4.0.2_r1android-4.0.1_r1.2android-4.0.1_r1.1android-4.0.1_r1ics-mr1-releaseics-mr0-releaseics-mr0ics-factoryrom-2-releaseics-aah-release
The typo (in specifying the --kernel-range argument) completely breaks
kernel profiling because the kernel end address will always be 0
and < the start address. All kernel samples will therefore be discarded.
I've also added very basic support for turning on kernel profiling via
this script.
Change-Id: I64b4063cb994ca94a51ed5aa0159aa4ae1627969
-rwxr-xr-x | oprofile_android | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/oprofile_android b/oprofile_android index 4e05090..8527499 100755 --- a/oprofile_android +++ b/oprofile_android @@ -116,6 +116,9 @@ class Tool: print " (not supported on all devices)" print " -c, --callgraph=[depth] : specify callgraph capture depth, default is none" print " (not supported in timer mode)" + print " -k, --kernel-image : specifies the location of a kernel image relative to the symbols directory" + print " (and turns on kernel profiling). This need not be the same as the" + print " location of the kernel on the actual device." print print " shutdown : shutdown profiler" print @@ -193,11 +196,13 @@ class Tool: def do_setup(self, command_args): events = [] timer = False + kernel = False + kernel_image = '' callgraph = None try: opts, args = getopt.getopt(command_args, - 'te:c:', ['timer', 'event=', 'callgraph=']) + 'te:c:k:', ['timer', 'event=', 'callgraph=', 'kernel=']) except getopt.GetoptError, e: print '* Unsupported setup command arguments:', str(e) return 2 @@ -209,6 +214,9 @@ class Tool: events.append('--event=' + a) elif o in ('-c', '--callgraph'): callgraph = a + elif o in ('-k', '--kernel'): + kernel = True + kernel_image = a if len(args) != 0: print '* Unsupported setup command arguments: %s' % (' '.join(args)) @@ -231,6 +239,8 @@ class Tool: opcontrol_args.append('--timer') if callgraph is not None: opcontrol_args.append('--callgraph=' + callgraph) + if kernel and len(kernel_image) != 0: + opcontrol_args.append('--vmlinux=' + kernel_image) # Get kernal VMA range. rc, output = self.adb.shell(['cat', '/proc/kallsyms'], echo=False) @@ -244,7 +254,7 @@ class Tool: # Setup the profiler. rc, output = self.adb.shell(['/system/xbin/opcontrol'] + self._opcontrol_verbose_arg() + [ '--reset', - '--kernel-range=' + vma_start + '-' + vma_end] + opcontrol_args + [ + '--kernel-range=' + vma_start + ',' + vma_end] + opcontrol_args + [ '--setup', '--status', '--verbose-log=all']) if rc != 0: |