# Example config for a long trace periodically flushed into the
# target file. See docs/long-traces.md for more.

# Enable periodic flushing of the trace buffer into the output file.
write_into_file: true

# Max duration: 30 mins.
duration_ms: 1800000

# Writes the userspace buffer into the file every 2.5 seconds.
file_write_period_ms: 2500

# Commits the trace from the shared memory buffer to the central buffer
# periodically. Otherwise, the --full-sort option will be required for
# trace_processor_shell and traceconv when importing the trace.
flush_period_ms: 20000

# The trace buffers needs to be big enough to hold |file_write_period_ms| of
# trace data. The trace buffer sizing depends on the number of trace categories
# enabled and the device activity. A good rule of thumb is ~10-20 MB per second,
# so if |file_write_period_ms| ~ 3s -> 30 MB.
buffers {
  size_kb: 32768
  fill_policy: RING_BUFFER
}

# Enable various data sources as usual.
data_sources {
  config {
    name: "linux.ftrace"
    target_buffer: 0
    ftrace_config {
      # These parameters affect only the kernel trace buffer size and how
      # frequently it gets moved into the userspace buffer defined above.
      buffer_size_kb: 16384
      drain_period_ms: 250
      ftrace_events: "cpu_frequency"
      ftrace_events: "cpu_idle"
      ftrace_events: "sched_process_exec"
      ftrace_events: "sched_process_exit"
      ftrace_events: "sched_process_fork"
      ftrace_events: "sched_process_free"
      ftrace_events: "sched_process_hang"
      ftrace_events: "sched_process_wait"
      ftrace_events: "sched_switch"
      ftrace_events: "sched_wakeup_new"
      ftrace_events: "sched_wakeup"
      ftrace_events: "sched_waking"
      ftrace_events: "task_newtask"
      ftrace_events: "task_rename"
      ftrace_events: "tracing_mark_write"
    }
  }
}

data_sources {
  config {
    name: "linux.process_stats"
    target_buffer: 0
  }
}
