summaryrefslogtreecommitdiff
path: root/simpleperf/scripts/app_profiler.config
blob: 752b85f7b0b630d26d80d083bdcd49280a62dcee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# 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


# If launch_activity is specified, we use `am start -n [app_package_name]/[launch_activity]` to start the app.
launch_activity = '.MainActivity'

# If launch_activity is not set, and launch_inst_test is, we launch an instrumentation test:
# `am instrument -e class [launch_inst_test] [app_package_name]/android.support.test.runner.AndroidJUnitRunner`
# Generally, will be of the form 'com.example.MyTestClass#myTestMethod'
launch_inst_test = ''


if recompile_app and not launch_activity and not launch_inst_test:
    raise Exception('one of [launch_activity or launch_inst_test] is'
        + 'needed for [recompile_app] to take effect.')


# Profiling record options that will be passed directly to `simpleperf record` command on device.
# You can set how long to profile using "--duration" option, or use Ctrl-C to stop profiling.
record_options = "-e cpu-cycles:u -f 4000 -g --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"