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

config PERCEPIO_RTOS
	bool
	default y
	select PERCEPIO_TRC_CFG_RECORDER_RTOS_FREERTOS

menu "Recorder Common"
# FreeRTOS supports classic snapshot and streaming
choice PERCEPIO_TRC_CFG_RECORDER_MODE
    prompt "Tracing Mode"
    default PERCEPIO_TRC_RECORDER_MODE_STREAMING
    help
      Trace recorder operates in snapshot or streaming mode.
    
config PERCEPIO_TRC_RECORDER_MODE_SNAPSHOT
	bool "Snapshot recorder mode"

config PERCEPIO_TRC_RECORDER_MODE_STREAMING
	bool "Streaming recorder mode"
endchoice

rsource "../../../config/Kconfig"
endmenu # "Recorder Common"

menu "Recorder FreeRTOS"
choice PERCEPIO_TRC_CFG_FREERTOS_VERSION
    prompt "FreeRTOS Version"
    default PERCEPIO_TRC_FREERTOS_VERSION_10_4_1

config PERCEPIO_TRC_FREERTOS_VERSION_7_3_X
	bool "7_3_X"

config PERCEPIO_TRC_FREERTOS_VERSION_7_4_X
	bool "7_4_X"

config PERCEPIO_TRC_FREERTOS_VERSION_7_5_X
	bool "7_5_X"

config PERCEPIO_TRC_FREERTOS_VERSION_7_6_X
	bool "7_6_X"

config PERCEPIO_TRC_FREERTOS_VERSION_8_X_X
	bool "8_X_X"

config PERCEPIO_TRC_FREERTOS_VERSION_9_0_0
	bool "9_0_0"

config PERCEPIO_TRC_FREERTOS_VERSION_9_0_1
	bool "9_0_1"

config PERCEPIO_TRC_FREERTOS_VERSION_9_0_2
	bool "9_0_2"

config PERCEPIO_TRC_FREERTOS_VERSION_10_0_0
	bool "10_0_0"

config PERCEPIO_TRC_FREERTOS_VERSION_10_0_1
	bool "10_0_1"

config PERCEPIO_TRC_FREERTOS_VERSION_10_1_0
	bool "10_1_0"

config PERCEPIO_TRC_FREERTOS_VERSION_10_1_1
	bool "10_1_1"

config PERCEPIO_TRC_FREERTOS_VERSION_10_2_0
	bool "10_2_0"

config PERCEPIO_TRC_FREERTOS_VERSION_10_2_1
	bool "10_2_1"

config PERCEPIO_TRC_FREERTOS_VERSION_10_3_0
	bool "10_3_0"

config PERCEPIO_TRC_FREERTOS_VERSION_10_3_1
	bool "10_3_1"

config PERCEPIO_TRC_FREERTOS_VERSION_10_4_0
	bool "10_4_0"

config PERCEPIO_TRC_FREERTOS_VERSION_10_4_1
	bool "10_4_1"
endchoice

choice PERCEPIO_TRC_CFG_HARDWARE_PORT
    prompt "Hardware Port"
    default PERCEPIO_TRC_HARDWARE_PORT_ARM_Cortex_M

config PERCEPIO_TRC_HARDWARE_PORT_Win32
	bool "Win32"

config PERCEPIO_TRC_HARDWARE_PORT_Atmel_AT91SAM7
	bool "Atmel AT91SAM7"

config PERCEPIO_TRC_HARDWARE_PORT_Atmel_UC3A0
	bool "Atmel UC3A0"

config PERCEPIO_TRC_HARDWARE_PORT_ARM_Cortex_M
	bool "Cortex M"

config PERCEPIO_TRC_HARDWARE_PORT_ARM_CORTEX_A9
	bool "Cortex A9"

config PERCEPIO_TRC_HARDWARE_PORT_Renesas_RX600
	bool "Renesas RX600"

config PERCEPIO_TRC_HARDWARE_PORT_MICROCHIP_PIC24_PIC32
	bool "Microchip PIC24/PIC32"

config PERCEPIO_TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_TMS570_RM48
	bool "TI TMS570 RM48"

config PERCEPIO_TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_MSP430
	bool "TI MSP430"

config PERCEPIO_TRC_HARDWARE_PORT_XILINX_PPC405
	bool "Xilinx PPC405"

config PERCEPIO_TRC_HARDWARE_PORT_XILINX_PPC440
	bool "Xilinx PPC440"

config PERCEPIO_TRC_HARDWARE_PORT_XILINX_MICROBLAZE
	bool "Xilinx Microblaze"

config PERCEPIO_TRC_HARDWARE_PORT_XILINX_ZyncUltraScaleR5
	bool "Xilinx Zync Ultra Scale R5"

config PERCEPIO_TRC_HARDWARE_PORT_NXP_LPC210X
	bool "NXP LPC210X"

