Fixes a bug in the scripts which prevented true cold starts from
happening (it was force-stopping the activity after the dropcaches).
Also adds -rfd/--reportfullydrawn to make rfd parsing optional since
most apps don't have it.
Bug: 150237362
Test: run_app_with_prefetch -r cold
Change-Id: I132bfc3ccd4d96f171ed364ef64387bbf2c78091
The pattern is shown in logcat and should match the text in iorap.
Test: python app_startup_runner.py --package com.google.android.GoogleCamera --readahead fadvise --inodes ../tmp.txt -d
Bug: 142350683
Change-Id: Ia708ea8d29f4c97126e9e721284a0d346e19573b
When using device, the python modules for host are not loaded to be
compatiable in tradefed.
Test: pytest
Test: python app_startup_runner.py --package com.google.android.GoogleCamera --readahead fadvise --inodes textcache --output output.txt -lc 1 -d
Change-Id: I9fe54045fbabda5f66ebe1cfe6d0a5461fff0640
The time in timestamp is second, while the trace duration is
millisecond. Using timedelta to fix this ambiguity.
Test: pytest compiler_test.py
Change-Id: I6c445c3dac1b60aec77ead14df021b8a2dda7b5e
Collecting and app running share lots of common code.
Create a new class to run app and allow callbacks to specify
preprocess and postprocess and metrics selection.
Test: pytest run_app_with_prefetch_test.py
Test: pytest app_runner_test.py
Bug: 138233615
Change-Id: I972c82fb9ff3a0f6cc7661bc3dc47b342716c26c
The basic idea is add timestamp for MmFilemapAddToPageCache.
Treat the first receiving MmFilemapAddToPageCache timestamp as
the start time. The end time is the sum of start time and duration.
Any MmFilemapAddToPageCache after end time is filtered out.
Test: pytest trace2db_test.py
Bug: 137398235
Change-Id: Ib9c439f3ae0ca666eacb08492361217d89adec34
Shell version metrics parser generates some strange results when called
from Python.
Test: pytest logcat_utils_test.py
Test: pytest adb_utils_test.py
Test: pytest run_app_with_prefetch_test.py
Change-Id: I44a464f7e87f35ecc283c5108577eb33ad394fc6
Compiler will be used for experimentation purpose since it's both easier
to develop in python and it accepts ftrace, making it very easy to write
complicated-experimental changes that we aren't sure are worth it yet
for the on-device C++/perfetto compiler.
This 'new' compiler accepts ftrace/systrace files as input,
then generates an in-memory sqlite3 database (using the trace_analyzer
source code), and finally code-generates a TraceFile.pb protobuf.
(Also refactor trace_analyzer into a library, and update it to
parse systrace.html files)
Limitations: currently does not accept perfetto_trace.pb files due to
'ofs' fields missing (see bug#135555191)
Test: py.test-3 frameworks/base/startop/scripts
Test: ./compiler.py -i tmp_sargo/textcache -t tmp_sargo/trace.html -o tmp/output.pb
Test: ./compiler.py -i tmp_sargo/textcache -t tmp_sargo/trace.html -o tmp/output.pb -f '^/data'
Test: ./trace_analyzer music_run.trace tmp_dbs/12345.db
Bug: 135557978
Bug: 134789969
Change-Id: Ic8295900ee9e634b4cfd8cf99b671ae08d2ea4f7
Parse ACTIVITY_FIRST_PREVIEW_FRAME_RECEIVED_ms,ACTIVITY_FIRST_PREVIEW_FRAME_RENDERED_ms
from logcat when running Camera app.
Also updates the scripts to support multiple metrics output (previously
only one allowed). Adding future per-app metrics is also possible by
just adding 1 file with 1 function call with a regex pattern.
Bug: 132649131
Change-Id: Ibfc620bb156f733b69faa7654b06ef35f1a34de3
Adds a simple python parser to convert .ftrace file into
sqlite3 database.
The rest of the analysis logic is done through a series of SQL
commands that build tables/views/select queries.
Bug: 134705245
Test: trace_analyzer some_ftrace_file.trace tmp_file.db
Change-Id: I25274e25a0ab1f091ae4e6161e6726e006e346a5
Input: either pinlist.meta or a text file.
Output: either text file or iorap.TraceFile protobuf.
Also supports looking inside zip files to find out entry offset
automatically.
Bug: 132649131
Change-Id: I638fda1bb11899bb6d123b3aaedb518c0b4d1a80
Script measures app startup times with/without iorapd-based
prefetching against a cold (or warm) baseline.
mlock/fadvise readahead options now use iorapd to exercise
real code to do prefetching.
Bug: 72170747
Change-Id: I28affac3470271e46febb0e22a6dc9543258b4a4
Fix remote_pkill function to work on multiple pids,
this was breaking chrome (which has 3 pids).
Fix activity inference to the "$pkg/$activity"
pattern where previously it could accidentally parse
the wrong token.
Fix app launching to handle activities with '$' in
the name which adb shell treated as a variable.
Test: manual
Change-Id: Ifc9a72f1b9bb5e1416c7602f27f4614efd003849
Adds a new script which is used by app_startup_runner.py and
run_app_with_prefetch in order to force the compilation filter.
Example:
$> ./query_compiler_filter.py --package com.google.android.calculator
speed-profile unknown arm64
(For example compiling to speed is extremely slow, compiling to
speed-profile is just marginally slow.)
Matching the compiler filter with what we actually need to measure is
extremely important as the performance will vary greatly.
Change-Id: I78ae76504208a672a7d17bab5001d11ab796d9d4
Example: ./force_compiler_filter --package com.google.android.apps.maps --compiler-filter speed-profile
Run the app just slightly enough to fully start up, then force it to
dump the profile and recompile the application with dex2oat under the
speed-profile filter.
(Also supports any other compilation filter such as quicken, speed,
etc).
Subsequently, this command can be used to manually validate that the
compiler filter was indeed changed:
$ adb shell dumpsys package com.google.android.apps.maps | grep -A10 "Dexopt state"
Dexopt state:
[com.google.android.apps.maps]
path: /data/app/com.google.android.apps.maps-D7s8PLidqqEq7Jc7UH_a5A==/base.apk
arm64: [status=speed-profile] [reason=unknown]
Test: Manual (see above)
Change-Id: Iea6067f90dc287d1de651d1ab36df69d23b2e9c1