perfetto parameters are confused

52 views
Skip to first unread message

qiu

unread,
Mar 10, 2025, 4:35:16 AMMar 10
to Perfetto Development - www.perfetto.dev
Hello, I only configure the surfaceflinger layer property will grab the windowmanger and other information on the root. I want to know the reason

Lalit Maganti

unread,
Mar 10, 2025, 5:50:26 AMMar 10
to qiu, Perfetto Development - www.perfetto.dev
Please provide your full trace config. It's very difficult to help without it. 

On Mon, 10 Mar 2025, 08:35 qiu, <qiu4...@gmail.com> wrote:
Hello, I only configure the surfaceflinger layer property will grab the windowmanger and other information on the root. I want to know the reason

--
You received this message because you are subscribed to the Google Groups "Perfetto Development - www.perfetto.dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to perfetto-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/perfetto-dev/a027080c-8683-4317-ae47-aeab7edb7cbcn%40googlegroups.com.

qiu

unread,
Mar 10, 2025, 7:45:53 AMMar 10
to Perfetto Development - www.perfetto.dev
write_into_file: true flush_period_ms: 30000 notify_traceur: true incremental_state_config { clear_period_ms: 15000 } file_write_period_ms: 1000 buffers { size_kb: 63488 fill_policy: RING_BUFFER } buffers { size_kb: 2048 fill_policy: RING_BUFFER } data_sources: { config { name: "android.surfaceflinger.layers" target_buffer: 1 surfaceflinger_layers_config { mode: MODE_ACTIVE trace_flags: TRACE_FLAG_INPUT trace_flags: TRACE_FLAG_COMPOSITION trace_flags: TRACE_FLAG_HWC trace_flags: TRACE_FLAG_BUFFERS trace_flags: TRACE_FLAG_VIRTUAL_DISPLAYS } } } duration_ms: 0

Lalit Maganti

unread,
Mar 10, 2025, 8:04:13 AMMar 10
to qiu, Perfetto Development - www.perfetto.dev
Are you sure this is your full config? You should be getting wm tracing if this is the config. 

How are you collecting the trace? Through the on device tracing app? Because otherwise the presence of traceur is very strange. 

qiu

unread,
Mar 10, 2025, 10:22:19 PMMar 10
to Perfetto Development - www.perfetto.dev
But why do I get wm information if I add traceur

Lalit Maganti

unread,
Mar 11, 2025, 5:23:34 AMMar 11
to qiu, Perfetto Development - www.perfetto.dev
Honestly I don't know. It would be quite strange for Perfetto to give information you are not asking for. 

I only asked about traceur because I have my doubts of the config you are using. How you are collecting the trace may help figure out if someone is adding extra data sources etc. 

qiu

unread,
Mar 12, 2025, 8:04:34 AMMar 12
to Perfetto Development - www.perfetto.dev
This problem will only occur on root, user will not be able to capture wm information file; But I went to check the source code of traceur and found that there was no wm logic to capture the operation. Do you have any clue, this has troubled me for a long time

Lalit Maganti

unread,
Mar 12, 2025, 8:06:30 AMMar 12
to qiu, Perfetto Development - www.perfetto.dev
No clue I'm afraid. This is a very mysterious issue. I'm still not convinced that what you've pasted is the full config honestly. 

qiu

unread,
Mar 26, 2025, 2:29:33 AMMar 26
to Perfetto Development - www.perfetto.dev
I have found the reason is that the packages/apps/Traceur/src_common/com/android/Traceur/PerfettoUtils in Java tracestart method were used in the two buffer contributed to grab the ftrace. I tried to grab the layer with only one buffer, but the actual effect is that the grab failed, which is not allowed. What should I do to grab only the layer, the source code is as follows:// Allots 1 / BUFFER_SIZE_RATIO to the small buffer and the remainder to the large buffer,
// (less the size of the buffer reserved for unchanging system information).
int totalBufferSizeKb = numCpus * bufferSizeKb - SYSTEM_INFO_BUFFER_SIZE_KB;
int targetBuffer1Kb = totalBufferSizeKb / BUFFER_SIZE_RATIO;
int targetBuffer0Kb = totalBufferSizeKb - targetBuffer1Kb;

// This is target_buffer: 0, which is used for ftrace and the ftrace-derived
// android.gpu.memory.
appendTraceBuffer(config, targetBuffer0Kb);

// This is target_buffer: 1, which is used for additional data sources.
appendTraceBuffer(config, targetBuffer1Kb);

// This is target_buffer: 2, used for unchanging system information like the packages
// list.
appendTraceBuffer(config, SYSTEM_INFO_BUFFER_SIZE_KB);
Reply all
Reply to author
Forward
0 new messages