Use dedicated trace buffer for ftrace events

ftrace events are typically of high data volume and is likely to cause
data loss of other data sources sharing the same trace buffer. Use a
dedicated trace buffer for ftrace events to avoid swamping the buffer
and causing data loss.

Bug: b:385665178
Test: run with CUJ that loads 20 pages and verify no data loss of
`performance.mark()` slices

Change-Id: I240bd61015a6bc4e70de7d677fa546a0e6ca5a9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/web-tests/+/6109725
Reviewed-by: Charles Dick <cwd@google.com>
Reviewed-by: Sangwhan Moon <sxm@google.com>
Reviewed-by: Darren Wu <darrenwu@chromium.org>
diff --git a/cuj/crossbench/templates/probe-config.hjson b/cuj/crossbench/templates/probe-config.hjson
index 076c92e..6ce8628 100644
--- a/cuj/crossbench/templates/probe-config.hjson
+++ b/cuj/crossbench/templates/probe-config.hjson
@@ -29,6 +29,13 @@
           size_kb: 40960
           fill_policy: RING_BUFFER
         }
+        # Buffer dedicated for linux.ftrace. It's OK that the trace data is
+        # overwritten. If there are ftrace events that are of interest, use
+        # another dedicated buffer or increase this the size of this buffer.
+        buffers {
+          size_kb: 40960
+          fill_policy: RING_BUFFER
+        }
         data_sources {
           config {
           name: "android.packages_list"
@@ -85,7 +92,7 @@
         data_sources: {
           config {
             name: "linux.ftrace"
-            target_buffer: 4
+            target_buffer: 5
             ftrace_config {
               ftrace_events: "mm_event/mm_event_record"
               ftrace_events: "kmem/rss_stat"