config PERCEPIO_TRC_HARDWARE_PORT_Altera_NiosII
	bool "Altera Nios II"
endchoice


menu "Coverage"
config PERCEPIO_TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS
    bool "Trace Event Group Events"
    depends on !PERCEPIO_TRC_CFG_SCHEDULING_ONLY
    default n
    help
      If this is disabled, the trace will exclude any "event group" events.
    
config PERCEPIO_TRC_CFG_INCLUDE_TIMER_EVENTS
    bool "Trace Timer Events"
    depends on !PERCEPIO_TRC_CFG_SCHEDULING_ONLY
    default n
    help
      If this is disabled, the trace will exclude any Timer events.

config PERCEPIO_TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS
    bool "Trace Pend Function Events"
    depends on !PERCEPIO_TRC_CFG_SCHEDULING_ONLY
    default n
    help
      If this is disabled, the trace will exclude any "pending function call"
      events, such as xTimerPendFunctionCall().
    
config PERCEPIO_TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS
    bool "Trace Stream Buffer Events"
    depends on !PERCEPIO_TRC_CFG_SCHEDULING_ONLY
    default n
    help
      If this is disabled, the trace will exclude any stream buffer or message
      buffer events.
endmenu


if PERCEPIO_TRC_RECORDER_MODE_SNAPSHOT

menu "Snapshot Config"
config PERCEPIO_TRC_CFG_NTASK
	int "Number of Tasks"
	range 1 2048
	default 15
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.
	
config PERCEPIO_TRC_CFG_NISR
	int "Number of ISR"
	range 1 2048
	default 5
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.
	
config PERCEPIO_TRC_CFG_NQUEUE
	int "Number of Queues"
	range 1 2048
	default 10
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.
	
config PERCEPIO_TRC_CFG_NSEMAPHORE
	int "Number of Semaphores"
	range 1 2048
	default 10
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.
	
config PERCEPIO_TRC_CFG_NMUTEX
	int "Number of Mutex"
	range 1 2048
	default 10
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.
	
config PERCEPIO_TRC_CFG_NTIMER
	int "Number of Timers"
	range 1 2048
	default 5
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.
	
config PERCEPIO_TRC_CFG_NEVENTGROUP
	int "Number of Event Groups"
	range 1 2048
	default 5
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.

config PERCEPIO_TRC_CFG_NSTREAMBUFFER
	int "Number of Stream Buffers"
	range 1 2048
	default 5
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.
	
config PERCEPIO_TRC_CFG_NMESSAGEBUFFER
	int "Number of Message Buffers"
	range 1 2048
	default 5
	help
	  These define the capacity of the Object Property Table, i.e., the maximum
	  number of objects active at any given point, within each object class (e.g.,
	  task, queue, semaphore, ...).
	  
	  If tasks or other objects are deleted in your system, this
	  setting does not limit the total amount of objects created, only the number
	  of objects that have been successfully created but not yet deleted.
	  
	  Using too small values will cause vTraceError to be called, which stores an
	  error message in the trace that is shown when opening the trace file. The
	  error message can also be retrieved using xTraceGetLastError.
	  
	  It can be wise to start with large values for these constants,
	  unless you are very confident on these numbers. Then do a recording and
	  check the actual usage by selecting View menu -> Trace Details ->
	  Resource Usage -> Object Table.

config PERCEPIO_TRC_CFG_NAME_LEN_TASK
	int "Name Length Task"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
	
config PERCEPIO_TRC_CFG_NAME_LEN_ISR
	int "Name Length ISR"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
	
config PERCEPIO_TRC_CFG_NAME_LEN_QUEUE
	int "Name Length Queue"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
	
config PERCEPIO_TRC_CFG_NAME_LEN_SEMAPHORE
	int "Name Length Semaphore"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
	
config PERCEPIO_TRC_CFG_NAME_LEN_MUTEX
	int "Name Length Mutex"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
	
config PERCEPIO_TRC_CFG_NAME_LEN_TIMER
	int "Name Length Timer"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
	
config PERCEPIO_TRC_CFG_NAME_LEN_EVENTGROUP
	int "Name Length Event Group"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
	
config PERCEPIO_TRC_CFG_NAME_LEN_STREAMBUFFER
	int "Name Length Stream Buffer"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
	
config PERCEPIO_TRC_CFG_NAME_LEN_MESSAGEBUFFER
	int "Name Length Message Buffer"
	range 1 512
	default 15
	help
	  Macros that specify the maximum lengths (number of characters) for names of
	  kernel objects, such as tasks and queues. If longer names are used, they will
	  be truncated when stored in the recorder.
endmenu # "Snapshot Config"

endif # PERCEPIO_TRC_RECORDER_MODE_SNAPSHOT

if PERCEPIO_TRC_RECORDER_MODE_STREAMING
endif # PERCEPIO_TRC_RECORDER_MODE_STREAMING
endmenu # "Recorder FreeRTOS"
