卡顿分析
- https://developer.android.com/topic/performance/rendering/inspect-gpu-rendering
- https://developer.android.com/topic/performance/vitals/render
- https://developer.android.com/training/testing/performance
seveniruby:systrace seveniruby$ python2 systrace.py --help
Usage: systrace.py [options] [category1 [category2 ...]]
Example: systrace.py -b 32768 -t 15 gfx input view sched freq
Options:
-h, --help show this help message and exit
-o FILE write trace output to FILE
-j, --json write a JSON file
--link-assets (deprecated)
--asset-dir=ASSET_DIR
(deprecated)
-e DEVICE_SERIAL_NUMBER, --serial=DEVICE_SERIAL_NUMBER
adb device serial number
--target=TARGET choose tracing target (android or linux)
--timeout=TIMEOUT timeout for start and stop tracing (seconds)
--collection-timeout=COLLECTION_TIMEOUT
timeout for data collection (seconds)
-t N, --time=N trace for N seconds
-b N, --buf-size=N use a trace buffer size of N KB
-l, --list-categories
list the available categories and exit
Atrace options:
--atrace-categories=ATRACE_CATEGORIES
Select atrace categories with a comma-delimited list,
e.g. --atrace-categories=cat1,cat2,cat3
-k KFUNCS, --ktrace=KFUNCS
specify a comma-separated list of kernel functions to
trace
--no-compress Tell the device not to send the trace data in
compressed form.
-a APP_NAME, --app=APP_NAME
enable application-level tracing for comma-separated
list of app cmdlines
--from-file=FROM_FILE
read the trace from a file (compressed) rather than
running a live trace
Atrace process dump options:
--process-dump Capture periodic per-process memory dumps.
--process-dump-interval=PROCESS_DUMP_INTERVAL_MS
Interval between memory dumps in milliseconds.
--process-dump-full=PROCESS_DUMP_FULL_CONFIG
Capture full memory dumps for some processes. Value:
all, apps or comma-separated process names.
--process-dump-mmaps
Capture VM regions and memory-mapped files. It
increases dump size dramatically, hence only has
effect if --process-dump-full is a whitelist.
Ftrace options:
--ftrace-categories=FTRACE_CATEGORIES
Select ftrace categories with a comma-delimited list,
e.g. --ftrace-categories=cat1,cat2,cat3
WALT trace options:
--walt Use the WALT tracing agent. WALT is a device for
measuring latency of physical sensors on phones and
computers. See https://github.com/google/walt
adb shell dumpsys gfxinfo
崩溃
弱网
系统资源
adb shell dumpsys procstats --hours 3
adb shell dumpsys meminfo package_name|pid [-d]
adb shell dumpsys batterystats --charged package-name
adb shell dumpsys netstats detail
adb shell dumpsys gfxinfo package-name
白盒测试
作业
使用systrace获得某个app的最长卡顿帧的截图