Update NDK prebuilts to build 4977750.
Taken from branch aosp-master.
Bug: none
Test: run test.py on linux, mac and windows.
Change-Id: Ieb99244afe8e5761bc04cce2836f83b3d1c77ecd
diff --git a/ChangeLog b/ChangeLog
index 08aa018..05eca02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,8 @@
3) Use progressbar to show progress of loading contents.
4) Add --binary_filter option to only annotate selected binaries.
Export tracing data in simpleperf_report_lib.py.
+Test python scripts with both python2 and python3.
+Add document for using simpleperf in Android platform profiling.
ndk r17
(release)
diff --git a/app_profiler.py b/app_profiler.py
index b0e7a92..546b614 100755
--- a/app_profiler.py
+++ b/app_profiler.py
@@ -29,8 +29,8 @@
import sys
import time
-from utils import get_script_dir, log_debug, log_info, log_exit, get_target_binary_path, extant_dir
-from utils import AdbHelper, ReadElf, remove
+from utils import AdbHelper, bytes_to_str, extant_dir, get_script_dir, get_target_binary_path
+from utils import log_debug, log_info, log_exit, ReadElf, remove, str_to_bytes
NATIVE_LIBS_DIR_ON_DEVICE = '/data/local/tmp/native_libs/'
@@ -121,7 +121,7 @@
if os.path.exists(self.build_id_list_file):
with open(self.build_id_list_file, 'rb') as fh:
for line in fh.readlines():
- line = line.strip()
+ line = bytes_to_str(line).strip()
items = line.split('=')
if len(items) == 2:
self.device_build_id_map[items[0]] = items[1]
@@ -141,7 +141,8 @@
# Push new build_id_list on device.
with open(self.build_id_list_file, 'wb') as fh:
for build_id in self.host_build_id_map:
- fh.write('%s=%s\n' % (build_id, self.host_build_id_map[build_id].name))
+ s = str_to_bytes('%s=%s\n' % (build_id, self.host_build_id_map[build_id].name))
+ fh.write(s)
self.adb.check_run(['push', self.build_id_list_file,
self.dir_on_device + self.build_id_list_file])
os.remove(self.build_id_list_file)
@@ -325,47 +326,69 @@
self.start_profiling([self.args.cmd])
+class NativeProcessProfiler(ProfilerBase):
+ """Profile processes given their pids."""
+ def start(self):
+ self.start_profiling(['-p', ','.join(self.args.pid)])
+
+
+class NativeThreadProfiler(ProfilerBase):
+ """Profile threads given their tids."""
+ def start(self):
+ self.start_profiling(['-t', ','.join(self.args.tid)])
+
+
+class SystemWideProfiler(ProfilerBase):
+ """Profile system wide."""
+ def start(self):
+ self.start_profiling(['-a'])
+
+
def main():
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
- target_group = parser.add_argument_group('Select profiling target')
- target_type_group = target_group.add_mutually_exclusive_group(required=True)
- target_type_group.add_argument('-p', '--app',
- help="""Profile an Android app, given the package name.
- Like `-p com.example.android.myapp`.""")
+ target_group = parser.add_argument_group(title='Select profiling target'
+ ).add_mutually_exclusive_group(required=True)
+ target_group.add_argument('-p', '--app', help="""Profile an Android app, given the package name.
+ Like `-p com.example.android.myapp`.""")
- target_type_group.add_argument('-np', '--native_program',
- help="""Profile a native program running on the Android device.
- Like `-np surfaceflinger`.""")
+ target_group.add_argument('-np', '--native_program', help="""Profile a native program running on
+ the Android device. Like `-np surfaceflinger`.""")
- target_type_group.add_argument('-cmd',
- help="""Profile running a command on the Android device. Like
- `-cmd "pm -l"`.""")
+ target_group.add_argument('-cmd', help="""Profile running a command on the Android device.
+ Like `-cmd "pm -l"`.""")
- target_group.add_argument('--compile_java_code', action='store_true',
- help="""Used with -p. On Android N and Android O, we need to compile
- Java code into native instructions to profile Java code.
- Android O also needs wrap.sh in the apk to use the native
- instructions.""")
+ target_group.add_argument('--pid', nargs='+', help="""Profile native processes running on device
+ given their process ids.""")
- target_start_group = target_group.add_mutually_exclusive_group(required=False)
- target_start_group.add_argument('-a', '--activity',
- help="""Used with -p. Profile the launch time of an activity in
- an Android app. The app will be started or restarted to
- run the activity. Like `-a .MainActivity`.""")
+ target_group.add_argument('--tid', nargs='+', help="""Profile native threads running on device
+ given their thread ids.""")
- target_start_group.add_argument('-t', '--test',
- help="""Used with -p. Profile the launch time of an
- instrumentation test in an Android app. The app will be
- started or restarted to run the instrumentation test.
- Like `-t test_class_name`.""")
+ target_group.add_argument('--system_wide', action='store_true', help="""Profile system wide.""")
+
+ app_target_group = parser.add_argument_group(title='Extra options for profiling an app')
+ app_target_group.add_argument('--compile_java_code', action='store_true', help="""Used with -p.
+ On Android N and Android O, we need to compile Java code into
+ native instructions to profile Java code. Android O also needs
+ wrap.sh in the apk to use the native instructions.""")
+
+ app_start_group = app_target_group.add_mutually_exclusive_group()
+ app_start_group.add_argument('-a', '--activity', help="""Used with -p. Profile the launch time
+ of an activity in an Android app. The app will be started or
+ restarted to run the activity. Like `-a .MainActivity`.""")
+
+ app_start_group.add_argument('-t', '--test', help="""Used with -p. Profile the launch time of an
+ instrumentation test in an Android app. The app will be started or
+ restarted to run the instrumentation test. Like
+ `-t test_class_name`.""")
record_group = parser.add_argument_group('Select recording options')
record_group.add_argument('-r', '--record_options',
- default='-e task-clock:u -f 1000 -g --duration 10',
- help="""Set recording options for `simpleperf record` command.
- Default is "-e task-clock:u -f 1000 -g --duration 10".""")
+ default='-e task-clock:u -f 1000 -g --duration 10', help="""Set
+ recording options for `simpleperf record` command. Use
+ `run_simpleperf_on_device.py record -h` to see all accepted options.
+ Default is "-e task-clock:u -f 1000 -g --duration 10".""")
record_group.add_argument('-lib', '--native_lib_dir', type=extant_dir,
help="""When profiling an Android app containing native libraries,
@@ -407,6 +430,12 @@
profiler = NativeProgramProfiler(args)
elif args.cmd:
profiler = NativeCommandProfiler(args)
+ elif args.pid:
+ profiler = NativeProcessProfiler(args)
+ elif args.tid:
+ profiler = NativeThreadProfiler(args)
+ elif args.system_wide:
+ profiler = SystemWideProfiler(args)
profiler.profile()
if __name__ == '__main__':
diff --git a/bin/android/arm/simpleperf b/bin/android/arm/simpleperf
index a469bbf..3b11156 100755
--- a/bin/android/arm/simpleperf
+++ b/bin/android/arm/simpleperf
Binary files differ
diff --git a/bin/android/arm64/simpleperf b/bin/android/arm64/simpleperf
index 50d9cdb..b593d73 100755
--- a/bin/android/arm64/simpleperf
+++ b/bin/android/arm64/simpleperf
Binary files differ
diff --git a/bin/android/x86/simpleperf b/bin/android/x86/simpleperf
index 9c3b467..428bebb 100755
--- a/bin/android/x86/simpleperf
+++ b/bin/android/x86/simpleperf
Binary files differ
diff --git a/bin/android/x86_64/simpleperf b/bin/android/x86_64/simpleperf
index f827ee9..1ec512f 100755
--- a/bin/android/x86_64/simpleperf
+++ b/bin/android/x86_64/simpleperf
Binary files differ
diff --git a/bin/darwin/x86/libsimpleperf_report.dylib b/bin/darwin/x86/libsimpleperf_report.dylib
index 4031cc3..3277d66 100755
--- a/bin/darwin/x86/libsimpleperf_report.dylib
+++ b/bin/darwin/x86/libsimpleperf_report.dylib
Binary files differ
diff --git a/bin/darwin/x86/simpleperf b/bin/darwin/x86/simpleperf
index 94fa533..7cdd5e7 100755
--- a/bin/darwin/x86/simpleperf
+++ b/bin/darwin/x86/simpleperf
Binary files differ
diff --git a/bin/darwin/x86_64/libsimpleperf_report.dylib b/bin/darwin/x86_64/libsimpleperf_report.dylib
index fbc580c..a668fc5 100755
--- a/bin/darwin/x86_64/libsimpleperf_report.dylib
+++ b/bin/darwin/x86_64/libsimpleperf_report.dylib
Binary files differ
diff --git a/bin/darwin/x86_64/simpleperf b/bin/darwin/x86_64/simpleperf
index 0c9e2f2..b2e19b4 100755
--- a/bin/darwin/x86_64/simpleperf
+++ b/bin/darwin/x86_64/simpleperf
Binary files differ
diff --git a/bin/linux/x86/libsimpleperf_report.so b/bin/linux/x86/libsimpleperf_report.so
index 3d872bc..0fbc868 100755
--- a/bin/linux/x86/libsimpleperf_report.so
+++ b/bin/linux/x86/libsimpleperf_report.so
Binary files differ
diff --git a/bin/linux/x86/simpleperf b/bin/linux/x86/simpleperf
index f2850af..44af76b 100755
--- a/bin/linux/x86/simpleperf
+++ b/bin/linux/x86/simpleperf
Binary files differ
diff --git a/bin/linux/x86_64/libsimpleperf_report.so b/bin/linux/x86_64/libsimpleperf_report.so
index bd5f193..f0bbb35 100755
--- a/bin/linux/x86_64/libsimpleperf_report.so
+++ b/bin/linux/x86_64/libsimpleperf_report.so
Binary files differ
diff --git a/bin/linux/x86_64/simpleperf b/bin/linux/x86_64/simpleperf
index 5fe1c3c..4e38a44 100755
--- a/bin/linux/x86_64/simpleperf
+++ b/bin/linux/x86_64/simpleperf
Binary files differ
diff --git a/bin/windows/x86/libsimpleperf_report.dll b/bin/windows/x86/libsimpleperf_report.dll
index 02283b5..889b6c1 100755
--- a/bin/windows/x86/libsimpleperf_report.dll
+++ b/bin/windows/x86/libsimpleperf_report.dll
Binary files differ
diff --git a/bin/windows/x86/simpleperf.exe b/bin/windows/x86/simpleperf.exe
index 1e9e274..a91b916 100755
--- a/bin/windows/x86/simpleperf.exe
+++ b/bin/windows/x86/simpleperf.exe
Binary files differ
diff --git a/bin/windows/x86_64/libsimpleperf_report.dll b/bin/windows/x86_64/libsimpleperf_report.dll
index 83ab079..79a69f0 100755
--- a/bin/windows/x86_64/libsimpleperf_report.dll
+++ b/bin/windows/x86_64/libsimpleperf_report.dll
Binary files differ
diff --git a/bin/windows/x86_64/simpleperf.exe b/bin/windows/x86_64/simpleperf.exe
index 1e9e274..a91b916 100755
--- a/bin/windows/x86_64/simpleperf.exe
+++ b/bin/windows/x86_64/simpleperf.exe
Binary files differ
diff --git a/binary_cache_builder.py b/binary_cache_builder.py
index b5a53da..6151d16 100755
--- a/binary_cache_builder.py
+++ b/binary_cache_builder.py
@@ -26,45 +26,36 @@
import shutil
from simpleperf_report_lib import ReportLib
-from utils import AdbHelper, flatten_arg_list, log_info, log_warning, log_exit, ReadElf
+from utils import AdbHelper, extant_dir, extant_file, flatten_arg_list, log_info, log_warning
+from utils import ReadElf
+def is_jit_symfile(dso_name):
+ return dso_name.split('/')[-1].startswith('TemporaryFile')
class BinaryCacheBuilder(object):
"""Collect all binaries needed by perf.data in binary_cache."""
- def __init__(self, config):
- config_names = ['perf_data_path', 'symfs_dirs', 'ndk_path']
- for name in config_names:
- if name not in config:
- log_exit('config for "%s" is missing' % name)
-
- self.perf_data_path = config.get('perf_data_path')
- if not os.path.isfile(self.perf_data_path):
- log_exit("can't find file %s" % self.perf_data_path)
- self.symfs_dirs = config.get('symfs_dirs')
- for symfs_dir in self.symfs_dirs:
- if not os.path.isdir(symfs_dir):
- log_exit("symfs_dir '%s' is not a directory" % symfs_dir)
- self.adb = AdbHelper(enable_switch_to_root=not config['disable_adb_root'])
- self.readelf = ReadElf(config.get('ndk_path'))
+ def __init__(self, ndk_path, disable_adb_root):
+ self.adb = AdbHelper(enable_switch_to_root=not disable_adb_root)
+ self.readelf = ReadElf(ndk_path)
self.binary_cache_dir = 'binary_cache'
if not os.path.isdir(self.binary_cache_dir):
os.makedirs(self.binary_cache_dir)
self.binaries = {}
- def build_binary_cache(self):
- self._collect_used_binaries()
- self._copy_binaries_from_symfs_dirs()
+ def build_binary_cache(self, perf_data_path, symfs_dirs):
+ self._collect_used_binaries(perf_data_path)
+ self.copy_binaries_from_symfs_dirs(symfs_dirs)
self._pull_binaries_from_device()
self._pull_kernel_symbols()
- def _collect_used_binaries(self):
+ def _collect_used_binaries(self, perf_data_path):
"""read perf.data, collect all used binaries and their build id (if available)."""
# A dict mapping from binary name to build_id
binaries = {}
lib = ReportLib()
- lib.SetRecordFile(self.perf_data_path)
+ lib.SetRecordFile(perf_data_path)
lib.SetLogSeverity('error')
while True:
sample = lib.GetNextSample()
@@ -79,13 +70,15 @@
for symbol in symbols:
dso_name = symbol.dso_name
if dso_name not in binaries:
+ if is_jit_symfile(dso_name):
+ continue
binaries[dso_name] = lib.GetBuildIdForPath(dso_name)
self.binaries = binaries
- def _copy_binaries_from_symfs_dirs(self):
+ def copy_binaries_from_symfs_dirs(self, symfs_dirs):
"""collect all files in symfs_dirs."""
- if not self.symfs_dirs:
+ if not symfs_dirs:
return
# It is possible that the path of the binary in symfs_dirs doesn't match
@@ -106,7 +99,7 @@
paths.append(binary)
# Walk through all files in symfs_dirs, and copy matching files to build_cache.
- for symfs_dir in self.symfs_dirs:
+ for symfs_dir in symfs_dirs:
for root, _, files in os.walk(symfs_dir):
for filename in files:
paths = filename_dict.get(filename)
@@ -128,7 +121,7 @@
target_file = target_file[1:]
target_file = target_file.replace('/', os.sep)
target_file = os.path.join(self.binary_cache_dir, target_file)
- if not self._need_to_copy(target_file, expected_build_id):
+ if not self._need_to_copy(from_path, target_file, expected_build_id):
# The existing file in binary_cache can provide more information, so no need to copy.
return
target_dir = os.path.dirname(target_file)
@@ -138,14 +131,23 @@
shutil.copy(from_path, target_file)
- def _need_to_copy(self, target_file, expected_build_id):
+ def _need_to_copy(self, source_file, target_file, expected_build_id):
if not os.path.isfile(target_file):
return True
if self._read_build_id(target_file) != expected_build_id:
return True
- if not self._file_has_symbol_table(target_file):
- return True
- return False
+ return self._get_file_stripped_level(source_file) < self._get_file_stripped_level(
+ target_file)
+
+
+ def _get_file_stripped_level(self, file_path):
+ """Return stripped level of an ELF file. Larger value means more stripped."""
+ sections = self.readelf.get_sections(file_path)
+ if '.debug_line' in sections:
+ return 0
+ if '.symtab' in sections:
+ return 1
+ return 2
def _pull_binaries_from_device(self):
@@ -188,11 +190,6 @@
return self.readelf.get_build_id(file_path)
- def _file_has_symbol_table(self, file_path):
- """Test if an elf file has symbol table section."""
- return '.symtab' in self.readelf.get_sections(file_path)
-
-
def _pull_file_from_device(self, device_path, host_path):
if self.adb.run(['pull', device_path, host_path]):
return True
@@ -219,22 +216,19 @@
def main():
parser = argparse.ArgumentParser(description="""
Pull binaries needed by perf.data from device to binary_cache directory.""")
- parser.add_argument('-i', '--perf_data_path', default='perf.data', help="""
+ parser.add_argument('-i', '--perf_data_path', default='perf.data', type=extant_file, help="""
The path of profiling data.""")
- parser.add_argument('-lib', '--native_lib_dir', nargs='+', help="""
+ parser.add_argument('-lib', '--native_lib_dir', type=extant_dir, nargs='+', help="""
Path to find debug version of native shared libraries used in the app.""", action='append')
parser.add_argument('--disable_adb_root', action='store_true', help="""
Force adb to run in non root mode.""")
parser.add_argument('--ndk_path', nargs=1, help='Find tools in the ndk path.')
args = parser.parse_args()
- config = {}
- config['perf_data_path'] = args.perf_data_path
- config['symfs_dirs'] = flatten_arg_list(args.native_lib_dir)
- config['disable_adb_root'] = args.disable_adb_root
- config['ndk_path'] = None if not args.ndk_path else args.ndk_path[0]
- builder = BinaryCacheBuilder(config)
- builder.build_binary_cache()
+ ndk_path = None if not args.ndk_path else args.ndk_path[0]
+ builder = BinaryCacheBuilder(ndk_path, args.disable_adb_root)
+ symfs_dirs = flatten_arg_list(args.native_lib_dir)
+ builder.build_binary_cache(args.perf_data_path, symfs_dirs)
if __name__ == '__main__':
diff --git a/debug_unwind_reporter.py b/debug_unwind_reporter.py
index 72853e9..b60dea6 100755
--- a/debug_unwind_reporter.py
+++ b/debug_unwind_reporter.py
@@ -44,8 +44,7 @@
import re
import subprocess
-from utils import log_exit, log_fatal
-from utils import get_host_binary_path
+from utils import bytes_to_str, log_exit, log_fatal, get_host_binary_path
class MapEntry(object):
@@ -381,6 +380,7 @@
proc = subprocess.Popen([simpleperf_path, 'dump', args.record_file[0]],
stdout=subprocess.PIPE)
(stdoutdata, _) = proc.communicate()
+ stdoutdata = bytes_to_str(stdoutdata)
if 'debug_unwind = true' not in stdoutdata:
log_exit("Can't parse unwinding result. Because " +
"%s was not generated by the debug-unwind cmd." % args.record_file[0])
diff --git a/doc/README.md b/doc/README.md
index 791fd24..372db1a 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -21,6 +21,7 @@
- [Record both on CPU time and off CPU time](#record-both-on-cpu-time-and-off-cpu-time)
- [Profile from launch](#profile-from-launch)
- [Parse profiling data manually](#parse-profiling-data-manually)
+- [Android platform profiling](#android-platform-profiling)
- [Executable commands reference](#executable-commands-reference)
- [How simpleperf works](#how-simpleperf-works)
- [Commands](#commands)
@@ -405,6 +406,44 @@
[simpleperf_report_lib.py](#simpleperf_report_lib-py). Examples are report_sample.py,
report_html.py.
+## Android platform profiling
+
+Here are some tips for Android platform developers, who build and flash system images on rooted
+devices:
+1. After running `adb root`, simpleperf can be used to profile any process or system wide.
+2. It is recommended to use the latest simpleperf available in AOSP master, if you are not working
+on the current master branch. Scripts are in `system/extras/simpleperf/scripts`, binaries are in
+`system/extras/simpleperf/scripts/bin/android`.
+3. It is recommended to use `app_profiler.py` for recording, and `report_html.py` for reporting.
+Below is an example.
+
+```sh
+# Record surfaceflinger process for 10 seconds with dwarf based call graph. More examples are in
+# scripts reference in the doc.
+$ python app_profiler.py -np surfaceflinger -r "-g --duration 10"
+
+# Generate html report.
+$ python report_html.py
+```
+
+4. Since Android >= O has symbols for system libraries on device, we don't need to use unstripped
+binaries in `$ANDROID_PRODUCT_OUT/symbols` to report call graphs. However, they are needed to add
+source code and disassembly (with line numbers) in the report. Below is an example.
+
+```sh
+# Doing recording with app_profiler.py or simpleperf on device, and generates perf.data on host.
+$ python app_profiler.py -np surfaceflinger -r "--call-graph fp --duration 10"
+
+# Collect unstripped binaries from $ANDROID_PRODUCT_OUT/symbols to binary_cache/.
+$ python binary_cache_builder.py -lib $ANDROID_PRODUCT_OUT/symbols
+
+# Report source code and disassembly. Disassembling all binaries is slow, so it's better to add
+# --binary_filter option to only disassemble selected binaries.
+$ python report_html.py --add_source_code --source_dirs $ANDROID_BUILD_TOP --add_disassembly \
+ --binary_filter surfaceflinger.so
+```
+
+
## Executable commands reference
### How simpleperf works
@@ -586,7 +625,8 @@
# Start a child process running `ls`, and stat it.
$ simpleperf stat ls
-# Stat a debuggable Android application.
+# Stat the process of an Android application. This only works for debuggable apps on non-rooted
+# devices.
$ simpleperf stat --app com.example.simpleperf.simpleperfexamplewithnative
# Stat system wide using -a.
@@ -684,7 +724,8 @@
# Record a child process running `ls`.
$ simpleperf record ls
-# Record a debuggable Android application.
+# Record the process of an Android application. This only works for debuggable apps on non-rooted
+# devices.
$ simpleperf record --app com.example.simpleperf.simpleperfexamplewithnative
# Record system wide.
@@ -707,6 +748,16 @@
$ simpleperf record -c 100000 -t 11904,11905 --duration 10
```
+To avoid taking too much time generating samples, kernel >= 3.10 sets the max percent of cpu time
+used for generating samples (default is 25%), and decreases the max allowed sample frequency when
+hitting that limit. Simpleperf uses --cpu-percent option to adjust it, but it needs either root
+privilege or to be on Android >= Q.
+
+```sh
+# Record with sample frequency 10000, with max allowed cpu percent to be 50%.
+$ simpleperf record -f 1000 -p 11904,11905 --duration 10 --cpu-percent 50
+```
+
#### Decide how long to record
The way to decide how long to monitor in record command is similar to that in the stat command.
@@ -776,7 +827,7 @@
$ simpleperf record -p 11904 --call-graph fp --duration 10
```
-[Here](#suggestions-about-recording-call-graphs) are some suggestions about recording call graphs
+[Here](#suggestions-about-recording-call-graphs) are some suggestions about recording call graphs.
<a name="record-both-on-cpu-time-and-off-cpu-time-in-record-cmd"></a>
#### Record both on CPU time and off CPU time
@@ -896,6 +947,10 @@
# In this case, when simpleperf wants to read executable binary /A/b, it prefers file in
# /debug_dir/A/b to file in /A/b.
$ simpleperf report --symfs /debug_dir
+
+# Read symbols for system libraries built locally. Note that this is not needed since Android O,
+# which ships symbols for system libraries on device.
+$ simpleperf report --symfs $ANDROID_PRODUCT_OUT/symbols
```
#### Filter samples
@@ -969,6 +1024,9 @@
# Record a native process.
$ python app_profiler.py -np surfaceflinger
+# Record a native process given its pid.
+$ python app_profiler.py --pid 11324
+
# Record a command.
$ python app_profiler.py -cmd \
"dex2oat --dex-file=/data/local/tmp/app-profiling.apk --oat-file=/data/local/tmp/a.oat"
@@ -1086,6 +1144,13 @@
# Add disassembly.
$ python report_html.py --add_disassembly
+
+# Adding disassembly for all binaries can cost a lot of time. So we can choose to only add
+# disassembly for selected binaries.
+$ python report_html.py --add_disassembly --binary_filter libgame.so
+
+# report_html.py accepts more than one recording data file.
+$ python report_html.py -i perf1.data perf2.data
```
Below is an example of generating html profiling results for SimpleperfExampleWithNative.
diff --git a/inferno/inferno.py b/inferno/inferno.py
index 0bc0665..4566f3e 100755
--- a/inferno/inferno.py
+++ b/inferno/inferno.py
@@ -53,8 +53,10 @@
app_profiler_args += ["-p", args.app]
elif args.native_program:
app_profiler_args += ["-np", args.native_program]
+ elif args.pid != -1:
+ app_profiler_args += ['--pid', str(args.pid)]
else:
- log_exit("Please set profiling target with -p or -np option.")
+ log_exit("Please set profiling target with -p, -np or --pid option.")
if args.compile_java_code:
app_profiler_args.append("--compile_java_code")
if args.disable_adb_root:
@@ -264,6 +266,8 @@
Like -np surfaceflinger.""")
record_group.add_argument('-p', '--app', help="""Profile an Android app, given the package
name. Like -p com.example.android.myapp.""")
+ record_group.add_argument('--pid', type=int, default=-1, help="""Profile a native program
+ with given pid, the pid should exist on the device.""")
record_group.add_argument('--record_file', default='perf.data', help='Default is perf.data.')
record_group.add_argument('-sc', '--skip_collection', action='store_true', help="""Skip data
collection""")
@@ -301,16 +305,21 @@
process = Process("", 0)
if not args.skip_collection:
- process.name = args.app or args.native_program
+ if args.pid != -1:
+ process.pid = args.pid
+ args.native_program = ''
+
+ process.name = args.app or args.native_program or ('Process %d' % args.pid)
log_info("Starting data collection stage for process '%s'." % process.name)
if not collect_data(args):
log_exit("Unable to collect data.")
- result, output = AdbHelper().run_and_return_output(['shell', 'pidof', process.name])
- if result:
- try:
- process.pid = int(output)
- except ValueError:
- process.pid = 0
+ if process.pid == 0:
+ result, output = AdbHelper().run_and_return_output(['shell', 'pidof', process.name])
+ if result:
+ try:
+ process.pid = int(output)
+ except ValueError:
+ process.pid = 0
collect_machine_info(process)
else:
args.capture_duration = 0
diff --git a/pprof_proto_generator.py b/pprof_proto_generator.py
index b236c55..d0b4da9 100755
--- a/pprof_proto_generator.py
+++ b/pprof_proto_generator.py
@@ -30,8 +30,8 @@
import os.path
from simpleperf_report_lib import ReportLib
-from utils import log_info, log_exit
-from utils import Addr2Nearestline, extant_dir, find_tool_path, flatten_arg_list
+from utils import Addr2Nearestline, bytes_to_str, extant_dir, find_tool_path, flatten_arg_list
+from utils import log_info, log_exit, str_to_bytes
try:
import profile_pb2
except ImportError:
@@ -40,13 +40,13 @@
def load_pprof_profile(filename):
profile = profile_pb2.Profile()
with open(filename, "rb") as f:
- profile.ParseFromString(f.read())
+ profile.ParseFromString(bytes_to_str(f.read()))
return profile
def store_pprof_profile(filename, profile):
with open(filename, 'wb') as f:
- f.write(profile.SerializeToString())
+ f.write(str_to_bytes(profile.SerializeToString()))
class PprofProfilePrinter(object):
diff --git a/repo.prop b/repo.prop
index 85060e8..f9169ce 100644
--- a/repo.prop
+++ b/repo.prop
@@ -3,7 +3,7 @@
device/generic/armv7-a-neon 98c1add8d047381bc8d325d0069170600d2b3388
device/generic/car de8abc23d944e603082d8a672484f6ff2b631a85
device/generic/common 3a1b861e123023390628512256c01c3a0624b9a4
-device/generic/goldfish a1ad2f0ab26ff28770ad6a88125a44baadefc99a
+device/generic/goldfish 1ccf64c51b4c882f73d3469951cb43b636b2ea78
device/generic/goldfish-opengl 9a8dc33f2c7306de76f6cc0a2c968ad7aa26563b
device/generic/mini-emulator-arm64 595ad51d88bfbd3e680b290b69bbb28f6ee41f27
device/generic/mini-emulator-armv7-a-neon c65b46a1a0d89411e666244423555c860413e911
@@ -16,45 +16,46 @@
device/google/accessory/arduino abc5159a3ca9dbb5c7e364a1eab99901a4440ac5
device/google/accessory/demokit 7dfe7f89a3b174709c773fe319531006e46440d9
device/google/atv 482122268ed4df781014cbdeefd29a8c804904f3
-device/google/contexthub b3211319af620de5a7ed701e383deb3dc8d866f8
-device/google/cuttlefish f3894ad0fcdc6e1dfe99541e1ca9556dea094d9f
+device/google/contexthub 4d6104be79e2438af24b58c0da02398e77927b84
+device/google/cuttlefish 49f6f09b169e66a210fb24d582abd7639d2c967a
device/google/cuttlefish_common 1cd9c90a3f6fb9dbe04a966f4babac57dfd60a31
device/google/cuttlefish_kernel 82a2fb68ce7e3381fb7c08bfabc004e42eb0022d
-device/google/marlin 83b04ef5c9c183e5e9b289636f003abc2cf72545
+device/google/marlin c493f17f8236103080e95b9e10743fecf0113382
device/google/marlin-kernel 33c81c9bfa0946dca429750e42c0e73d48bfa07f
device/google/muskie 74a57dd25ea836b584f98665d9f0ee803ef7ee40
device/google/taimen 984459ada7e91e2c2d959de679e46b7459301867
device/google/vrservices bdc90104b414fd8caacf07eb960f1519de57f500
-device/google/wahoo 9ff3cc386f593ed50494cc9fad4c59ce20e1cec8
+device/google/wahoo 4e734128ef0edf5a8b021ba8031835f7da087e2b
device/google/wahoo-kernel 5766aca7dc9b17149317ecba5fdb8fc3209d87c1
-device/linaro/bootloader/OpenPlatformPkg 7cb8f3dc8dbbeebb3cc5cde8c47821f9a463bd99
+device/linaro/bootloader/OpenPlatformPkg d0905e0b2cd935e61c3945ac179112f702fa866b
device/linaro/bootloader/arm-trusted-firmware b23f5fb1ac2033077c7204f604b2c74649b0e9a3
-device/linaro/bootloader/edk2 08244e33149eacfbeee382aa02a17940fc5abfce
-device/linaro/hikey 72ef1bb61148c9a9fde97328c3df0dbabfc59e78
+device/linaro/bootloader/edk2 a1e5dccd6adf4509868368f57e2df956dff880df
+device/linaro/hikey 724d2fb9d8aaeab5dc317b134880bd4e48556dfd
device/linaro/hikey-kernel f9a8ca624e83d96ab15926f8b0cce7d48e872fd6
-device/linaro/poplar 741e61d94c0ffa06f2d971aed5b662607f72d0c9
-device/linaro/poplar-kernel 6412647c7ff0d2d412281082a574a8ebb0d8a2fa
+device/linaro/poplar d95e39b01ad44413afe8ca568d1c695b4af42adf
+device/linaro/poplar-kernel 221ac36e906a3635c96e82d55bcb2afa3251c0a1
device/sample c66570f1f652853fa51e9bb6618f2386de13e0a5
-kernel/configs bd3b160eaa472da3f657e59593f51a622912ba5e
-kernel/tests 06e96b06bcbe9b3f8dc1ca1495dcccf4622bcad4
-platform/art d55446b7c62acaecf01f4ffd03d8a0d0b0f4e448
-platform/bionic a7573441c1274bbdb3fc992d068ebf97b30a0208
-platform/bootable/recovery bbe881693a456541b6befa3bd190782fa8adc025
-platform/build e318a785495e1557f042c62a5878a496174c6520
+kernel/configs ca6771ccedcb333a4443aa7a79707b5899c9eb37
+kernel/tests a1bd780fb50a05bff15c883e82b9846db13454cf
+platform/art bdf294e34a0d1d84596f46ff58924f12dd640f4c
+platform/bionic 4b9379c889ed9958094a8e82b27eb8f5d9167e5f
+platform/bootable/recovery 9d7f918506dd8ea71829a43237fd4f3a2ca1720e
+platform/build c247436e2f02fce52359c1a2c56fde26c65f18ad
platform/build/blueprint 254f2ae7b16c654531498f37de8e7568759af816
platform/build/kati 40ad301ec0da74f820d0e06cada96e98273e33d2
-platform/build/soong 815ef453df0216bf53aa8cae6c53bfee724e64c6
+platform/build/soong 09664bd9a509bfd5e97d3480855533547a4e1d52
platform/compatibility/cdd 8b0ea10975736b8a5ee43a0c4f67f40eaf17a4a0
-platform/cts ad8bcb1829f7c42428bb4e648dcf485988bae1cb
+platform/cts 0be23ea9bf3bbd75da1ec866da97ea51b40cd3c0
platform/dalvik 5428d7f79625d38353a1ca4322839e40ba8889c0
platform/developers/build c5f816f5805d17fa736a0156b7ff104414733fc9
platform/developers/demos 03814c35b8ee0a1284c667556260124d97466b28
platform/developers/samples/android 80884fcdb2c8bcbe75585cec5f31536a4d305c32
-platform/development 9a192cd10bcb2d5caf217cecb13c03964ca314a9
-platform/external/ImageMagick f18039988dc75238fa535886ea1393d12fb676ca
+platform/development 8b46ef302a9efd309ee3bf45645ddb7ce3b43974
+platform/external/ImageMagick 8a9eabeb89d18e20e99fa2c955b6c1e5535a9f38
platform/external/Microsoft-GSL 2ef7b8a9e35e409b175e190298cde5434155f54a
platform/external/Reactive-Extensions/RxCpp 62eaa9fe03d659fe04c73195494b5c6eeaa79420
platform/external/aac 7027cd87488c2a60becbae7a139d18dbc0370459
+platform/external/adeb 692d7ecef5d5b5f77f77dbd78cda52d86b0df15f
platform/external/adhd 0702ba2786f5bedc375b9b7c8120d212c02c08f6
platform/external/adt-infra 2f907142600275ccd4eab0fa3015a3b0a174472b
platform/external/android-clat ec4c31a080cd42e705222c34e8acb4f8478f0540
@@ -63,18 +64,18 @@
platform/external/ant-glob 85522dde56ebac6e2c2b5453a506f3736d899126
platform/external/antlr f27dca5549129b36ac3de86c253a769844c9dcc0
platform/external/apache-commons-bcel 347ef0a0556a6ddf13b23a6c32d6378b1d77b5f6
-platform/external/apache-commons-math 0cb1dc642ca1fd29f9ff17f1c3a50c8ca43f54e1
+platform/external/apache-commons-math d27d727919c39b340093300fd3e9ea3cb47d1be1
platform/external/apache-harmony 5992da371ec867b6bb42255f69ed9459fb3b4b78
platform/external/apache-http 2a993b991bd6d98e006221956df7ea80ff223403
platform/external/apache-xml d129e1daf125e6ef2ea832ce39302879a375bbd7
-platform/external/archive-patcher 6e8fe1c5a159cd916729f67af01e4011c4461165
+platform/external/archive-patcher 295af277ed13340fc4b716ef3c906fa3066163c8
platform/external/arm-neon-tests 30a7e8e204eccf7e694f362365b891c68d99bef6
platform/external/arm-optimized-routines ff50653e35b50e118fdd9e9f6532d418a6e8dc1c
-platform/external/autotest d778101b93899763288e57828f85b66a249a11ca
+platform/external/autotest 2720068aaababda5d97b450b5e9a7003f61663b5
platform/external/avb 076a0ebdd59526b80eeb328abb37c39434dc731a
platform/external/bart 08808a75e6fd92995ad2be2730e9334ba8ce1c8a
platform/external/blktrace d345431f16b8f76f30a58193ff2b26d5853e1109
-platform/external/boringssl 6120b2b9dfbe5b19fe2d0f69a4b8418ad5f7fe08
+platform/external/boringssl bfcf3a72c0bcb62cfde80e932db0668a7f96c0f8
platform/external/bouncycastle 8ac7044ca44505764fdc9fa4e96fe79c11a2736a
platform/external/brotli a3b33dad0761d13f273719113a2824ad9d100106
platform/external/bsdiff c35a3dd7996924b9925880f988993faec3449e26
@@ -93,10 +94,10 @@
platform/external/compiler-rt dc737ff85f32510749ba507e289f59dec39b4a63
platform/external/conscrypt 952ea709347bf1988595da1d002c57651ed0a7ff
platform/external/crcalc c42b173b60027d1517cec618f3776fb55e941dd1
-platform/external/cros/system_api cf0441ed42ef7a325e026b927349f4a4082b12c7
+platform/external/cros/system_api 6a149e480cc9342bdda6869580cd0a4bb48b4bd3
platform/external/curl f7bbc49291518d581cfc7d771c300c157b944c38
platform/external/dagger2 b1654fa03e7f43425c74644ca73d860198344d30
-platform/external/deqp 7a78102df1f85c64b67bdfa008f7236c536cde67
+platform/external/deqp e9540af222207aa0d6c810f1f25f213db5bd68a2
platform/external/desugar 2b50d295f5acc8ddf8924cd6536dfbfe45965ade
platform/external/devlib ea6533a4d41a55bb9bdb19d793cf37be457bcff3
platform/external/dexmaker 67df318139d2d965ec83f82c72a019f10cb248db
@@ -110,17 +111,17 @@
platform/external/droiddriver ef618d981947f6d8242755516269a0026c07126c
platform/external/drrickorang e386c6f6986459824a5cec33fd689eb7a326ae0b
platform/external/dtc 6c6634a26785d16b058ee3799f69cd3606a557ca
-platform/external/e2fsprogs 6c0086cf4680ec68c6913fcdc0bb2b1f1901f885
-platform/external/easymock 045fe1a003805f21f4bd266ab202319486a90284
+platform/external/e2fsprogs 61165df1f89b4b713fbbfe8136201a2a43542da1
+platform/external/easymock f166eb43fb37ee3218d7aa65cfa09f934205c143
platform/external/eigen 1b13c5e03d9005018784383e65e74089cbef47ce
platform/external/elfutils c5f2c7e1c19acb791f3b58344929c6b5b3f9b9e1
platform/external/emma 181b44b0422f2ca9a844a39f0b7e7f20c2712b72
platform/external/epid-sdk cd507720ccd0a29faaca3c34a3f9b529938e5d6a
platform/external/error_prone f6d44b6a684316132121f4e10c6c1f532ba957b1
platform/external/esd 943c42b6f8e9afe821744aa4c039f4943ebf29f5
-platform/external/expat 8fd2db7fafa14a7be63ef6e532fb6d39011bf7cb
+platform/external/expat 36765deebf44466b51134d57633f06486bf1e7c9
platform/external/eyes-free 16bd4c7a4d1bfe229068b637614dad7c48dd2ceb
-platform/external/f2fs-tools 0598f3e0a71a8c1f9206bd2df8fca175c0e62c5b
+platform/external/f2fs-tools 423299c05a31ba0c128d1c63a30a14f651e07e21
platform/external/fdlibm 59f7335e4dd8275a7dc2f8aeb4fd00758fde37ac
platform/external/fec 696ab3cde225bbd6a24d7aa74a709eac696979f8
platform/external/flac 2a2f59be31eda0c290bf1c6e17dda9a1fc1b25fb
@@ -142,15 +143,15 @@
platform/external/google-fruit 5289ec110eaca1768c167e1b5fbe1a4602c3b49e
platform/external/google-styleguide 749f7ae008c0d2dd9767fdfe202e6873e864a956
platform/external/google-tv-pairing-protocol c731915e80d9e2ccb755b97e7fdd280bbea07f70
-platform/external/googletest 435c4e8363c5e05414c45d5dc54ef4967bf4d42d
+platform/external/googletest 3971b1e06ed0ded9c2511ad2784c498371b32d03
platform/external/gptfdisk daf1892901231cc466f349296dc32d6fce15a196
platform/external/guava 2e52c68711b104ac2e225a9d298bd2de1eed92bb
-platform/external/guice 628ced18e817a96c11857a51536468a886c6e183
+platform/external/guice 9b878813d48dee9b08a1cdc8c8b607a602752659
platform/external/hamcrest 6668c743790380cb3e7889c2abb6cd53b720a211
platform/external/harfbuzz_ng c0857b79c65bfd8942b734b1780b0b5ef3a0d515
platform/external/honggfuzz f49b65256c6e5ae8b5efb500012d2776ca078d5f
platform/external/hyphenation-patterns eb9aaf3e3e460d317c5f4842fb15f60487cb7060
-platform/external/icu 1a2d918ad7532ad8692f3bfca3e00a767a3f2c12
+platform/external/icu 40ab78910d1c947df3f78fe916a3162acd7645b7
platform/external/ims d739e134e9d456ab202e315b3bc04afce6db0bf2
platform/external/iproute2 20c0f1de5d57ebc3acddd35934f6f184a4fe1639
platform/external/ipsec-tools bf16586a33b1432a11526754523fceb62944dc1c
@@ -160,16 +161,17 @@
platform/external/jacoco c09ea2ab692393c0891eaefcca288ac3d19679b3
platform/external/jarjar 35912cf94b8213bbd6c06017684de671587b1b8a
platform/external/javaparser 1afe9e0652b9b53edade5aa276162abe27b32a67
-platform/external/javasqlite 8ece4e2b6edb941592f72cc811d04425aad5c170
+platform/external/javasqlite 9625acf19ec157c6e6044026c43f90cd141475d6
platform/external/javassist f7c4b954072e563b75f6910c25bb689bbf38a3d1
platform/external/jcommander 288dbc7374714f68a01d97e2491f1ea6840e26df
platform/external/jdiff 245e274aee96e0c47bf84083d3e4d9b29f8ad591
-platform/external/jemalloc 3a6a856bba83bf55e30598596f46822a46a20805
+platform/external/jemalloc 9f251509c0ab9999f11a2439961f8ef1f034075b
+platform/external/jemalloc_new 4c5028eda455ccc3462b5cdf086780a81a2a7b39
platform/external/jline 486ecfedc8a054176ffc95db49d59b01115da202
platform/external/jmdns 0c71647deb7f7835c473fd3dfb45943083e47794
platform/external/jsilver cbfad5619138abefd2a304dd537cc4ed4ad2b7a1
platform/external/jsmn 0945105514d9e025c67a9cbc64b3e96e40ed999c
-platform/external/jsoncpp c8fe10e5763f87f39f2e524aaeeac53bcccf6eff
+platform/external/jsoncpp 93ba642c636309a3195d6da6c11ba82f69ef45ed
platform/external/jsr305 afbad758fae6b74b4a739935341c224575c58169
platform/external/jsr330 8ef1f9dde8e3bbfbdac76d39265bbb0588c3330b
platform/external/junit c67195927f579fb8a7fda44815b189e4c0ecf58f
@@ -180,7 +182,7 @@
platform/external/ksoap2 efef04a819dc9ca99b9c72ee9739d5006339f1ae
platform/external/libavc 68ec7380a58b976e7c512ba56c47af5b371e34a4
platform/external/libbackup 48482a17ecc34a0a36dce78a73db9dd934d70a7a
-platform/external/libbrillo b5f20f52ab0885f1676b1c2024df541b3e6cc5f5
+platform/external/libbrillo 0fa01c38cc2beff8d7e11e4b512692ecdb640ca8
platform/external/libcap 772976b9e70d9701afe1a1484bb9809c747d544a
platform/external/libcap-ng b48d5ddc7b24b693f92d1d10275151544a22578e
platform/external/libchrome 1c89c68e61486efbf0007ad2f83861a112e12538
@@ -209,8 +211,9 @@
platform/external/libogg 140e2eec9db797d2a22e6e9cc3d75d0401e2a31d
platform/external/libopus cf168b63a5c4766bcb663d9ddb16dadbc080e103
platform/external/libpcap 7b5dfa333cd42dd542b92a8beeb65e53a20565a4
-platform/external/libphonenumber 767c6049ea69731015ca42bf083fa8a40f1ad4eb
+platform/external/libphonenumber b9d468f63733272ae7034018ebf8db215d65c23a
platform/external/libpng 62f5255389a91db9332ca2a1946ce8ab2a594d44
+platform/external/libprotobuf-mutator f9fc8f8397207673882b538a960b2575ac1bcb60
platform/external/libtextclassifier efbea3cb0f4119e28a1e9e4ba2f42da6b603d156
platform/external/libunwind 9ed960a358e4606d761779d772dad39cb08513dd
platform/external/libunwind_llvm 5a384dca2703a5cfb9198e0554f588897ce9baf8
@@ -223,34 +226,34 @@
platform/external/libxcam ad8c3650d3db1b9c16d91793a844d1b52dd4d9bf
platform/external/libxkbcommon ea43733e9ca1daa42290adbadd95c89c0d5d0ddc
platform/external/libxml2 9d7516bc7c554dcfa78b875d4fe7e33ca9e36c43
-platform/external/libyuv 237d98acc923bd02ed6d04b359e43d9d5971cbf4
+platform/external/libyuv 94a6f539e121313c3da9704e9ea5c02a65bda3f5
platform/external/linux-kselftest df3fb219bca4145d61b86c5dd946d9413b88be24
platform/external/lisa ee99136b2c1f07b877f682e7ae321760a43da81d
platform/external/llvm b1bb3bdb371c5d388000776e4c0657b2a0d5688e
platform/external/lmfit bcde41fab768e29467ae0496755576c39bbd81db
-platform/external/ltp 99bf3cdddf55aaf9ec69550039d311e5ab03b936
+platform/external/ltp 23258e878c3a8a5378cc06e29a69c141cef2d6f3
platform/external/lz4 db96f7cadd60d24ad028d50d82d7fd9ef1aa12ac
-platform/external/lzma 7851dce6f4ca17f5caa1c93a4e0a45686b1d56c3
+platform/external/lzma 07e502f09fce6b9dba528adbb73d9f4c3200f8f6
platform/external/markdown 06a8f8b914d477183f68b84424bce8ff4dae7e84
platform/external/mdnsresponder 33e620a736939be478f009640acf1e1e9d709450
platform/external/mesa3d 8ead3127aa0d1259aad39131d450f50f8a2af7e5
platform/external/minigbm ff234ae4223e32e93a2c3012524e1129d1e185b2
-platform/external/minijail 89cbc32f005628664e7e5dcffd23efc974fa0a52
+platform/external/minijail 3d98f3cdfd5ebca120c3088dca7344f6aba1f23f
platform/external/mksh 1b542a22f68163ee8acf14c227d70369e2117d42
platform/external/mmc-utils ecb66312dd2b0d82d462c14af4acef00d93f2375
-platform/external/mockftpserver 799e0e134b61f160f69fbf84d5cbf24861e5e78e
+platform/external/mockftpserver c1f1a186566b1140f17d1367916a39eee7543213
platform/external/mockito 9a6865609c1905059b4af3ea32a07e0cb30d4249
-platform/external/mockwebserver e441903a5f40ab00a49d76f5e9570a04ea80f74e
+platform/external/mockwebserver 2631e2ca26c0b9a2773eb41fce40cf42b1630250
platform/external/modp_b64 6f11b5c9b4ffb38dc9375f3cf344da4300a2741a
platform/external/mp4parser 88bd0c6cfa7fcfbbebcc15c2c565f714cb36b065
platform/external/mtpd 123ea675fae1d24ce3f498609644efa6ab832701
platform/external/nanohttpd c6783c32331b3fe78ffd5077e7f180995d0e268e
-platform/external/nanopb-c 731c7139ab46dd0c22bcbda506069e5454e9b2c2
+platform/external/nanopb-c 45c9ba76933a137d216e4084e3b6bf81578b84e3
platform/external/naver-fonts 91e6e9f94d1d769a8f742649674149ba98ce7d45
platform/external/neven a199086bfafc4503b9a3f27557ca1c554d364366
platform/external/newfs_msdos 92fe5db069b92f149c545fbb4114cc5b26bc97b2
platform/external/nfacct e1fa89c56893352381e6c59b38a3412b087c3f91
-platform/external/nist-pkits da9a84e43e1710b4512825ef31bffd9d6b61df59
+platform/external/nist-pkits 52f06974b0c89d11fc595d9e460d52e8dd90990a
platform/external/nist-sip f8d1d27b97b57d6a4ea8f242230b5ee2f3522612
platform/external/nos/host/android f8bd43622cf1c606085f947314ff81bd0921415e
platform/external/nos/host/generic d51299af937b10341dcee254fe19eedee3caad85
@@ -259,7 +262,7 @@
platform/external/oauth 49f3624a6d3307b640a012f15b94d04174473501
platform/external/objenesis c974ec43f602336915be95cd6e60bf759e672eff
platform/external/oj-libjdwp cffbb6caea6fb2413b92566d436b48c24b6a8fa9
-platform/external/okhttp bcc13b52d1653d1a59ec4dd8ba14c5706f879690
+platform/external/okhttp 477bf6547bdca5e6de401cd9385595f3e04a888b
platform/external/one-true-awk e3d2bd506a8bba84603878dfc57396f7d1a27d12
platform/external/opencv 68d29651a7b1b7b81822d035d222202adcf5de5d
platform/external/owasp/sanitizer bbfb25464ff30c5a62dce351d719a8c533afb2a3
@@ -267,7 +270,7 @@
platform/external/pcre 04fc5e3e1a393db61bd49e016ba30226dd0adc71
platform/external/pdfium 68e2ff2e007046ca141a52797bbc7600f2733f92
platform/external/perf_data_converter deddae1a418844bc53514000c40ef39239c5f022
-platform/external/perfetto aaf21fe17828996827fc3d47a9570cd3c14a746e
+platform/external/perfetto 886a7eefe47f82d37e96f8382946a8691496f10d
platform/external/piex 49b79bc8ec66538027e018ed655b27af5b77a39e
platform/external/ply 8b4275169c7b4efb46d034d409edac37b9b6df89
platform/external/ppp 5f356644965d9a36b283db1611df129474a09330
@@ -284,6 +287,7 @@
platform/external/python/dill 01988c5fa063836e457bdb7134d4d300d1276e5e
platform/external/python/enum 6706fcd5d4054a9dcbd517142f2be8c9498fcecc
platform/external/python/enum34 ed56821ca06c8ba80bc083069c9f5672cf834e2a
+platform/external/python/funcsigs 0482655391759fecfd8cc1df02d71607e860d987
platform/external/python/future fa8e703fd259f8056cb817219041eb0e20c00ada
platform/external/python/futures a48c6eb42244dc9070bce6670566f4823ff6c11d
platform/external/python/gapic-google-cloud-pubsub-v1 44cde1e4892ce518b1927ab3f8f45a22f0f67a1d
@@ -327,30 +331,31 @@
platform/external/scapy d6b412cfde0442650d6a05884e822a396702edfd
platform/external/scrypt c37a330865ad150a993d2c610867312bb2a91e35
platform/external/seccomp-tests 910e9a11450f6b50463fc7a5fa4a77823d40a326
-platform/external/selinux 1c57b9d0b3291b0735d7626afa0c276028762ef7
+platform/external/selinux 89fd318c819ae49a15eb5254940a5a11a6a23eda
platform/external/sfntly 0bad802dc17fc283171923479960d6dab6342d3c
platform/external/shaderc/spirv-headers 492abb45bbdfc0c5b9ffd00f16e53ab628305da9
platform/external/shflags c4876e01829b8cf110ee33267bb1bad1f8ebb51d
platform/external/skia 2b2d7414c1b3e7bc41c3ecdad42fe01ea3d646a6
-platform/external/skqp 1ea5b61580865acd998a455a147e6439a2c2527e
-platform/external/sl4a f8d0a267f3ba0c9fd727709ea91ac4db856dab06
-platform/external/slf4j 22558c51ff8a9a9d8314a13febb665083bb5986a
+platform/external/skqp aca95afa3dd698c477c985058feedd8257e0f230
+platform/external/sl4a 5460767d9d418026fc26fb8c2c793a31c23af476
+platform/external/slf4j 411ebef7f603e7fb7d60e3f6cf243ec050e12e31
platform/external/smali 68270cc4df9d462b53e4dd2e9395f698b792b2c8
platform/external/snakeyaml bccc0c9bc191e16560be107c78aa2d685e9077a4
platform/external/sonic 0acda6c822aba430d93044bbf2ebb9680b8969c2
platform/external/sonivox b1eb47c2d9c7abfdd0f83680688d4d4acab8aef9
platform/external/speex 15bd660278835adb078df9860cedb3a8b2e74043
platform/external/spirv-llvm 63555c7bb790516c89f54d661dc8ea400dd8d2d7
-platform/external/sqlite 9d5eaefa71900898c70315238c7b7b58b47cfee1
+platform/external/sqlite 4b896283aa1715cfa17c119d6f14db4041daaf16
platform/external/squashfs-tools be62439693a63ea115c34dab1eb1ef63c55aaf1e
platform/external/strace 85c0c9e38fb68e015d3747de58d1b7f981090e44
platform/external/stressapptest 13eed3cb064308d4b534d921a30cad29e7479575
platform/external/subsampling-scale-image-view 45ca08280baebd7342764bdbc9b520d7183d6ad7
platform/external/swiftshader 8924ab7b8feba6e8aa1b4b972f5a77abce7d43b9
platform/external/syslinux f867c52e6ee1fb0dde495f79352928e1cd1314e6
+platform/external/syzkaller 8eb870d1741bb2bd651b05c516b3c892d55fff37
platform/external/tagsoup 4145e0953a8de225031c100f72e2d463fe1a9f4e
platform/external/tcpdump 163c36132e05362efd0b6da8e3bbd6fb70d33c81
-platform/external/tensorflow 33669739e0e7c5bf066c9ddba4528caf7753a853
+platform/external/tensorflow f5815eb13db3aa77e205034207f8f6e8da28e724
platform/external/testng 9ec8eb049efd3113c495607e92a10374e380f3aa
platform/external/tinyalsa 4bd87c6f19a20f8ce4be65575bfdd41a6495ae92
platform/external/tinycompress 67eecda8d99419fab4482154a5e6b572f33dc80b
@@ -368,7 +373,7 @@
platform/external/v8 1387abbbac0739bf85336f4fa58d6b541e7667aa
platform/external/vboot_reference a2516840c8b010ae5176680877dede3d34e135df
platform/external/vixl 49166133cb911098ecaea6ab04ad48c8b3af5720
-platform/external/vogar 2a875cf2294f81cb0880a5fe5f7864a952fab39f
+platform/external/vogar 50283fa3a020d2e6853233cc4bab6c04502986e8
platform/external/volley c409124cab8fa87dab8a3e42ce34844f5a4fa7ea
platform/external/vulkan-headers 85aa4405c0ef761687f9c31519bd2030921ca64d
platform/external/vulkan-validation-layers f7966e51b4fa214b876d2e635522107c54e1db60
@@ -385,43 +390,43 @@
platform/external/xmp_toolkit 42ea4dc6d1fc2206a7778029070ed9213e3b0fbf
platform/external/xz-embedded 2ac7dc3167c394c90479b1cd48562b58570c651d
platform/external/yapf 5a3466bc50051e3676ef9859fd97b0f85803e1ee
-platform/external/zlib 49d47ec37f95800213206f4514152db185494937
+platform/external/zlib 92da7cfab7f0bedad897baf57ce4d8b48b3926af
platform/external/zopfli 4101d743cef9e1161bfc9ed4d3c8d4910c6346f7
platform/external/zxing a102b9de15a31ed74e14a04228ef006e529e54a4
-platform/frameworks/av 8be94e995403a65724c5a75e3084bc41eb69fb22
-platform/frameworks/base d3395b08c266cb262bc3fd8ae953b983103ffba0
+platform/frameworks/av 4eeaffe5ee9e806fa56dce69657ea30c11e0fbad
+platform/frameworks/base 7a8e363c0bbe7d2ad2eea99af8187da8c31ed538
platform/frameworks/compile/libbcc c14da8b46cc800e444452e7c09365ad4d312aed4
platform/frameworks/compile/mclinker 309a19c703fc09b024969fcc0f43d78e21ea6d07
platform/frameworks/compile/slang d56b86990ede5b6271be99cf7503238fe6da9fbe
platform/frameworks/data-binding 60f806584f0796fdfe51f263bc80b429146740b1
-platform/frameworks/ex 59d3d750612c3ae9d09bc17ca25937fee384b158
+platform/frameworks/ex c31392c62ae0a8eada11f340ac93752a9ca5d25d
platform/frameworks/hardware/interfaces 64534b3d0a7f2ba5483500e937b4ea6cdc6a80e0
platform/frameworks/layoutlib 8a2ad3481aa4f7b4febc15a6943db6ccc422dc16
platform/frameworks/minikin 48e58152ea18217881e778f9aeada97b0b630feb
-platform/frameworks/ml 242b6166bed1dbe608fe2b4519f643f20d4ebd29
+platform/frameworks/ml 615d927d1ac7b6626db92ffabab6ae0622e29e98
platform/frameworks/multidex eb24b3049f75b76e115d4d5a7ba474e3681a09c8
-platform/frameworks/native 5239def81b6de3acc00da690d8ace2965df2cf18
-platform/frameworks/opt/bitmap 05835ac05b95f614d43c9289dc070e13b7fbe4ca
-platform/frameworks/opt/calendar c0246198be80c6a8185aba01707e3c6ecba21222
+platform/frameworks/native 90736768ba7e88d87276627ab1bcb8b2f6814f0f
+platform/frameworks/opt/bitmap f35e4af6c8c676b6d222c5bcf20b355b0123e42d
+platform/frameworks/opt/calendar 8cc927f20f233ff9a7bd67bf3abfb55eafc9d1ff
platform/frameworks/opt/car/services 859e87913000140d53ee1483b4a54b71580e4aff
platform/frameworks/opt/car/setupwizard 3c5bed268b0e6cf1848e56c028dd9bad1f83568b
-platform/frameworks/opt/chips a7ce8922699cc2905bc7753fdd50b7bcfe13e4c5
-platform/frameworks/opt/colorpicker 6b878bf6b8cfb5df6ca546b817571f3cf06d0674
-platform/frameworks/opt/datetimepicker b3f02da5bd64ea513138cabdbd35da9c6b38c56a
-platform/frameworks/opt/inputmethodcommon 990fcb1a6dbb5d1204cc8ec86e4bc3f691f4aeeb
-platform/frameworks/opt/net/ethernet 4ad616848a11cda31496995c7bf695ed64177fba
-platform/frameworks/opt/net/ims e7a4144a5fdfb979102cc62284edc936368f62b1
+platform/frameworks/opt/chips 040cda7c33fc6a240176caa09d49557e17dae01b
+platform/frameworks/opt/colorpicker 9cc362c55d7f118063042721a2df505f9be91dce
+platform/frameworks/opt/datetimepicker 9668ecd8bd942aad8d502198f8029c15182d7a38
+platform/frameworks/opt/inputmethodcommon eb0512fd1529c66c041c4e3223491d5cd20863f2
+platform/frameworks/opt/net/ethernet ac93ad333fc97131e6ac1e0daf0b55d102ad3ace
+platform/frameworks/opt/net/ims 2bf7a91716cd6970bbba6c61a52a5f489806d5d7
platform/frameworks/opt/net/lowpan 29497db8b7b1b31d52d3692b4ad0a725db79f553
platform/frameworks/opt/net/voip 9ca5c69262083971903029063647378847c98877
-platform/frameworks/opt/net/wifi f4bde27b348872d89563e9abf801012d4bc1fd98
-platform/frameworks/opt/photoviewer cf72fe6b38bbb388ba9f89693a3f60006b86eb18
-platform/frameworks/opt/setupwizard da231a3b6aee638dbcc28f1be43c0e8300872126
-platform/frameworks/opt/telephony c5b8de5cdd7d65da8d54d51ccc6301f3d8839a02
-platform/frameworks/opt/timezonepicker 9f101b2eb17ca98db0400aa36c24ee2b583db812
-platform/frameworks/opt/vcard 07deabc4f8244ad2000059dd02a8107c14d237d4
+platform/frameworks/opt/net/wifi 9666cb415d7d44a86cfb0b7ec1df6e6317fe3259
+platform/frameworks/opt/photoviewer 30dc726a7d4aa45ee2e50700126e61b37b3a3bc1
+platform/frameworks/opt/setupwizard 7e019cd4afe7650f3b8e73cfa64c7da810fe9e18
+platform/frameworks/opt/telephony 655e192cbd5691e985da84fd26b26a2e50641876
+platform/frameworks/opt/timezonepicker 0202810bac25bea831de1f970014f126226f91c3
+platform/frameworks/opt/vcard a1f296b37d66bebc57adfa3bea35c7a4046993d0
platform/frameworks/rs a25cf40374816eb91ef982962374838ead7774b8
platform/frameworks/support dcf2defd4b9cf29b4745526d34bd85adeb92baa1
-platform/frameworks/wilhelm edfebcf8805277c443fc7162a63cb46848e45ace
+platform/frameworks/wilhelm db8296e205b42259c4879fce9406b175629a2912
platform/hardware/akm b8b06ce000306a7ecb418840d32e90b27dd76a71
platform/hardware/broadcom/libbt a4319c3d6fc4dd53c80e89c6b9f51136e9ed7cc5
platform/hardware/broadcom/wlan cd2d94a645902444d570acbe13105d5efed3d9c5
@@ -429,9 +434,9 @@
platform/hardware/google/av 4e33b327301f347e7ccb520fa9b9c989f5651e5c
platform/hardware/google/easel 2d88c771f96399fbb9154a3a5bc86aed97d79ca2
platform/hardware/google/interfaces 9c52d5f3ef7089ae40445d1d49a20b47c9c4d7ba
-platform/hardware/interfaces 966356e08952e526ebb5a3542896b72ac9fe149e
+platform/hardware/interfaces 6b4eb0e4bd9e83dab1f9dcbc2dc4d0eaf170db95
platform/hardware/invensense a8e01ac3a98bd2d5cfa2eaa60c50afd07decf3b4
-platform/hardware/libhardware dc62b58d3dfb4da034e3e2acfb9a26f02f57e696
+platform/hardware/libhardware c8096012179a66163720ba7373e7bdbf42862a58
platform/hardware/libhardware_legacy af03352f5503e6ace1b376f988a53857e021f2bf
platform/hardware/marvell/bt 3f33d194e8300816b94d1d7b68b1d48c8f903251
platform/hardware/nxp/nfc 3a539f7cf9ad434c1d218b75c4d0b98f13a2eab6
@@ -457,12 +462,12 @@
platform/hardware/qcom/power c6b93442fa3e69b7991049835aa5051e7336d5b3
platform/hardware/qcom/wlan b6f04dece726e30c877b0ac6a7b2368ce398817c
platform/hardware/ril c136355b057e2e4b97381c340790e02aef02d982
-platform/hardware/st/nfc 222568da39d40ce391ee8903bd0f7938ba6f6480
-platform/libcore e17f083623f0814b0f5c6689c7023a5e7d50612d
-platform/libnativehelper 5b3fc078949565f9fb665010716d5b7854347dda
-platform/manifest 6485083d5ba166c898087f6d99c135f3ed92725f
+platform/hardware/st/nfc 838910ba35ab5af945419d3db9927b16fa0d49ed
+platform/libcore d70c7f9560e71081cb0446d6409cbdb3cbc92c12
+platform/libnativehelper 25bc7b1679083b08b7aabe43df5b45776ac7d5d8
+platform/manifest d0743697ebb41aaf506dca62ce1208f5a473f247
platform/packages/apps/BasicSmsReceiver eae56c2b8785016c3b2025456c4efcb082f770e4
-platform/packages/apps/Bluetooth c5d5c6e10d2968bdf50e6e7a0de41ff1193fcf0f
+platform/packages/apps/Bluetooth 04a8541e37ac6508268241519e8ff1dbd435564f
platform/packages/apps/Browser2 50f8f0229e48ad3d7f479b096c19510164be744e
platform/packages/apps/Calendar 7b051c6e9ef7922f08d9ebf664ac3087d5fa0552
platform/packages/apps/Camera2 ea4078b9f813672956f4b02b5b2a20a29716af44
@@ -481,29 +486,29 @@
platform/packages/apps/Car/Stream bf1d465bf0a6f9e439d2cb7cd12850daef80e528
platform/packages/apps/Car/SystemUpdater 52f5ff0f14ec1a81f1befa4ed61bd3cf60dbad65
platform/packages/apps/Car/libs 22473ba08a447732be9c18665073cf28ebedd68e
-platform/packages/apps/CarrierConfig 51f92db90f6150fb274218738f727b83dc9900a5
-platform/packages/apps/CellBroadcastReceiver 5506cf46c5adfb712ad2dc6202ae16dbcacf9180
+platform/packages/apps/CarrierConfig 3b085002808f7d7895358565968c8c7ca1f1fde8
+platform/packages/apps/CellBroadcastReceiver b041e2398628d2a9f5cdd909c7e7b0fa4a7a3eb1
platform/packages/apps/CertInstaller 2f69daeb673593a406fed2c5dcd4ad848417dbfd
platform/packages/apps/Contacts 9ccbe5e19e3254cfac8849521064f7b02a28de84
platform/packages/apps/DeskClock bf900b0017e27c7a8843e78ad56333a1dbd49207
platform/packages/apps/DevCamera 90fdbf7460fbd255194455331c6a38a7b8f41dd2
platform/packages/apps/Dialer 0ba853625e679551515f207cf0c479ddfa54a20b
-platform/packages/apps/DocumentsUI b7ebcec0f793f26eaffe9dc04d39d1932919e8d5
+platform/packages/apps/DocumentsUI c7f7267e99a97af3c2c12f83e4b0dac26a442564
platform/packages/apps/Email 579f7d5cd175cfe5426cdf8a508ee3a1a70bdab4
-platform/packages/apps/EmergencyInfo 1f4d5189c8a4020c95bbf641c1cb27195437756c
+platform/packages/apps/EmergencyInfo ff3f7011071b3e77cf3c64949e349c200147711c
platform/packages/apps/ExactCalculator b67e7dcae432b0e5070ca812477a2f0663f03b78
platform/packages/apps/Gallery a564a8bcd4bc536c489ed90b3ae495a307115344
platform/packages/apps/Gallery2 3aeae621121b65db2119ac976ff0bfe96655dd66
-platform/packages/apps/HTMLViewer b59af56842e157cff48480a2db0d95aa2e072be8
+platform/packages/apps/HTMLViewer 89dd2f02cdad912dc0e3182134d3bf5121350e2c
platform/packages/apps/KeyChain c0045c8c7ffb8c6df70f0e20865d33bc8f4e8e3d
platform/packages/apps/Launcher2 2530b4f69f079fa27ae19d2db72c3f97d8daa391
-platform/packages/apps/Launcher3 c73828fd96acc71fb7decbfbd392dada4a7cfeb1
+platform/packages/apps/Launcher3 1194b218d6f0942215df5fec711d62e39aeaea69
platform/packages/apps/LegacyCamera a847ffb7c06b062586d5a0633dead59c24b14d5d
platform/packages/apps/ManagedProvisioning 4e748fbaaeec7b9f13f0cfd70eb43855d6b0d59c
platform/packages/apps/Messaging 35e712c85b43123155c110da78383f08f3c8521a
platform/packages/apps/Music ec6cafbd8496c17b60176d5b1adf4c5463a121c6
platform/packages/apps/MusicFX fdf6cca64eed426794ded72e3031c669d6042f7e
-platform/packages/apps/Nfc afdb1245db87a0f91d3470f1a6bbd265273600cd
+platform/packages/apps/Nfc 4ea1bcae412ddb6755ae37dc541e2693492bc7a6
platform/packages/apps/OneTimeInitializer 0cd160be02bd381e8d84800128c7092a946be95b
platform/packages/apps/PackageInstaller ed73c7a484ced5c9d238a673510cba109538983e
platform/packages/apps/PhoneCommon 07f40602dd2c303522171e46d566d22eb73c1369
@@ -512,7 +517,7 @@
platform/packages/apps/QuickSearchBox 40adfa9388338ffbfabd5e295387514b007eb21e
platform/packages/apps/SafetyRegulatoryInfo a7feaf57d4511f847ce43f8bab6482b0f085d826
platform/packages/apps/SecureElement 023718c08c93dcf237a05b68e6eba36de0cdefad
-platform/packages/apps/Settings 44360bc96aa7297be4f7a24f41e07ddbd7815934
+platform/packages/apps/Settings 0c724f5181747a9ae08eea25ab406da808ee365e
platform/packages/apps/SettingsIntelligence 6827e4a066bc730d1f8a18c824c4646503fda0ef
platform/packages/apps/SoundRecorder 0f64cc38e2a2c4d7cc020a6821f4956b333ad62c
platform/packages/apps/SpareParts 1067dc8f999729f3588cbdbb5ee01ec090297d09
@@ -524,7 +529,7 @@
platform/packages/apps/Test/connectivity 36f295abe027799dde9e14a6e2c2aad0dfd6db60
platform/packages/apps/TimeZoneData 828f0524d5e86452de63db0419b46948d126e7dc
platform/packages/apps/TimeZoneUpdater 77db3bc049791e8445364024bf31484a9538706c
-platform/packages/apps/Traceur 67734f96d4e13c256dfc0222bcb874f7d83ecf27
+platform/packages/apps/Traceur 0252d19f14a1f5f3928b35055b8b2ee2a6abb06d
platform/packages/apps/TvSettings f5caf58cf43ead086ef27959c91ee7aff90ec286
platform/packages/apps/UnifiedEmail 796b98834469e68beec8cf264b48e74352d1c667
platform/packages/apps/WallpaperPicker 84dfd5a4094d3a7024f5375d10f2b41289845dd8
@@ -532,7 +537,7 @@
platform/packages/inputmethods/LatinIME 0b6bd00834d6013f867dd85bde609b7072a8aa47
platform/packages/inputmethods/OpenWnn 7525835dc606501b19084c6fd09b2774317b60df
platform/packages/providers/ApplicationsProvider 33d26f5eedb3d3011762ce5b2de66e931bf64b35
-platform/packages/providers/BlockedNumberProvider be34c87e8283f641e2fb96fd9ca103a0302a74c0
+platform/packages/providers/BlockedNumberProvider c499afb74fc17108957791157cd9faa824575fc3
platform/packages/providers/BookmarkProvider 3f85b115452ee79f327353d67d5381d5b409e76d
platform/packages/providers/CalendarProvider d3aa3110a1e6a6950f6705b850871421369a8a0d
platform/packages/providers/CallLogProvider c107a08365d81cd62bfcc6410c5c8beded72910b
@@ -540,31 +545,31 @@
platform/packages/providers/DownloadProvider 64a7a8d6d404433af0cb7a4fcc0e73643b097bcb
platform/packages/providers/MediaProvider cdcd3719b45e14a84c62366e713b9e9c6b221bd9
platform/packages/providers/PartnerBookmarksProvider 3a6cc4e2baf8ac1f073a337dbfcdb21836b67ff4
-platform/packages/providers/TelephonyProvider bbf17d5eb952c886ddb6fac8aaa84559226a707f
+platform/packages/providers/TelephonyProvider dd442c9dc85faac28acd2ef72c59f0d2a2fd2f92
platform/packages/providers/TvProvider 5d43cb23280c3ef26a650eea6e94f9ec874849c9
platform/packages/providers/UserDictionaryProvider 2a7aff641481a931848326b03f9d2992d29d3e3c
platform/packages/screensavers/Basic d5672084ae35385a705d58c31e595133044be31d
platform/packages/screensavers/PhotoTable 72e1190e2d494180212e73609d495b50d62483f2
platform/packages/screensavers/WebView a3efb7f8644fa676486016d93d113a821dd97776
platform/packages/services/BuiltInPrintService 9793256969ffd285f639300fae918741dec13af1
-platform/packages/services/Car 9a2f9097b56a44332554e8b1acdb8f0a08685fec
+platform/packages/services/Car 43231d977bb33f7443fd9c25a230e1a4593f6de7
platform/packages/services/Mms 389e465876ac5f1fd3508a95ad34d70077c3cd27
platform/packages/services/NetworkRecommendation 83c1d9346149bb1615328a13d15873a455754633
-platform/packages/services/Telecomm bc6d0c3f8f8f579541077f0164b228c785e332ee
-platform/packages/services/Telephony 68f322ab62e1b6c66941f5b09a93dbe452c58ae5
+platform/packages/services/Telecomm 1c05cf6a12606a959917f09f0804c803a67b6e8e
+platform/packages/services/Telephony 149f5722e4b0790019082f4b1cc17a68e8d24d0f
platform/packages/wallpapers/LivePicker 17d576040862f512a458a4fafd50762f970798b4
platform/pdk a4ebf6d13f8bbda670e495c53fc49675c02aacce
-platform/platform_testing 5a3623042329221f0b7de9cd06a55f242796e538
+platform/platform_testing b24d8a23b7890cfe69a979bc07addaa4be49bcdc
platform/prebuilts/abi-dumps/ndk f47d391ecfe5e71a0e82db1990f4ff836f76f51a
platform/prebuilts/abi-dumps/vndk c44364239f7efea4d63a782fe961ae2608b570cf
platform/prebuilts/android-emulator 93043fa96faff13e678e5c5f74dfa72d3b2e16b0
-platform/prebuilts/build-tools 1d896cdc54a0237660fae2b31596544d1605c5bb
+platform/prebuilts/build-tools ae98b7f105b8c496aab6fec01b6182d215523d76
platform/prebuilts/checkcolor af7f8a98adb84833ab33ca5d1eba25883ac63d5a
platform/prebuilts/checkstyle 8ff3f0e77db2e7e3770a3e3699401570cc68e9c1
platform/prebuilts/clang-tools d39538009de33b44a3f67ddb0ebe2722e1ef5f19
platform/prebuilts/clang/host/darwin-x86 cea1308de6d32ef9453baaf280a35d32027506e1
-platform/prebuilts/clang/host/linux-x86 d42fce2273fe17e4ec0b85be8ec6a4931cf2c005
-platform/prebuilts/deqp 9be6958ed50c63633d01d5e01d27f25675b52e72
+platform/prebuilts/clang/host/linux-x86 ddabe417a4872babf26b26f3d3c45e2a4373009d
+platform/prebuilts/deqp c0b000da7f90b269e022439b5b9d6f0cdf41c83a
platform/prebuilts/devtools 1d140f3bc72896ec60d6c21d7d27013ce9d8e4af
platform/prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9 5239d733a5b45781cf0078f70921e941cc7edf8d
platform/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.9 ed1ffc5e65091dfaf792fe150296aebb9b32c090
@@ -594,64 +599,67 @@
platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
platform/prebuilts/python/linux-x86/2.7.5 5bcc5eb23dbb00d5e5dbf75835aa2fb79e8bafa2
platform/prebuilts/qemu-kernel de9c22e6d01c2859788d77124bdf0c20a7dfcd4b
-platform/prebuilts/r8 9e6f0108e9ce82d9b0ddd538f9a6ac49fd50ae43
-platform/prebuilts/sdk 659daf2ef08a5d2dd019233f4b516fbd3ecec8a7
-platform/prebuilts/tools a785e2c0676af300d7e3c81f764014260c4963c9
+platform/prebuilts/r8 83d823bb2c2d70d71d9827108eabeeb4c9887a3b
+platform/prebuilts/sdk effab6ec37d3c40844d4d6b6993fd4cab5456be0
+platform/prebuilts/tools 22c1e576c650aac28f614eef82921204955e7ee4
platform/prebuilts/vndk/v27 ff622beecb72c0b4f2fff20eb1cee09071d02d2c
platform/sdk fec4f7d58d66c266fa11fa79efe31d150e2f5e27
-platform/system/bt 783293824c868bb4176bd286e1002e04c499996e
+platform/system/apex 944db1b27922f2dbdaa5c58260310d7b4acfc8a3
+platform/system/bt 4e9717ed2d6401cef39ec9dd9d3b13579fbb10ed
platform/system/ca-certificates 9a74bbdc4db97bc8f50a2d7da71f9bfd6b7eb7a5
platform/system/chre 5de00e798802499abe0d02c36f682335181a6e2f
platform/system/connectivity/wificond 322d7a21fb0916b333700737979d2ea3922c4f1c
platform/system/connectivity/wifilogd 7e7bce4c4e2981d39c23820490245ffd78158ca7
-platform/system/core 2a5881186d033d43633571133e1602688bf5b377
-platform/system/extras 9d3d54a4642c0b7047fda7555d1eec164b0fd052
-platform/system/gatekeeper c5bf61b35935cbfa75aa9d8d5c3d8fbb4d4953ee
-platform/system/hardware/interfaces 69c3fc690d728a58e7f44c2e1933fac5e1fba89a
+platform/system/core 472223ee35f5b3ab3bb662bfc8af9d06f46b43c5
+platform/system/extras f493b45950af67328acd3fa8c1bce931890148e0
+platform/system/gatekeeper a4c66f3f41627eef6def0e44a78962a8403113c7
+platform/system/hardware/interfaces 180813bea6f703a54bec790f9e807e737d09a51b
platform/system/hwservicemanager 872f997261dd8b2277823d75166358bc3150502b
platform/system/iorap 51ce7a80ca2cdc995b2de81996da1ee82add652f
platform/system/iot/attestation dc9bb3b08dac3405a38e772e7c2aed7666549182
-platform/system/keymaster e8f854015962ff3c45701f7a8dffe59fbf6f8828
+platform/system/keymaster 8079cfe99bc067491fd82efd22953daadb17e53b
platform/system/libfmq fb19cc8ba0e765f73963f23cc17ef006bae99fa1
platform/system/libhidl 8f2a6cc2a0bf9ed5a06744bdae759c8748e62ad9
platform/system/libhwbinder 31a794338bd7e5c78995534faf07cfabded1a72f
platform/system/libufdt b59dbe8eb4cdef68a676b7aa3cb416f94d5ce8ec
-platform/system/libvintf ba588bc3fbcc663bac967da7ae38c378d178e518
-platform/system/media dbbcb69af4dff9c1b6a689bfcb0e4e7638cfbecd
-platform/system/netd a48bda96011a7e9cd24dcef8d978d8e5f8b25a82
-platform/system/nfc a44e67b43d0a6fb424d85fab094c668f99377a87
+platform/system/libvintf 4d4a4c119151e02e09559df0c7db46c7583b3362
+platform/system/media 9977afe00642ac37f196c8f81ecb1ff8c5ec62e6
+platform/system/netd 97bb14c27cd0dc18661d1a4551036e518290a3d7
+platform/system/nfc 9739136402f64f28bad100ab14775acf2f2bc6c4
platform/system/nvram 6c246ace0160aedf62a7e699e1ccef51e1d12a01
-platform/system/security 4445b8ca2889f0c6f60ec435cb3a421842a108c9
-platform/system/sepolicy 383471c267b6792f1625f8f771d8e0c0b9090300
-platform/system/timezone a84d11a43431fdd1b561437d5e230d7d2f364032
-platform/system/tools/aidl 05463737596bab7c2426c122bba01ceb4bd22315
-platform/system/tools/hidl 7262a5cad985b3956f2a84efdbe569fb80754827
-platform/system/tools/xsdc e3863e41eb54a957049afe18f90be185af9cfed5
-platform/system/update_engine f6b0daf427de7a407406f58a73978e774d3d4260
-platform/system/vold 92f5db4a06dc4a0ee287e21dc7501a834343a278
-platform/test/framework 760a2f98e167147e7baeda0793b8ba0c350ac8c5
-platform/test/mlts/benchmark e0fe62caa793035db59d03fa811275c008ed40d1
-platform/test/mlts/models eccf58ad60577853ed831106a8ce893f69c8fbed
-platform/test/suite_harness e8839155e82450c0f4d972c6636ac1710ced4bc8
+platform/system/security 1ca2dafcff7c4199064e05c1c2bf1b15fffe8cf5
+platform/system/sepolicy 00f76cb4ffa10432e67addbe68e616287b71dc3e
+platform/system/testing/gtest_extras 267da04f79bc1b147a31dc3d34c37ce9f78396a6
+platform/system/timezone cbe72026bbb38f57dde6232dfe010392b74ea01d
+platform/system/tools/aidl 860b194607f79c1089477fa1682f79c20de8e558
+platform/system/tools/hidl abedbf22237dc2a65b3546a2e2964620c9a1cbdb
+platform/system/tools/sysprop b0603902e20c0ec3ee1fa9f09895f308f867088d
+platform/system/tools/xsdc ae3e5a452f197e718ef88cccfdf3247ebcf99d54
+platform/system/update_engine d944faad2e460af36df59e95c5371ca6b87309d3
+platform/system/vold 732def209c157ca1a186ec5b27b05fe1f282ca9d
+platform/test/framework 0766af5ccc35b7bde198085d2c6e90fcc6b0d505
+platform/test/mlts/benchmark 6063374e9c1559e6d1ffb86e37cae74edc7df652
+platform/test/mlts/models d8593bbe284c07da779b42c31a237272edc9b4ec
+platform/test/suite_harness babb6b9470396943e713d23bdc150e553b988af8
platform/test/vti/alert 2270d160e38f0623d708cce36754fe14168dce64
-platform/test/vti/dashboard c4798bc4cd5ca6734b5918cef141159c4dfa6876
+platform/test/vti/dashboard 7148352cb05e0d011d568f1465cfb1ef1882dcce
platform/test/vti/fuzz_test_serving e5bcc336b6b8bb7826e791cf608bf0efbb32a2ed
platform/test/vti/test_serving f42e0543c7c5cbcf31c12079f3beab2dee1e031a
-platform/test/vts 52b0a932d9ce8ffd00c4160717a94dcf1111501d
-platform/test/vts-testcase/fuzz 19b14ab2c3807a8e30ef4dfdf3a73b34465e5433
-platform/test/vts-testcase/hal 8337e72c78c64164c494d3a4f87c69d78ccd6bd6
+platform/test/vts dfca1d813104951a512f4cd5b9d30adb38326a1a
+platform/test/vts-testcase/fuzz 617c29d5f1b07dbc2d906b5531d09ff5c874db19
+platform/test/vts-testcase/hal 0c0ea3328d8c567bb9e87832da57a56ea81f9e87
platform/test/vts-testcase/hal-trace 260dfffd16a180ac1d278b6bb43d8fefadbb7460
-platform/test/vts-testcase/kernel cc78bc3a9c3be54de793bc8a33e14808afc2dee9
+platform/test/vts-testcase/kernel eafe33d4adf61ec8f6726566746f2a2987256249
platform/test/vts-testcase/nbu 70b9b838d7fa258ac1ffffbeb2cb606ad2218fd6
platform/test/vts-testcase/performance f7ec18facb34e40685efd25069d70504b9d4fa86
platform/test/vts-testcase/security 66ec8bb0bd31edae8cb198ebacf5e1bd45b17ca7
-platform/test/vts-testcase/vndk 597026bc923705a2479365c3737606147ea16ce4
-platform/tools/acloud a38b6e904c7c75391406b71fd88d0d0a5749b017
+platform/test/vts-testcase/vndk 39adbb1822413d6f632d881f30bde243ab5fce31
+platform/tools/acloud 34776bbad4534efc498ba282f512c64efba2a4af
platform/tools/adt/idea dbaf0c96c3214cce5497259831469c05aacb3068
platform/tools/apksig 15630cdebbd2731ed5e349be50dd28a01afd38c6
platform/tools/apkzlib 65da1558097c007a847ed46ecd27a5a69ce6d96a
platform/tools/appbundle 9f85eef4a9394b99031dd4c2aaafc4b74f3b303e
-platform/tools/asuite 927a81a550f844af7a8bf24715113929a09d1351
+platform/tools/asuite a9f41f1105e3db3065e17870a19d72ec17900367
platform/tools/base 908b391a9c006af569dfaff08b37f8fdd6c4da89
platform/tools/build 69c4b95102b4b9862bfba68b3eaf5b7537a705ee
platform/tools/dexter d803fdf37ea8b313360283f6baa965be2d01c36c
@@ -660,15 +668,16 @@
platform/tools/external_updater 70480f5af1e45843ce494175450f67f588b539c0
platform/tools/idea 9b5d02ac8c92b1e71523cc15cb3d168d57fbd898
platform/tools/loganalysis c5161757bad8e99dbdae12728fd8b96e5ced8830
-platform/tools/metalava 85891ef64858818fb201557a5597318cb06b729b
+platform/tools/metalava 75f2034d4d812ff5fc320d109aa6e8b4e7a7e999
platform/tools/motodev 69989786cefbde82527960a1e100ec9afba46a98
+platform/tools/ndkports 74fefbc2160250129cbd157272fcfb3c9ac20f18
platform/tools/repohooks 2ee871c35817d3c1f7b8964d2e9c62c033cd8785
platform/tools/security fdda0f4c20431c4b40372e2a0080017f50f55218
platform/tools/studio/cloud 58f06e77e051fff3903adabca7acdaa9dd12ec2d
platform/tools/swt 8996e71047a2bd11efee46ef14e02435ab5fa07a
-platform/tools/test/connectivity ac9693b9f7fe0089db80cedf1eb8739fb27d9b6c
+platform/tools/test/connectivity 560ad5df1ab69e477079317df473b9f0b06de38e
platform/tools/test/graphicsbenchmark 10f5ef9f93e71fd0ff3a1907635201647cba361f
-platform/tools/tradefederation 504939e02c87842422a784472b2d9ba89f724ac7
+platform/tools/tradefederation 07fb3569a48c82bef4d54ebca582519af9fda51a
platform/tools/tradefederation/contrib 9120d96079c644f2cc8fecdc7be69cf62688e113
toolchain/benchmark ce43588700ff84f20b6bf6a513d8932f693e33dd
toolchain/binutils 44492f8e438f8ce42a254699ba8496eb76075e00
diff --git a/report.py b/report.py
index 76f56ff..ae99e25 100755
--- a/report.py
+++ b/report.py
@@ -302,6 +302,7 @@
args = [simpleperf_path, 'report', '-h']
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
(stdoutdata, _) = proc.communicate()
+ stdoutdata = bytes_to_str(stdoutdata)
return stdoutdata[stdoutdata.find('\n') + 1:]
diff --git a/report_html.js b/report_html.js
index 720f72f..4096409 100644
--- a/report_html.js
+++ b/report_html.js
@@ -1101,23 +1101,33 @@
for (let node of initNodes) {
this.sumCount += node.s;
}
- function getMaxDepth(node) {
- let depth = 0;
- for (let child of node.c) {
- depth = Math.max(depth, getMaxDepth(child));
- }
- return depth + 1;
- }
- this.maxDepth = 0;
- for (let node of this.initNodes) {
- this.maxDepth = Math.max(this.maxDepth, getMaxDepth(node));
- }
+ this.maxDepth = this._getMaxDepth(this.initNodes);
this.svgHeight = this.svgNodeHeight * (this.maxDepth + 3);
this.svgStr = null;
this.svgDiv = null;
this.svg = null;
}
+ _getMaxDepth(nodes) {
+ let isArray = Array.isArray(nodes);
+ let sumCount;
+ if (isArray) {
+ sumCount = nodes.reduce((acc, cur) => acc + cur.s, 0);
+ } else {
+ sumCount = nodes.s;
+ }
+ let width = this._getWidthPercentage(sumCount);
+ if (width < 0.1) {
+ return 0;
+ }
+ let children = isArray ? this._splitChildrenForNodes(nodes) : nodes.c;
+ let childDepth = 0;
+ for (let child of children) {
+ childDepth = Math.max(childDepth, this._getMaxDepth(child));
+ }
+ return childDepth + 1;
+ }
+
draw() {
// Only draw skeleton.
this.div.empty();
diff --git a/simpleperf_report_lib.py b/simpleperf_report_lib.py
index d2bc2d3..ab45b67 100644
--- a/simpleperf_report_lib.py
+++ b/simpleperf_report_lib.py
@@ -105,7 +105,7 @@
if self.elem_count > 1 and self.elem_size == 1 and self.is_signed == 0:
# The field is a string.
length = 0
- while length < self.elem_count and data[self.offset + length] != '\x00':
+ while length < self.elem_count and bytes_to_str(data[self.offset + length]) != '\x00':
length += 1
return bytes_to_str(data[self.offset : self.offset + length])
unpack_key = self._unpack_key_dict.get(self.elem_size)
diff --git a/test.py b/test.py
index a0fb41f..a3ef42f 100755
--- a/test.py
+++ b/test.py
@@ -36,6 +36,7 @@
"""
from __future__ import print_function
import argparse
+import filecmp
import fnmatch
import inspect
import os
@@ -49,10 +50,11 @@
import unittest
from app_profiler import NativeLibDownloader
+from binary_cache_builder import BinaryCacheBuilder
from simpleperf_report_lib import ReportLib
from utils import log_exit, log_info, log_fatal
-from utils import AdbHelper, Addr2Nearestline, get_script_dir, is_windows, Objdump, ReadElf, remove
-from utils import SourceFileSearcher
+from utils import AdbHelper, Addr2Nearestline, bytes_to_str, find_tool_path, get_script_dir
+from utils import is_python3, is_windows, Objdump, ReadElf, remove, SourceFileSearcher
try:
# pylint: disable=unused-import
@@ -112,6 +114,7 @@
else:
subproc = subprocess.Popen(args, stdout=subprocess.PIPE, shell=use_shell)
(output_data, _) = subproc.communicate()
+ output_data = bytes_to_str(output_data)
returncode = subproc.returncode
except OSError:
returncode = None
@@ -807,21 +810,37 @@
(function_prefix + 'SleepFunction', 20)])
-class TestProfilingCmd(TestBase):
- def test_smoke(self):
- remove("perf.data")
+class TestNativeProfiling(TestBase):
+ def setUp(self):
+ self.adb = AdbHelper()
+ self.is_rooted_device = self.adb.switch_to_root()
+
+ def test_profile_cmd(self):
self.run_cmd(["app_profiler.py", "-cmd", "pm -l", "--disable_adb_root"])
self.run_cmd(["report.py", "-g", "-o", "report.txt"])
+ def test_profile_native_program(self):
+ if not self.is_rooted_device:
+ return
+ self.run_cmd(["app_profiler.py", "-np", "surfaceflinger"])
+ self.run_cmd(["report.py", "-g", "-o", "report.txt"])
+ self.run_cmd([INFERNO_SCRIPT, "-sc"])
+ self.run_cmd([INFERNO_SCRIPT, "-np", "surfaceflinger"])
-class TestProfilingNativeProgram(TestBase):
- def test_smoke(self):
- adb = AdbHelper()
- if adb.switch_to_root():
- self.run_cmd(["app_profiler.py", "-np", "surfaceflinger"])
- self.run_cmd(["report.py", "-g", "-o", "report.txt"])
- self.run_cmd([INFERNO_SCRIPT, "-sc"])
- self.run_cmd([INFERNO_SCRIPT, "-np", "surfaceflinger"])
+ def test_profile_pids(self):
+ if not self.is_rooted_device:
+ return
+ pid = int(self.adb.check_run_and_return_output(['shell', 'pidof', 'system_server']))
+ self.run_cmd(['app_profiler.py', '--pid', str(pid), '-r', '--duration 1'])
+ self.run_cmd(['app_profiler.py', '--pid', str(pid), str(pid), '-r', '--duration 1'])
+ self.run_cmd(['app_profiler.py', '--tid', str(pid), '-r', '--duration 1'])
+ self.run_cmd(['app_profiler.py', '--tid', str(pid), str(pid), '-r', '--duration 1'])
+ self.run_cmd([INFERNO_SCRIPT, '--pid', str(pid), '-t', '1'])
+
+ def test_profile_system_wide(self):
+ if not self.is_rooted_device:
+ return
+ self.run_cmd(['app_profiler.py', '--system_wide', '-r', '--duration 1'])
class TestReportLib(unittest.TestCase):
@@ -1188,7 +1207,7 @@
downloader.collect_native_libs_on_device()
self.assertEqual(len(downloader.device_build_id_map), 0)
- lib_list = downloader.host_build_id_map.items()
+ lib_list = list(downloader.host_build_id_map.items())
for sync_count in [0, 1, 2]:
build_id_map = {}
for i in range(sync_count):
@@ -1210,8 +1229,8 @@
if sync_count == 1:
adb.run(['pull', '/data/local/tmp/native_libs/build_id_list', 'build_id_list'])
with open('build_id_list', 'rb') as fh:
- self.assertEqual(fh.read(), '{}={}\n'.format(lib_list[0][0],
- lib_list[0][1].name))
+ self.assertEqual(bytes_to_str(fh.read()),
+ '{}={}\n'.format(lib_list[0][0], lib_list[0][1].name))
remove('build_id_list')
adb.run(['shell', 'rm', '-rf', '/data/local/tmp/native_libs'])
@@ -1221,20 +1240,64 @@
self.run_cmd(['report_html.py', '-i', 'testdata/perf_with_long_callchain.data'])
+class TestBinaryCacheBuilder(TestBase):
+ def test_copy_binaries_from_symfs_dirs(self):
+ readelf = ReadElf(None)
+ strip = find_tool_path('strip', arch='arm')
+ self.assertIsNotNone(strip)
+ symfs_dir = os.path.join('testdata', 'symfs_dir')
+ remove(symfs_dir)
+ os.mkdir(symfs_dir)
+ filename = 'simpleperf_runtest_two_functions_arm'
+ origin_file = os.path.join('testdata', filename)
+ source_file = os.path.join(symfs_dir, filename)
+ target_file = os.path.join('binary_cache', filename)
+ expected_build_id = readelf.get_build_id(origin_file)
+ binary_cache_builder = BinaryCacheBuilder(None, False)
+ binary_cache_builder.binaries['simpleperf_runtest_two_functions_arm'] = expected_build_id
+
+ # Copy binary if target file doesn't exist.
+ remove(target_file)
+ self.run_cmd([strip, '--strip-all', '-o', source_file, origin_file])
+ binary_cache_builder.copy_binaries_from_symfs_dirs([symfs_dir])
+ self.assertTrue(filecmp.cmp(target_file, source_file))
+
+ # Copy binary if target file doesn't have .symtab and source file has .symtab.
+ self.run_cmd([strip, '--strip-debug', '-o', source_file, origin_file])
+ binary_cache_builder.copy_binaries_from_symfs_dirs([symfs_dir])
+ self.assertTrue(filecmp.cmp(target_file, source_file))
+
+ # Copy binary if target file doesn't have .debug_line and source_files has .debug_line.
+ shutil.copy(origin_file, source_file)
+ binary_cache_builder.copy_binaries_from_symfs_dirs([symfs_dir])
+ self.assertTrue(filecmp.cmp(target_file, source_file))
+
+
def get_all_tests():
tests = []
for name, value in globals().items():
if isinstance(value, type) and issubclass(value, unittest.TestCase):
- test_methods = [x for x, y in inspect.getmembers(value)
- if isinstance(y, types.UnboundMethodType) and x.startswith('test')]
- for method in test_methods:
- tests.append(name + '.' + method)
+ for member_name, member in inspect.getmembers(value):
+ if isinstance(member, (types.MethodType, types.FunctionType)):
+ if member_name.startswith('test'):
+ tests.append(name + '.' + member_name)
return sorted(tests)
+
+def run_tests(tests):
+ os.chdir(get_script_dir())
+ build_testdata()
+ log_info('Run tests with python%d\n%s' % (3 if is_python3() else 2, '\n'.join(tests)))
+ argv = [sys.argv[0]] + tests
+ unittest.main(argv=argv, failfast=True, verbosity=2, exit=False)
+
+
def main():
parser = argparse.ArgumentParser(description='Test simpleperf scripts')
parser.add_argument('--list-tests', action='store_true', help='List all tests.')
parser.add_argument('--test-from', nargs=1, help='Run left tests from the selected test.')
+ parser.add_argument('--python-version', choices=['2', '3', 'both'], default='both', help="""
+ Run tests on which python versions.""")
parser.add_argument('pattern', nargs='*', help='Run tests matching the selected pattern.')
args = parser.parse_args()
tests = get_all_tests()
@@ -1255,15 +1318,28 @@
if pattern.match(test):
new_tests.append(test)
tests = new_tests
+ if not tests:
+ log_exit('No tests are matched.')
- os.chdir(get_script_dir())
- build_testdata()
if AdbHelper().get_android_version() < 7:
log_info("Skip tests on Android version < N.")
sys.exit(0)
- log_info('Run tests %s' % ('\n'.join(tests)))
- argv = [sys.argv[0]] + tests
- unittest.main(argv=argv, failfast=True, verbosity=2)
+
+ if args.python_version == 'both':
+ python_versions = [2, 3]
+ else:
+ python_versions = [int(args.python_version)]
+ current_version = 3 if is_python3() else 2
+ for version in python_versions:
+ if version != current_version:
+ argv = ['python3' if version == 3 else 'python']
+ argv.append(os.path.join(get_script_dir(), 'test.py'))
+ argv += sys.argv[1:]
+ argv += ['--python-version', str(version)]
+ subprocess.check_call(argv)
+ else:
+ run_tests(tests)
+
if __name__ == '__main__':
main()
diff --git a/utils.py b/utils.py
index 3abcfce..20ea5c5 100644
--- a/utils.py
+++ b/utils.py
@@ -19,6 +19,7 @@
"""
from __future__ import print_function
+import argparse
import logging
import os
import os.path
@@ -77,7 +78,7 @@
return str_value.encode('utf-8')
def bytes_to_str(bytes_value):
- if not is_python3():
+ if not is_python3() or not bytes_value:
return bytes_value
return bytes_value.decode('utf-8')
@@ -147,6 +148,9 @@
'objdump': {
'is_binutils': True,
},
+ 'strip': {
+ 'is_binutils': True,
+ },
}
def _get_binutils_path_in_ndk(toolname, arch, platform):
@@ -235,10 +239,10 @@
else:
subproc = subprocess.Popen(adb_args, stdout=subprocess.PIPE)
(stdoutdata, _) = subproc.communicate()
+ stdoutdata = bytes_to_str(stdoutdata)
returncode = subproc.returncode
result = (returncode == 0)
if stdoutdata and adb_args[1] != 'push' and adb_args[1] != 'pull':
- stdoutdata = bytes_to_str(stdoutdata)
if log_output:
log_debug(stdoutdata)
log_debug('run adb cmd: %s [result %s]' % (adb_args, result))
@@ -773,8 +777,21 @@
"""
path = os.path.realpath(arg)
if not os.path.isdir(path):
- import argparse
raise argparse.ArgumentTypeError('{} is not a directory.'.format(path))
return path
+def extant_file(arg):
+ """ArgumentParser type that only accepts extant files.
+
+ Args:
+ arg: The string argument given on the command line.
+ Returns: The argument as a realpath.
+ Raises:
+ argparse.ArgumentTypeError: The given path isn't a file.
+ """
+ path = os.path.realpath(arg)
+ if not os.path.isfile(path):
+ raise argparse.ArgumentTypeError('{} is not a file.'.format(path))
+ return path
+
logging.getLogger().setLevel(logging.DEBUG)