1# Copyright (c) 2023 Percepio AB
2# SPDX-License-Identifier: Apache-2.0
3
4menu "File Config"
5config PERCEPIO_TRC_CFG_STREAM_PORT_TRACE_FILE
6	string "Trace file path"
7	default "./trace.psf"
8	help
9	  Path to where the Tracealyzer trace file should be stored (.psf).
10
11config PERCEPIO_TRC_CFG_STREAM_PORT_USE_INTERNAL_BUFFER
12	bool "Use internal buffer"
13	default n
14
15if PERCEPIO_TRC_CFG_STREAM_PORT_USE_INTERNAL_BUFFER
16config PERCEPIO_TRC_CFG_STREAM_PORT_INTERNAL_BUFFER_SIZE
17	int "Internal buffer size"
18	range 32 10485760
19	default 10240
20
21choice PERCEPIO_TRC_CFG_STREAM_PORT_INTERNAL_BUFFER_TRANSFER_MODE
22	prompt "Internal buffer transfer mode"
23	default PERCEPIO_TRC_INTERNAL_EVENT_BUFFER_OPTION_TRANSFER_MODE_ALL
24
25config PERCEPIO_TRC_INTERNAL_EVENT_BUFFER_OPTION_TRANSFER_MODE_ALL
26	bool "Transfer all"
27
28config PERCEPIO_TRC_INTERNAL_EVENT_BUFFER_OPTION_TRANSFER_MODE_CHUNK
29	bool "Transfer chunks"
30endchoice
31
32if PERCEPIO_TRC_INTERNAL_EVENT_BUFFER_OPTION_TRANSFER_MODE_CHUNK
33config PERCEPIO_TRC_CFG_STREAM_PORT_INTERNAL_BUFFER_CHUNK_SIZE
34	int "Chunk size"
35	range 4 10485760
36	default 4096
37
38config PERCEPIO_TRC_CFG_STREAM_PORT_INTERNAL_BUFFER_CHUNK_TRANSFER_AGAIN_SIZE_LIMIT
39	int "Transfer size limit for immediate re-transfer"
40	range 4 10485760
41	default 1024
42	help
43	  Defines the number of transferred bytes needed to trigger another immediate transfer.
44	  This will increase throughput by immediately doing a transfer and not wait for another xTraceTzCtrl() loop.
45
46config PERCEPIO_TRC_CFG_STREAM_PORT_INTERNAL_BUFFER_CHUNK_TRANSFER_AGAIN_COUNT_LIMIT
47	int "Immediate re-transfer count limit"
48	range 1 20
49	default 5
50	help
51	  Defines the maximum number of times to trigger another immediate transfer before returning to xTraceTzCtrl().
52	  This will increase throughput by immediately doing a transfer and not wait for another xTraceTzCtrl() loop.
53endif # PERCEPIO_TRC_INTERNAL_EVENT_BUFFER_OPTION_TRANSFER_MODE_CHUNK
54endif #PERCEPIO_TRC_CFG_STREAM_PORT_USE_INTERNAL_BUFFER
55
56endmenu # "File Config"
57