perfetto source code confusion

18 views
Skip to first unread message

qiu

unread,
Mar 28, 2025, 3:29:06 AMMar 28
to Perfetto Development - www.perfetto.dev
On the root version, when I use perfetto to fetch sufaceflinger's layer information, I occasionally grab information such as ftrace. This is because I use the/apps/Traceur src_common/com/android/Traceur PerfettoUtils folder used two buffer, 0 buffer is used to grab ftrace, If buffer 0 is not set on the application side, files with layer information cannot be captured. How do I mask ftrace files on the root version?
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);

Kirill Timofeev

unread,
Mar 28, 2025, 10:23:18 AMMar 28
to qiu, Ryan Savitski, Perfetto Development - www.perfetto.dev
+Ryan Savitski 
Could you please take a look?

--
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/419af25d-6d42-4656-a9bb-779ee20b6397n%40googlegroups.com.

Ryan Savitski

unread,
Mar 28, 2025, 2:18:42 PMMar 28
to qiu, Perfetto Development - www.perfetto.dev, Kirill Timofeev
Thank you for the message but I do not understand your problem. You can collect traces via "adb shell" without any involvement from the Traceur app. See the documentation here: https://perfetto.dev/docs/quickstart/android-tracing

Additionally, here is the documentation on buffer mapping: https://perfetto.dev/docs/concepts/config.
Reply all
Reply to author
Forward
0 new messages