CPU sched
使用Perfconv抓取
请参考perfconv抓取fpsgo以及schedule相关tag
使用systrace抓取
kernel-5.10
频率和摆核信息都抓取:
sched_migrate_task sugov_ext_util sched_task_uclamp sched_select_task_rq sched_queue_task sched_frequency_limits sched_find_energy_efficient_cpu sched_big_task_rotation sched_force_migrate sched_waking irq
只抓摆核的
sched_select_task_rq sched_force_migrate sched_migrate_task sched_queue_task
只抓调频的
sugov_ext_util sched_frequency_limits freq_qos_user_setting sched_queue_task
比如在您的脚本里这样设置:
adb shell "echo 1 > /sys/kernel/tracing/events/sched/sched_blocked_reason/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/sched/sched_migrate_task/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/scheduler/sched_task_uclamp/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/scheduler/sugov_ext_util/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/sched/sched_waking/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/scheduler/sched_select_task_rq/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/scheduler/sched_find_energy_efficient_cpu/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/scheduler/sched_big_task_rotation/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/scheduler/sched_force_migrate/enable"
kernel-4.14
sched 需要打开的 event:
sched_switch sched_wakeup sched_find_best_target sched_select_task_rq schedutil_uclamp_util sched_boost_cpu sched_boost_task cpu_frequency_limits cpu_frequency sched_hmp_migrate sched_util
IRQ 需要打开的 event:
/sys/kernel/tracing/events/scheduler/irq
irq_handler_entry
irq_handler_exit
work queue 需要打开的 event:
/sys/kernel/tracing/events/workqueue/
workqueue_execute_start
workqueue_execute_end
workqueue_queue_work
workqueue_activate_work
fpsgo
使用Perfconv抓取
请参考perfconv抓取fpsgo以及schedule相关tag
使用systrace抓取
请打开:
adb shell "echo 63 > /sys/kernel/fpsgo/common/systrace_mask" // this for fpsgo
adb shell “echo 1 > /sys/kernel/fpsgo/xgf/xgf_trace_enable”
adb shell “echo 1 > /sys/kernel/fpsgo/xgf/xgf_log_trace_enable”
CPU频率
如果发现CPU频率缺失,检查如下trace event有没有打开
/sys/kernel/tracing/events/power/cpu_frequency_limits/
cpu_frequency_limits
cpu_frequency
cpu_idle
DDR频率
需要打开的 systrace event:
adb shell "echo 1 > /sys/devices/system/cpu/perf/enable"
kernel-V4.1*版本: adb shell "echo 1 > /sys/kernel/tracing/events/mtk_events/perf_index_s/enable"
kernel-V5.10版本: adb shell "echo 1 > /sys/kernel/tracing/events/perf_tracker/perf_index_s/enable"
GPU频率
需要打开的 systrace event:
adb shell "echo 1 > /sys/module/ged/parameters/ged_log_perf_trace_enable" // these for GPU
adb shell "echo 1 > /sys/devices/system/cpu/perf/enable"
adb shell "echo 1 > /sys/module/ged/parameters/ged_log_trace_enable"
adb shell "echo 1 > /sys/kernel/tracing/events/mtk_events/perf_index_gpu/enable"
adb shell "echo 1 > /sys/kernel/tracing/events/perf_tracker/perf_index_gpu/enable"
生成systrace log:
mtkPowerMsgHdl-762 ( 700) [005] ...1 37118.430645: tracing_mark_write: C|5566|gpu_freq|431|0|0
mtkPowerMsgHdl-762 ( 700) [005] ...1 37118.430645: tracing_mark_write: C|5566|gpu_freq_max|886|0|0
Memory用量
需要打开的 systrace event:
adb shell "echo 1 > /sys/devices/system/cpu/perf/enable"
kernel-V4.1*版本: adb shell "echo 1 > /sys/kernel/tracing/events/mtk_events/perf_index_l/enable"
kernel-V5.10版本: adb shell "echo 1 > /sys/kernel/tracing/events/perf_tracker/perf_index_l/enable"
生成systrace log:
<idle>-0 (-----) [002] d.h1 2173.342581: perf_index_l: free_mem=853360 avail_mem=5227104 iostats=0|0|0|0|0|0|0|0|0|7992616|0 stall=3|0|0|0|0|0|0|0
常用场景systrace tag推荐
CPU的信息,最好都带上
sched、freq、idle
app launch/switch(打开app,进入某个界面)
gfx、view、input、res、am、wm
或者参考perfconv抓取fpsgo以及schedule相关tag
测试列表、桌面滑动等流畅性问题场景
gfx、view、input
例如:gfx input view webview wm am sm audio video hal res dalvik bionic power pm ss pdx sched freq idle load binder_driver binder_lock
或者参考perfconv抓取fpsgo以及schedule相关tag
响应时间
gfx、view、input
或者参考perfconv抓取fpsgo以及schedule相关tag
安装时间
gfx input view webview wm am sm audio video hal res dalvik bionic power pm ss pdx sched freq idle load memreclaim binder_driver binder_lock
Game场景
gfx input sched view webview wm am smvideo hal app res dalvik bionic power pm ss pdx sched freq idle load memreclaim binder_driver binder_lock
或者参考perfconv抓取fpsgo以及schedule相关tag
GC、IO卡顿
gfx、view、input、dalvik、disk
HWUI绘图相关
gfx、view、input、hwui
power (亮灭屏、电量相关的问题)
gfx、view、input、res、am、wm、power