1 /*
2 * Trace Recorder for Tracealyzer v4.8.1
3 * Copyright 2023 Percepio AB
4 * www.percepio.com
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 *
8  * The configuration for trace streaming ("stream ports").
9 */
10 
11 #ifndef TRC_STREAM_PORT_CONFIG_H
12 #define TRC_STREAM_PORT_CONFIG_H
13 
14 #if (TRC_USE_TRACEALYZER_RECORDER == 1)
15 
16 #if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
17 
18 #include <trcTypes.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /* Type flags */
25 #define TRC_STREAM_PORT_RINGBUFFER_MODE_STOP_WHEN_FULL		(0U)
26 #define TRC_STREAM_PORT_RINGBUFFER_MODE_OVERWRITE_WHEN_FULL	(1U)
27 
28 /**
29  * @def TRC_CFG_STREAM_PORT_BUFFER_SIZE
30  *
31  * @brief Defines the size of the ring buffer use for storing trace events.
32  */
33 #define TRC_CFG_STREAM_PORT_BUFFER_SIZE 10240
34 
35 /**
36  * @def TRC_CFG_STREAM_PORT_BUFFER_MODE
37  *
38  * @brief Configures the behavior of the ring buffer when full.
39  *
40  * With TRC_CFG_STREAM_PORT_MODE set to TRC_STREAM_PORT_RINGBUFFER_MODE_OVERWRITE_WHEN_FULL, the
41  * events are stored in a ring buffer, i.e., where the oldest events are
42  * overwritten when the buffer becomes full. This allows you to get the last
43  * events leading up to an interesting state, e.g., an error, without having
44  * to store the whole run since startup.
45  *
46  * When TRC_CFG_STREAM_PORT_MODE is TRC_STREAM_PORT_RINGBUFFER_MODE_STOP_WHEN_FULL, the
47  * recording is stopped when the buffer becomes full. This is useful for
48  * recording events following a specific state, e.g., the startup sequence.
49  */
50 #define TRC_CFG_STREAM_PORT_RINGBUFFER_MODE TRC_STREAM_PORT_RINGBUFFER_MODE_OVERWRITE_WHEN_FULL
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif /*(TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)*/
57 
58 #endif /*(TRC_USE_TRACEALYZER_RECORDER == 1)*/
59 
60 #endif /* TRC_STREAM_PORT_CONFIG_H */
61