Trace buffer debug module. More...
|
Defines | |
| #define | TRACE_HEADER_LEN 4 |
| Size of trace header (in 16bits words). | |
| #define | TRACE_MAX_PARAM 0xff |
| Maximum number of parameter in one trace entry. | |
| #define | TRACE_MAX_ID 0xffffff |
| Maximum ID of a trace entry. | |
| #define | TRACE_LEN(i) (((i) >> 8) + TRACE_HEADER_LEN) |
Return size (in 16bits words) of the trace entry whose first word is i. | |
| #define | TRACE_LAST_ENTRY 0xffff |
| Pattern to mark last trace entry. | |
| #define | TRACE_READY 0x1234 |
| Pattern to mark than trace buffer is ready. | |
| #define | TRACE_LOCKED 0xdead |
| Pattern to mark than trace buffer is being read or write. | |
| #define | TRACE(a,...) |
| Macro used to add a unfiltered trace point in the trace buffer. | |
| #define | TRACE_BUF(format, size, buf) |
| Macro used to add a unfiltered trace containing a dump of a buffer in the trace buffer. | |
| #define | TR_32(a) (uint16_t)((uint32_t)(a) >> 16), (uint16_t)((uint32_t)(a)) |
| Macro to trace a 32bits parameters. | |
| #define | TR_64(a) TR_32(((uint64_t)(a) >> 32)), TR_32(a) |
| Macro to trace a 64bits parameters. | |
| #define | TR_PTR(p) TR_32(p) |
| Macro to trace a pointer. | |
| #define | TR_MAC(m) ((uint16_t *)(m))[0], ((uint16_t *)(m))[1], ((uint16_t *)(m))[2] |
| Macro to trace a MAC address. | |
| #define | TR_IP4(m) TR_32(*((uint32_t *)m)) |
| Macro to trace a IPv4 address. | |
| #define | TR_IP6(m) |
| Macro to trace a IPv6 address. | |
| #define | _PTR_ALIGN(p) ((uint16_t *)((uint32_t)p & ~0x1)) |
| internal | |
| #define | TR_STR_8(s) |
| Macro to trace a string. | |
| #define | TRACE_FILT(compo, lvl,...) |
Acts like TRACE macro if bit lvl is set in trace level for compo. | |
| #define | TRACE_BUF_FILT(compo, lvl,...) |
Acts like TRACE_BUF macro if bit lvl is set in trace level for compo. | |
| #define | TRACE_COMPO(compo) NX_TRACE && TRACE_##compo##_EN |
| Macro defining whether a trace component should be compiled or not. | |
| #define | TRACE_KERNEL_DEFAULT |
| Default trace level for KERNEL component. | |
| #define | TRACE_KERNEL_EN 1 |
| Define whether to include or not KERNEL traces. | |
| #define | TRACE_KERNEL(lvl,...) TRACE_FILT(KERNEL, KERNEL_##lvl, __VA_ARGS__ ) |
| add trace point for KERNEL component | |
| #define | TRACE_BUF_KERNEL(lvl,...) TRACE_BUF_FILT(KERNEL, KERNEL_##lvl, __VA_ARGS__ ) |
| add buffer trace point for KERNEL component | |
| #define | TRACE_LMAC_DEFAULT (CO_BIT(TRACE_LVL_LMAC_ERR)) |
| Default trace level for LMAC component. | |
| #define | TRACE_LMAC_EN 1 |
| Define whether to include or not LMAC traces. | |
| #define | TRACE_LMAC(lvl,...) TRACE_FILT(LMAC, LMAC_##lvl, __VA_ARGS__ ) |
| add trace point for LMAC component | |
| #define | TRACE_BUF_LMAC(lvl,...) TRACE_BUF_FILT(LMAC, LMAC_##lvl, __VA_ARGS__ ) |
| add buffer trace point for LMAC component | |
| #define | TRACE_CHAN_DEFAULT |
| Default trace level for CHAN component. | |
| #define | TRACE_CHAN_EN 1 |
| Define whether to include or not CHAN traces. | |
| #define | TRACE_CHAN(lvl,...) TRACE_FILT(CHAN, CHAN_##lvl, __VA_ARGS__ ) |
| add trace point for CHAN component | |
| #define | TRACE_BUF_CHAN(lvl,...) TRACE_BUF_FILT(CHAN, CHAN_##lvl, __VA_ARGS__ ) |
| add buffer trace point for CHAN component | |
| #define | TRACE_STA_DEFAULT (CO_BIT(TRACE_LVL_STA_ERR)) |
| Default trace level for STA component. | |
| #define | TRACE_STA_EN 1 |
| Define whether to include or not STA traces. | |
| #define | TRACE_STA(lvl,...) TRACE_FILT(STA, STA_##lvl, __VA_ARGS__ ) |
| add trace point for STA component | |
| #define | TRACE_BUF_STA(lvl,...) TRACE_BUF_FILT(STA, STA_##lvl, __VA_ARGS__ ) |
| add buffer trace point for STA component | |
| #define | TRACE_AP_DEFAULT (CO_BIT(TRACE_LVL_AP_ERR)) |
| Default trace level for AP component. | |
| #define | TRACE_AP_EN 1 |
| Define whether to include or not AP traces. | |
| #define | TRACE_AP(lvl,...) TRACE_FILT(AP, AP_##lvl, __VA_ARGS__ ) |
| add trace point for AP component | |
| #define | TRACE_BUF_AP(lvl,...) TRACE_BUF_FILT(AP, AP_##lvl, __VA_ARGS__ ) |
| add buffer trace point for AP component | |
| #define | TRACE_P2P_DEFAULT (CO_BIT(TRACE_LVL_P2P_ERR)) |
| Default trace level for P2P component. | |
| #define | TRACE_P2P_EN 1 |
| Define whether to include or not P2P traces. | |
| #define | TRACE_P2P(lvl,...) TRACE_FILT(P2P, P2P_##lvl, __VA_ARGS__ ) |
| add trace point for P2P component | |
| #define | TRACE_BUF_P2P(lvl,...) TRACE_BUF_FILT(P2P, P2P_##lvl, __VA_ARGS__ ) |
| add buffer trace point for P2P component | |
| #define | TRACE_MESH_DEFAULT (CO_BIT(TRACE_LVL_MESH_ERR)) |
| Default trace level for MESH component. | |
| #define | TRACE_MESH_EN 1 |
| Define whether to include or not MESH traces. | |
| #define | TRACE_MESH(lvl,...) TRACE_FILT(MESH, MESH_##lvl, __VA_ARGS__ ) |
| add trace point for MESH component | |
| #define | TRACE_BUF_MESH(lvl,...) TRACE_BUF_FILT(MESH, MESH_##lvl, __VA_ARGS__ ) |
| add buffer trace point for MESH component | |
| #define | TRACE_RTOS_DEFAULT |
| Default trace level for RTOS component. | |
| #define | TRACE_RTOS_EN 1 |
| Define whether to include or not RTOS traces. | |
| #define | TRACE_RTOS(lvl,...) TRACE_FILT(RTOS, RTOS_##lvl, __VA_ARGS__ ) |
| add trace point for RTOS component | |
| #define | TRACE_BUF_RTOS(lvl,...) TRACE_BUF_FILT(RTOS, RTOS_##lvl, __VA_ARGS__ ) |
| add buffer trace point for RTOS component | |
| #define | TRACE_FHOST_DEFAULT (CO_BIT(TRACE_LVL_FHOST_ERR)) |
| Default trace level for FHOST component. | |
| #define | TRACE_FHOST_EN 1 |
| Define whether to include or not FHOST traces. | |
| #define | TRACE_FHOST(lvl,...) TRACE_FILT(FHOST, FHOST_##lvl, __VA_ARGS__ ) |
| add trace point for FHOST component | |
| #define | TRACE_BUF_FHOST(lvl,...) TRACE_BUF_FILT(FHOST, FHOST_##lvl, __VA_ARGS__ ) |
| add buffer trace point for RTOS component | |
| #define | TRACE_APP_DEFAULT (CO_BIT(TRACE_LVL_APP_ERR)) |
| Default trace level for APP component. | |
| #define | TRACE_APP_EN 1 |
| Define whether to include or not APP traces. | |
| #define | TRACE_APP(lvl,...) TRACE_FILT(APP, APP_##lvl, __VA_ARGS__ ) |
| add trace point for APP component | |
| #define | TRACE_BUF_APP(lvl,...) TRACE_BUF_FILT(APP, APP_##lvl, __VA_ARGS__ ) |
| add buffer trace point for APP component | |
| #define | TRACE_TDLS_DEFAULT |
| Default trace level for TDLS component. | |
| #define | TRACE_TDLS_EN 1 |
| Define whether to include or not TDLS traces. | |
| #define | TRACE_TDLS(lvl,...) TRACE_FILT(TDLS, TDLS_##lvl, __VA_ARGS__ ) |
| add trace point for TDLS component | |
| #define | TRACE_BUF_TDLS(lvl,...) TRACE_BUF_FILT(TDLS, TDLS_##lvl, __VA_ARGS__ ) |
| add buffer trace point for TDLS component | |
Enumerations | |
| enum | trace_compo { TRACE_COMPO_KERNEL, TRACE_COMPO_LMAC, TRACE_COMPO_CHAN, TRACE_COMPO_STA, TRACE_COMPO_AP, TRACE_COMPO_P2P, TRACE_COMPO_MESH, TRACE_COMPO_RTOS, TRACE_COMPO_FHOST, TRACE_COMPO_APP, TRACE_COMPO_TDLS, TRACE_COMPO_MAX } |
Filterable trace component. More... | |
| enum | trace_level_kernel { TRACE_LVL_KERNEL_ERR, TRACE_LVL_KERNEL_MSG_API, TRACE_LVL_KERNEL_MSG_LOCAL, TRACE_LVL_KERNEL_STATE } |
Specific filter for KERNEL component. More... | |
| enum | trace_level_lmac { TRACE_LVL_LMAC_ERR, TRACE_LVL_LMAC_TX, TRACE_LVL_LMAC_RX, TRACE_LVL_LMAC_RX_ALL, TRACE_LVL_LMAC_DOZE, TRACE_LVL_LMAC_BA, TRACE_LVL_LMAC_TPC } |
Specific filter for LMAC. More... | |
| enum | trace_level_chan { TRACE_LVL_CHAN_ERR, TRACE_LVL_CHAN_INF, TRACE_LVL_CHAN_CREATE, TRACE_LVL_CHAN_SWITCH, TRACE_LVL_CHAN_STATUS, TRACE_LVL_CHAN_CON_LESS, TRACE_LVL_CHAN_NOA, TRACE_LVL_CHAN_TBTT } |
Specific filter for Channel context. More... | |
| enum | trace_level_sta { TRACE_LVL_STA_ERR, TRACE_LVL_STA_BCN, TRACE_LVL_STA_PS } |
Specific filter for STA component. More... | |
| enum | trace_level_ap { TRACE_LVL_AP_ERR, TRACE_LVL_AP_BCN, TRACE_LVL_AP_PS } |
Specific filter for AP component. More... | |
| enum | trace_level_p2p { TRACE_LVL_P2P_ERR, TRACE_LVL_P2P_ITF, TRACE_LVL_P2P_PS, TRACE_LVL_P2P_NOA, TRACE_LVL_P2P_NOA_DET, TRACE_LVL_P2P_TBTT } |
Specific filter for P2P component. More... | |
| enum | trace_level_mesh { TRACE_LVL_MESH_ERR, TRACE_LVL_MESH_INF, TRACE_LVL_MESH_PS, TRACE_LVL_MESH_SP, TRACE_LVL_MESH_AWIN, TRACE_LVL_MESH_SLEEP, TRACE_LVL_MESH_RX, TRACE_LVL_MESH_BCN_RX, TRACE_LVL_MESH_BCN_TX, TRACE_LVL_MESH_POST_TRAFFIC, TRACE_LVL_MESH_HWMP, TRACE_LVL_MESH_MPATH, TRACE_LVL_MESH_MPM, TRACE_LVL_MESH_TBTT } |
Specific filter for MESH component. More... | |
| enum | trace_level_rtos { TRACE_LVL_RTOS_ERR, TRACE_LVL_RTOS_ALLOC, TRACE_LVL_RTOS_FREE, TRACE_LVL_RTOS_CREATE, TRACE_LVL_RTOS_SUSPEND, TRACE_LVL_RTOS_SWITCH_IN, TRACE_LVL_RTOS_SWITCH_OUT } |
Specific filter for RTOS component. More... | |
| enum | trace_level_fhost { TRACE_LVL_FHOST_ERR, TRACE_LVL_FHOST_WPA_FSM, TRACE_LVL_FHOST_WPA_CMD, TRACE_LVL_FHOST_WPA_INFO, TRACE_LVL_FHOST_DHCP, TRACE_LVL_FHOST_TASK_INIT, TRACE_LVL_FHOST_SMARTCONF } |
Specific filter for FHOST component. More... | |
| enum | trace_level_app { TRACE_LVL_APP_ERR, TRACE_LVL_APP_WARN, TRACE_LVL_APP_INF, TRACE_LVL_APP_DBG } |
Specific filter for FHOST APPLICATION component. More... | |
| enum | trace_level_tdls { TRACE_LVL_TDLS_ERR, TRACE_LVL_TDLS_CHSWITCH } |
Specific filter for TDLS component. More... | |
Functions | |
| void | trace_init (bool force, bool loop) |
| Initialize trace buffer. | |
| void | trace (uint32_t id, uint16_t nb_param, uint16_t *param, bool trace_buf) |
| Add a trace point in the buffer. | |
| void | trace_set_filter (unsigned int compo_id, unsigned int level) |
| Modify trace level on a given component. | |
Variables | |
| static bool | trace_initialized = false |
| Global variable indicating if trace buffer has been initialized. | |
| static bool | trace_loop = false |
| Global variable indicating if trace buffer must be used as a circular buffer. | |
| uint16_t | _trace_start |
| uint16_t | _trace_end |
| uint32_t | trace_compo_level [TRACE_COMPO_MAX] |
| Trace filter for each component. | |
| uint32_t | trace_compo_level [TRACE_COMPO_MAX] |
| Current trace filters status. | |
Trace buffer debug module.
Trace module is enabled when fw is compiled with TRACE=on option.
Trace module is using a buffer located in shared ram, to store trace event form fw. A trace entry is optimized to only contains IDs and parameters, instead of complete string. This IDs and parameters can then be decoded using dictionary generated at compilation time.
A trace entry in memory looks like :
* 15 8 7 0 * +---------------------+ --+ * | NB PARAM | ID MSB | | * +---------------------+ | * | ID LSB | | * +---------------------+ +--> header (fixed size) * | TIMESTAMP MSB | | * +---------------------+ | * | TIMESTAMP LSB | | * +---------------------+ --+ * | PARAM(1) | | * +---------------------+ | * .... +--> parameters (variable size) * +---------------------+ | * | PARAM(x) | | * +---------------------+ --+ *
Trace buffer is defined by _trace_start and _trace_end whose value is defined in linker script in order to use all the remaining shared ram.
Usage:
You can add:
Unfiltered trace points are always traced.
A filterable trace point is traced if the bit of the trace point level is set in the current filter for the component. See trace_level_<compo> for trace level specific to a given component.
You can then use trace_set_filter to change the current filter of a given component. As trace_compo_level is stored in shared_memory Host can also directy modify its content.
Filterable Components:
To define a new filterable component "compo", in file trace_compo.h:
| #define TR_32 | ( | a | ) | (uint16_t)((uint32_t)(a) >> 16), (uint16_t)((uint32_t)(a)) |
Macro to trace a 32bits parameters.
To be used with %ld, %lu, %lx, %lX format
| [in] | a | A 32bit value |
Definition at line 258 of file trace.h.
Referenced by chan_add_next_tbtt(), chan_fix_ctxt_until(), chan_schedule_extra_switch_to_p2pgo_ctxt(), chan_schedule_one_switch(), chan_schedule_switch_from_p2pgo_ctxt(), chan_schedule_switch_to_p2pgo_ctxt(), chan_start_p2pgo_noa(), chan_tx_cfm(), p2p_cli_noa_get_abs_time(), p2p_cli_noa_start(), and p2p_noa_timer_prog().
| #define TR_64 | ( | a | ) | TR_32(((uint64_t)(a) >> 32)), TR_32(a) |
| #define TR_IP4 | ( | m | ) | TR_32(*((uint32_t *)m)) |
| #define TR_IP6 | ( | m | ) |
((uint16_t *)(m))[0], ((uint16_t *)(m))[1], ((uint16_t *)(m))[2] \
((uint16_t *)(m))[3], ((uint16_t *)(m))[4], ((uint16_t *)(m))[5] \
((uint16_t *)(m))[6], ((uint16_t *)(m))[7]
Macro to trace a IPv6 address.
To be used with %pI6, %ipI6c format
| [in] | m | Address on an IPv6 address |
| #define TR_MAC | ( | m | ) | ((uint16_t *)(m))[0], ((uint16_t *)(m))[1], ((uint16_t *)(m))[2] |
| #define TR_PTR | ( | p | ) | TR_32(p) |
| #define TR_STR_8 | ( | s | ) |
(0x0800 + (uint16_t)((uint32_t)(s) & 0x1)) , \
_PTR_ALIGN(s)[0], _PTR_ALIGN(s)[1], \
_PTR_ALIGN(s)[2], _PTR_ALIGN(s)[3]
Macro to trace a string.
To be used with %s format. Trace only the 8 first characters of the string
| #define TRACE | ( | a, | |||
| ... | ) |
{ \
uint16_t __p[] = { __VA_ARGS__ }; \
trace((TRACE_FILE_ID << 16) + __LINE__ , sizeof(__p)/sizeof(__p[0]), __p, false); \
}
Macro used to add a unfiltered trace point in the trace buffer.
It should be called with a printf like protoype, and will generate an unique trace id based of file and line number.
TRACE_FILE_ID is passed on the compilation line and is different for each file.
Current format string supported by the decoder are:
TRACE("first char is %c", string[0]) TRACE("this is a 16bit value %d", myval) TRACE("this is a 16bit value 0x%04x", myval) TRACE("this is a 32bit value 0x%08lx", TR_32(myval)) TRACE("SSID = %s", TR_STR_8(param->ssid)) TRACE("buffer address is %p", TR_PTR(buffer)) TRACE("vif mac = %pM", TR_MAC(mac_addr)) TRACE("Error in file %F", TRACE_FILE_ID) TRACE("msg received is receive [%kM]", msg_id)
=> msg received is [MM_VERSION_REQ] TRACE("send message to task [%kT]", msg_id)
=> send message to task [ME(0)] TRACE("set [%kS]", task_id, state)
=> set SCANU(0):SCANU_IDLE TRACE("Timer set at %t", TR_32(timer_date))
=> Timer set at @23.234_789 (+25.35 ms) TRACE("Received frame: %fc", mac_hdr->fctl)
=> Received frame: Association response TRACE("ip = %pI4", TR_IP4(ip4_addr)) TRACE("ipv6 = %pI6", TR_IP6(ip6_addr)) | #define TRACE_BUF | ( | format, | |||
| size, | |||||
| buf | ) |
{ \
uint16_t __p[] = {(uint16_t)(size), (uint16_t)((uint32_t)buf), \
(uint16_t)(((uint32_t)buf) >> 16)}; \
uint16_t __size = 1 + (size + 1 + ((uint32_t)buf & 0x1)) / 2; \
trace((TRACE_FILE_ID << 16) + __LINE__, __size, __p, true); \
}
Macro used to add a unfiltered trace containing a dump of a buffer in the trace buffer.
It will generate an unique trace id based of file and line number.
TRACE_FILE_ID is passed on the compilation line and is different for each file.
The format string supported by the decoder is:
pB(F)?(number_of_characters)?(word_size)?(representation)?
TRACE_BUF("my_buf: %pB4", my_buf_len, my_buf);
=> my_buf: 00 10 00 20
40 FF 00 1A TRACE_BUF("my_buf: %pB4h", my_buf_len, my_buf);
=> my_buf: 0010 0020 40FF 001ATRACE_BUF("my_buf: %pB4hd", my_buf_len, my_buf);
=> my_buf: 16 32 16639 26TRACE_BUF("received frame: %pBF12bx", my_buf_len, my_buf);
=> received frame: Authentication Dur=60us Seq=1322 frag=0
A1=aa:06:cc:dd:ee:fe A2=c4:04:15:3d:41:e8 A3=c4:04:15:3d:41:e8
00 00 02 00 00 00 dd 09 00 10 18 02
00 00 1c 00 00 | [in] | format | string specifying how to interpret the data |
| [in] | size | size of the buffer in bytes (independent from number_of_characters in the conversion specification) |
| [in] | buf | buffer to dump |
| #define TRACE_BUF_FILT | ( | compo, | |||
| lvl, | |||||
| ... | ) |
if (trace_compo_level[TRACE_COMPO_##compo] & CO_BIT(TRACE_LVL_##lvl)) { \ TRACE_BUF(__VA_ARGS__) }
Acts like TRACE_BUF macro if bit lvl is set in trace level for compo.
Does nothing otherwise.
| [in] | compo | Name of the component from trace_compo. TRACE_COMPO_ prefix should be omitted. |
| [in] | lvl | Trace level form one of trace_level_... enum. TRACE_LVL_ prefix should be omitted |
| #define TRACE_CHAN_DEFAULT |
Default trace level for CHAN component.
Definition at line 177 of file trace_compo.h.
| #define TRACE_FILT | ( | compo, | |||
| lvl, | |||||
| ... | ) |
if (trace_compo_level[TRACE_COMPO_##compo] & CO_BIT(TRACE_LVL_##lvl)) { \ TRACE(__VA_ARGS__) }
Acts like TRACE macro if bit lvl is set in trace level for compo.
Does nothing otherwise.
| [in] | compo | Name of the component from trace_compo. TRACE_COMPO_ prefix should be omitted. |
| [in] | lvl | Trace level form one of trace_level_... enum. TRACE_LVL_ prefix should be omitted |
| #define TRACE_KERNEL_DEFAULT |
(CO_BIT(TRACE_LVL_KERNEL_ERR) | \ CO_BIT(TRACE_LVL_KERNEL_MSG_API) | \ CO_BIT(TRACE_LVL_KERNEL_MSG_LOCAL))
Default trace level for KERNEL component.
Definition at line 97 of file trace_compo.h.
| #define TRACE_RTOS_DEFAULT |
Default trace level for RTOS component.
Definition at line 364 of file trace_compo.h.
| #define TRACE_TDLS_DEFAULT |
Default trace level for TDLS component.
Definition at line 463 of file trace_compo.h.
| enum trace_compo |
Filterable trace component.
Definition at line 56 of file trace_compo.h.
| enum trace_level_ap |
Specific filter for AP component.
| TRACE_LVL_AP_ERR |
Error. |
| TRACE_LVL_AP_BCN |
Beacon transmitted on AP interfaces. |
| TRACE_LVL_AP_PS |
PS traffic requested/sent by/to connected STA. |
Definition at line 227 of file trace_compo.h.
| enum trace_level_app |
Specific filter for FHOST APPLICATION component.
| TRACE_LVL_APP_ERR |
Error. |
| TRACE_LVL_APP_WARN |
Warning. |
| TRACE_LVL_APP_INF |
Information (depends of the application used). |
| TRACE_LVL_APP_DBG |
Debug (depends of the application used). |
Definition at line 422 of file trace_compo.h.
| enum trace_level_chan |
Specific filter for Channel context.
Definition at line 156 of file trace_compo.h.
| enum trace_level_fhost |
Specific filter for FHOST component.
Definition at line 384 of file trace_compo.h.
| enum trace_level_kernel |
Specific filter for KERNEL component.
| TRACE_LVL_KERNEL_ERR |
Error. |
| TRACE_LVL_KERNEL_MSG_API |
Messages to API layer. |
| TRACE_LVL_KERNEL_MSG_LOCAL |
Messages from API layer or internal task. |
| TRACE_LVL_KERNEL_STATE |
State changes. |
Definition at line 84 of file trace_compo.h.
| enum trace_level_lmac |
Specific filter for LMAC.
Definition at line 118 of file trace_compo.h.
| enum trace_level_mesh |
Specific filter for MESH component.
Definition at line 293 of file trace_compo.h.
| enum trace_level_p2p |
Specific filter for P2P component.
Definition at line 257 of file trace_compo.h.
| enum trace_level_rtos |
Specific filter for RTOS component.
Definition at line 345 of file trace_compo.h.
| enum trace_level_sta |
Specific filter for STA component.
| TRACE_LVL_STA_ERR |
Error. |
| TRACE_LVL_STA_BCN |
Beacon received on STA interfaces. |
| TRACE_LVL_STA_PS |
Power Save status of STA interfaces. |
Definition at line 197 of file trace_compo.h.
| enum trace_level_tdls |
Specific filter for TDLS component.
Definition at line 453 of file trace_compo.h.
| void trace | ( | uint32_t | id, | |
| uint16_t | nb_param, | |||
| uint16_t * | param, | |||
| bool | trace_buf | |||
| ) |
Add a trace point in the buffer.
This function must NOT be called directly. use TRACE, TRACE_BUF or any of the TRACE_<LVL> macro instead.
| [in] | id | Unique trace id |
| [in] | nb_param | Number of parameters to trace |
| [in] | param | Table of parameters |
| [in] | trace_buf | boolean indicating if TRACE_BUF macro is used. if true, param = [buffer size, buffer address(16 LSB), buffer address(16 MSB)] |
| void trace_init | ( | bool | force, | |
| bool | loop | |||
| ) |
Initialize trace buffer.
Normal usage would be to initialize trace buffer at boot with:
force set to false, so that if fw jumps back to boot code (e.g. by dereferencing invalid pointer), it will appear in the trace.loop set to true to keep the latest trace.In some specific debug cases, it may be usefull to start the trace after a specific event and to not use a circular buffer so that it ensure that trace that happened just after that specific event is kept. In this case set force to true and loop to false.
| [in] | force | Force buffer initialization even if trace buffer has already been initialized. |
| [in] | loop | Whether trace buffer must be used circular buffer or not |
| void trace_set_filter | ( | unsigned int | compo_id, | |
| unsigned int | level | |||
| ) |
Modify trace level on a given component.
| [in] | compo_id | Component id (trace_compo). use TRACE_COMPO_MAX to configure all components. |
| [in] | level | Trace level to activate on the component. |
| uint32_t trace_compo_level[TRACE_COMPO_MAX] |
1.6.1