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);