通过android 自带adb命令:
1、打开开发者选项:点击手机版本号7次,打开开发者选项。
2、打开开发者选项,下拉菜单,选择GPU呈现模式分析,选择在adb shell dumpsys gfxinfo中
3、复现需要测试的场景,执行如下命令:
adb shell dumpsys gfxinfo <package name>
如settings app
adb shell dumpsys gfxinfo com.android.settings
Applications Graphics Acceleration Info:
Uptime: 63254067 Realtime: 64407287
** Graphics info for pid 19251 [com.android.settings] **
Stats since: 58705283085105ns
Total frames rendered: 3099
Janky frames: 214 (6.91%)
50th percentile: 11ms
90th percentile: 15ms
95th percentile: 18ms
99th percentile: 36ms
Number Missed Vsync: 37
Number High input latency: 0
Number Slow UI thread: 113
Number Slow bitmap uploads: 4
Number Slow issue draw commands: 58
HISTOGRAM: 5ms=393 6ms=160 7ms=128 8ms=210 9ms=263 10ms=377 11ms=405 12ms=373 13ms=273 14ms=178 15ms=88 16ms=50 17ms=37 18ms=34 19ms=25 20ms=16 21ms=9 22ms=9 23ms=9 24ms=4 25ms=2 26ms=5 27ms=1 28ms=4 29ms=5 30ms=1 31ms=1 32ms=3 34ms=2 36ms=4 38ms=2 40ms=1 42ms=3 44ms=1 46ms=2 48ms=2 53ms=2 57ms=2 61ms=2 65ms=0 69ms=1 73ms=3 77ms=3 81ms=0 85ms=2 89ms=1 93ms=1 97ms=0 101ms=0 105ms=0 109ms=0 113ms=1 117ms=0 121ms=0 125ms=0 129ms=1 133ms=0 150ms=0 200ms=0 250ms=0 300ms=0 350ms=0 400ms=0 450ms=0 500ms=0 550ms=0 600ms=0 650ms=0 700ms=0 750ms=0 800ms=0 850ms=0 900ms=0 950ms=0 1000ms=0 1050ms=0 1100ms=0 1150ms=0 1200ms=0 1250ms=0 1300ms=0 1350ms=0 1400ms=0 1450ms=0 1500ms=0 1550ms=0 1600ms=0 1650ms=0 1700ms=0 1750ms=0 1800ms=0 1850ms=0 1900ms=0 1950ms=0 2000ms=0 2050ms=0 2100ms=0 2150ms=0 2200ms=0 2250ms=0 2300ms=0 2350ms=0 2400ms=0 2450ms=0 2500ms=0 2550ms=0 2600ms=0 2650ms=0 2700ms=0 2750ms=0 2800ms=0 2850ms=0 2900ms=0 2950ms=0 3000ms=0 3050ms=0 3100ms=0 3150ms=0 3200ms=0 3250ms=0 3300ms=0 3350ms=0 3400ms=0 3450ms=0 3500ms=0 3550ms=0 3600ms=0 3650ms=0 3700ms=0 3750ms=0 3800ms=0 3850ms=0 3900ms=0 3950ms=0 4000ms=0 4050ms=0 4100ms=0 4150ms=0 4200ms=0 4250ms=0 4300ms=0 4350ms=0 4400ms=0 4450ms=0 4500ms=0 4550ms=0 4600ms=0 4650ms=0 4700ms=0 4750ms=0 4800ms=0 4850ms=0 4900ms=0 4950ms=0
Caches:
Current memory usage / total memory usage (bytes):
TextureCache 2024928 / 58216320
Layers total 0 (numLayers = 0)
RenderBufferCache 0 / 4851360
GradientCache 0 / 1048576
PathCache 0 / 9702720
TessellationCache 4968 / 1048576
TextDropShadowCache 0 / 4851360
PatchCache 2496 / 131072
FontRenderer A8 1363786 / 2918400
A8 texture 0 1252707 / 1478656
A8 texture 1 111079 / 1439744
FontRenderer RGBA 0 / 0
FontRenderer total 1363786 / 2918400
Other:
FboCache 0 / 0
Total memory usage:
4950792 bytes, 4.72 MB
Pipeline=FrameBuilder
Profile data in ms:
com.android.settings/com.android.settings.Settings/android.view.ViewRootImpl@c14a1ea (visibility=8)
Draw Prepare Process Execute
com.android.settings/com.android.settings.Settings$SystemDashboardActivity/android.view.ViewRootImpl@5d27f1f (visibility=8)
Draw Prepare Process Execute
com.android.settings/com.android.settings.SubSettings/android.view.ViewRootImpl@19c5232 (visibility=0)
Draw Prepare Process Execute
1.27 0.44 3.63 1.29
1.39 0.33 3.25 1.58
1.84 0.45 4.26 1.88
1.91 0.59 4.71 2.51
2.85 0.59 5.31 2.75
2.10 0.52 5.77 2.57
2.35 0.74 6.46 2.53
2.95 0.78 5.44 2.74
2.40 1.39 5.16 2.68
2.48 0.82 6.23 2.65
2.33 0.63 5.46 3.03
2.27 0.57 5.74 2.71
2.39 0.59 5.07 3.24
2.73 0.61 5.71 3.29
1.81 0.77 19.81 4.05
3.35 1.30 5.60 4.90
4.65 1.63 5.75 3.02
4.24 0.66 4.93 2.94
3.22 0.64 7.26 2.73
3.56 0.66 5.67 2.68
4.31 0.72 5.00 2.73
3.35 0.89 5.07 2.51
3.80 0.70 6.35 2.70
4.49 0.69 5.34 3.36
4.95 0.92 4.97 2.64
3.24 0.60 3.33 3.00
3.21 0.86 3.91 1.69
2.80 0.54 4.33 1.72
3.18 0.58 3.56 2.28
5.26 0.69 4.11 3.07
4.73 0.79 4.03 2.18
5.55 0.77 5.25 2.71
5.86 0.71 4.94 3.58
7.38 0.54 3.36 1.97
3.03 分分快三计划大全ootImpl@19c5232 (visibility=0)
Draw Prepare Process Execute
1.27 0.44 3.63 1.29
1.39 0.33 3.25 1.58
1.84 0.45 4.26 1.88
1.91 0.59 4.71 2.51
2.85 0.59 5.31 2.75
2.10 0.52 5.77 2.57
2.35 0.74 6.46 2.53
2.95 0.78 5.44 2.74
2.40 1.39 5.16 2.68
2.48 0.82 6.23 2.65
2.33 0.63 5.46 3.03
2.27 0.57 5.74 2.71
2.39 0.59 5.07 3.24
2.73 0.61 5.71 3.29
1.81 0.77 19.81 4.05
3.35 1.30 5.60 4.90
4.65 1.63 5.75 3.02
4.24 0.66 4.93 2.94
3.22 0.64 7.26 2.73
3.56 0.66 5.67 2.68
4.31 0.72 5.00 2.73
3.35 0.89 5.07 2.51
3.80 0.70 6.35 2.70
4.49 0.69 5.34 3.36
4.95 0.92 4.97 2.64
3.24 0.60 3.33 3.00
3.21 0.86 3.91 1.69
2.80 0.54 4.33 1.72
3.18 0.58 3.56 2.28
5.26 0.69 4.11 3.07
4.73 0.79 4.03 2.18
5.55 0.77 5.25 2.71
5.86 0.71 4.94 3.58
7.38 0.54 3.36 1.97
3.03 0.54 3.26 1.95
3.43 0.83 3.51 2.71
3.60 1.10 4.65 2.24
3.22 0.58 5.18 2.25
3.75 0.68 5.42 2.87
4.02 0.75 5.18 2.54
3.65 1.08 5.17 2.64
4.28 1.23 4.95 2.61
3.60 0.88 5.66 2.56
3.87 0.64 5.33 2.62
4.52 0.94 4.92 2.71
4.80 1.29 3.35 1.87
3.98 1.55 10.06 4.80
5.77 1.09 4.29 1.91
2.99 0.53 4.28 1.90
2.44 0.50 4.50 1.55
3.58 1.08 4.36 1.72
3.85 0.73 5.54 2.10
3.60 0.70 5.41 1.80
3.44 0.74 4.79 1.86
4.56 1.35 3.92 2.65
3.19 1.27 3.63 1.62
3.00 0.64 5.30 1.83
4.14 0.70 3.73 1.56
3.10 0.71 4.79 1.61
3.39 0.68 4.78 1.69
3.24 0.68 5.00 1.60
3.06 1.01 5.68 1.95
View hierarchy:
com.android.settings/com.android.settings.Settings/android.view.ViewRootImpl@c14a1ea
66 views, 65.23 kB of display lists
com.android.settings/com.android.settings.Settings$SystemDashboardActivity/android.view.ViewRootImpl@5d27f1f
106 views, 104.60 kB of display lists
com.android.settings/com.android.settings.SubSettings/android.view.ViewRootImpl@19c5232
110 views, 140.68 kB of display lists
Total ViewRootImpl: 3
Total Views: 282
Total DisplayList: 310.50 kB
>>>>>>>>>>>>>>>>>>
Draw: 表示在Java中创建显示列表部分中,OnDraw()方法占用的时间。
Process:表示渲染引擎执行显示列表所花的时间,view越多,时间就越长
Execute:表示把一帧数据发送到屏幕上排版显示实际花费的时间。
Draw + Process + Execute = 完整显示一帧 ,这个时间要小于16ms才能保存每秒60帧。