Comments (5)
Couple of notes:
- The slices correspond to the time the process was running. This allows you to pinpoint exactly on which CPU the process was running
- CPU utilization is a terrible metric on Android because it doesn't take into account frequency, idle state, throttling, core type etc so gives a very inaccurate perspective of how much work the process is doing
If you insist on using CPU utilization, you can do something like this to get a utilization every 1ms:
INCLUDE PERFETTO MODULE common.timestamps;
DROP TABLE IF EXISTS win;
CREATE VIRTUAL TABLE win USING window;
UPDATE win SET window_start=TRACE_START(), window_dur=TRACE_DUR(), quantum=1e6;
CREATE OR REPLACE PERFETTO VIEW system_server_sched AS
SELECT ts, dur, utid, sched.id AS sched_id
FROM sched
JOIN thread USING (utid)
JOIN process USING (upid)
WHERE process.name = 'system_server';
DROP TABLE IF EXISTS sys_server_util;
CREATE VIRTUAL TABLE sys_server_util USING SPAN_LEFT_JOIN(win, system_server_sched PARTITIONED utid);
SELECT SUM(IIF(sched_id IS NOT NULL, dur, 0)) / 1e6 AS utilization, quantum_ts AS millisecond_since_start
FROM sys_server_util
GROUP BY 2;
from perfetto.
Thanks, Is this sql command runnable in sqlite3? when I paste it in sqlite3 and run, report below error:
Runtime error: no such module: window
from perfetto.
No. This is a PerfettoSQL query which can only be executed by the trace processor.
from perfetto.
Try trace_process with below command:
.\trace_processor_shell.exe -q .\sql.txt .\boottrace.perfetto-trace [638.424] oto_trace_reader.cc:254 It is strongly recommended to have flush_period_ms set when write_into_file is turned on. This trace will be loaded fully into memory before sorting which increases the likelihood of OOMs.
[640.325] processor_shell.cc:1627 Trace loaded: 79.69 MB in 1.90s (41.9 MB/s)
Traceback (most recent call last):
File "stdin" line 3 col 29
UPDATE win SET window_start=TRACE_START(), window_dur=TRACE_DUR(), quantum=1e6
^
no such function: TRACE_START
Is this the proper way? or need some special config file to capture trace?
from perfetto.
Sorry I was prototyping this query in the UI: I was missing the line:
INCLUDE PERFETTO MODULE common.timestamps;
at the start of the query.
from perfetto.
Related Issues (20)
- Is there a way to assign names to threads instead of just the thread id? HOT 3
- [BUG] Perfetto_SQL sample can't work HOT 1
- Misc Global Tracks => Screenshots track is always shown HOT 4
- Interested in Bazel for JS? HOT 3
- query uninterruptible sleep state with python sql HOT 1
- "CPU by Thread" view does not include information (eg. thread_state etc.) associated with CPU0 HOT 1
- convert android command line parameters to config file HOT 5
- show memory used per app UI HOT 7
- About the bug in base_slice_track in Perfetto UI HOT 1
- request feature to show diskIO graph just similar to bootchart HOT 2
- Could Debug Tracks support nominal color? HOT 2
- sched_wakeup & sched_waking events are missing in lastet UI after loading from JSON result(converted from origin trace_file.perfetto-trace) HOT 1
- Can I jump to some timestamp directly? HOT 2
- How to collect track event data of a specified process? HOT 1
- cpu freq captured time not the same between golden and silver core HOT 1
- Perfetto v40.0's Jump link invalid HOT 3
- Using ftrace counters significantly slows down UI in Safari 17.1 HOT 5
- Need help for sql syntax(Can't sum float value)
- Can't see my trace event in In System mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perfetto.