执行如下SQL语句,可以查看从trace开始 + 5秒的各进程在各CPU上的CPU Time统计,如果想统计更长/更短时间段,可以修改ts+5000000000
SELECT process.name as process, cpu, sum(dur) / 1e9 as cpu_sec FROM sched inner JOIN thread using(utid) inner JOIN process using(upid) WHERE ts <= (SELECT ts+5000000000 FROM sched ORDER BY ts limit 1) GROUP BY upid, cpu ORDER BY cpu_sec DESC;
建议要将CPU 定频定核进行对比
示例输出: