本讲是android camera性能分析专题的第40讲,我们介perfetto 自动化之常用sql查询语句。
更多资源:
资源 | 描述 |
---|---|
在线课程 | |
知识星球 | 星球名称:深入浅出android camera 星球id: 17296815 |
极客笔记圈 |
条件查询时,忽略大小写
条件查询时,忽略大小写
select * from slice where lower(name) like "�m%" limit 50
trace最开始的5秒,每个进程的cpu time
select process.name, sum(sched.dur)/1e9 as cpu_sec
from sched
join thread using(utid)
join process using(upid)
where ts <= (select ts 5000000000 from sched order by ts limit 1)
group by upid
order by cpu_sec desc
limit 100;
统计处理camera capturerequest的帧率
统计处理camera capturerequest的帧率
select count(*)/((max(ts) - min(ts))/1e9) as request_fps
from slice
where name='frame capture'
输出:
统计某路camera stream的帧率(以预览为例)
统计某路camera stream的帧率(以预览为例)
select count(*)/((max(ts) - min(ts))/1e9) as fps
from slice
join thread_track on slice.track_id = thread_track.id
join thread using(utid)
where slice.name like '%queuebuffer%' and thread.name like '%previewspacer%'
输出:
统计某路camera stream相邻两帧的时间间隔,用于衡量抖动(以预览为例)
统计某路camera stream相邻两帧的时间间隔,用于衡量抖动(以预览为例) –
select ((slice.ts) - lag(slice.ts,1) over (order by (slice.ts) asc))/1e6 as diff_ms
from slice
join thread_track on slice.track_id = thread_track.id
join thread using(utid)
where slice.name like '%queuebuffer%' and thread.name like '%previewspacer%'
limit -1 offset 1 --limit设置为-1表示选择所有剩余行,offset为1表示跳过第一行
输出: