qiu
unread,Mar 28, 2025, 3:29:06 AMMar 28Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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);