通过perf分析sched事件,通过分析这些事件来分析调度延迟,
perf record -e sched:* -p PID
sched事件分析:
sched_kthread_stop/sched_kthread_stop_ret
kthread_stop事件的统计,提供内核线程的名字、线程PID、停止的时间戳、可能还包含停止这个线程的原因等附加信息
sched_waking
comm=fc_vcpu0 pid=3946554 prio=120 target_cpu=056
sched_wakeup
comm=fc_vcpu0 pid=3946554 prio=120 target_cpu=056
sched_wakeup_new
comm=client_handler pid=1654272 prio=120 target_cpu=073
sched_switch
prev_comm=fc_vcpu0 prev_pid=3946554 prev_prio=120 prev_state=S ==> next_comm=swapper/56 next_pid=0 next_prio=120
sched_migrate_task
comm=DadiClient pid=32899 prio=120 orig_cpu=18 dest_cpu=69
sched_process_free
sched_process_exit
comm=client_handler pid=1654227 prio=120
sched_wait_task
sched_process_wait
sched_process_fork
comm=client_handler pid=1654271 child_comm=client_handler child_pid=1654272
sched_process_exec
sched_stat_wait
comm=vmm_master pid=3946527 delay=75936242 [ns]
sched_stat_sleep
comm=ksoftirqd/25 pid=138 delay=1255042885684 [ns]
sched_stat_iowait
sched_stat_blocked
comm=kworker/48:2 pid=1303002 delay=8986115650 [ns]