# Copyright (c) 2021 Percepio AB
# SPDX-License-Identifier: Apache-2.0

menu "Ring Buffer Config"
config PERCEPIO_TRC_CFG_STREAM_PORT_RINGBUFFER_SIZE
	int "Buffer size"
	default 10240
	range 0 10485760
	help
	  Defines the size of the ring buffer use for storing trace events.

choice PERCEPIO_TRC_CFG_STREAM_PORT_RINGBUFFER_MODE
	prompt "Ring Buffer Mode"
	default PERCEPIO_TRC_STREAM_PORT_RINGBUFFER_MODE_OVERWRITE_WHEN_FULL
	help
	  With PERCEPIO_TRC_CFG_STREAM_PORT_RINGBUFFER_MODE set to PERCEPIO_TRC_STREAM_PORT_RINGBUFFER_MODE_OVERWRITE_WHEN_FULL, the
	  events are stored in a ring buffer, i.e., where the oldest events are
	  overwritten when the buffer becomes full. This allows you to get the last
	  events leading up to an interesting state, e.g., an error, without having
	  to store the whole run since startup.
	  
	  When PERCEPIO_TRC_CFG_STREAM_PORT_RINGBUFFER_MODE is PERCEPIO_TRC_STREAM_PORT_RINGBUFFER_MODE_STOP_WHEN_FULL, the
	  recording is stopped when the buffer becomes full. This is useful for
	  recording events following a specific state, e.g., the startup sequence.

config PERCEPIO_TRC_STREAM_PORT_RINGBUFFER_MODE_OVERWRITE_WHEN_FULL
	bool "Overwrite when full"

config PERCEPIO_TRC_STREAM_PORT_RINGBUFFER_MODE_STOP_WHEN_FULL
	bool "Stop when full"
endchoice
endmenu # "Ring Buffer Config"
