| # This configuration is written in python and used by app_profiler.py. |
| |
| import os |
| import os.path |
| |
| # The name of the android package, like com.example.android. |
| app_package_name = "com.example.android" |
| |
| |
| # Path of android studio project. It is used to find debug version of native shared libraries. |
| # Set to "" if not available. |
| android_studio_project_dir = "" |
| |
| |
| # Path to find debug version of native shared libraries. |
| native_lib_dir = "" |
| |
| if android_studio_project_dir and not native_lib_dir: |
| tmp_dir = os.path.join(android_studio_project_dir, |
| "app/build/intermediates/binaries/debug".replace('/', os.sep)) |
| if os.path.isdir(tmp_dir): |
| native_lib_dir = tmp_dir |
| |
| |
| # The path of the apk file. It is used when we need to reinstall the app to |
| # fully compile dalvik bytecode into native instructions. |
| # Set to "" if not available. |
| apk_file_path = "" |
| |
| |
| # To profile java code, we need to compile dalvik bytecode into native binaries |
| # with debug information. Set to False if there is no need to do so (For example, |
| # when the app has been recompiled.). |
| recompile_app = True |
| |
| |
| # Set to true if we want to restart the app before profiling. Otherwise, set to False. |
| restart_app = True |
| |
| |
| if recompile_app and not restart_app: |
| raise Exception('[restart_app] is needed for [recompile_app] to take effect.') |
| |
| |
| # We use `am start -n [app_package_name]/[main_activity]` to start the app. |
| main_activity = '.MainActivity' |
| |
| |
| # Profiling record options that will be passed directly to `simpleperf record` command on device. |
| # As we can't stop profiling by Ctrl-C, we need to set how long to profile using "--duration". |
| record_options = "-e cpu-cycles:u -f 4000 -g --dump-symbols --duration 10" |
| |
| |
| # The path to store generated perf.data on host. |
| perf_data_path = "perf.data" |
| |
| |
| # The path of adb. |
| adb_path = "adb" |
| |
| |
| # The path of readelf, used to read build id of files in binary cache. |
| # Set to "" if not available. |
| readelf_path = "readelf" |
| |
| |
| # binary_cache_dir is used to cache binaries pulled from device. To report precisely, we pull each |
| # binary hit by perf.data on host. |
| binary_cache_dir = "binary_cache" |