# /space/home/slher/rel/Beken/v6_4_5/macsw/modules/dbg/src/trace.c File Reference

Definition for the trace buffer. More...

`#include "trace.h"`
`#include "ipc_shared.h"`
`#include "hal_machw.h"`

Go to the source code of this file.

## 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.
## 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.

## Detailed Description

Definition for the trace buffer.

Copyright (C) RivieraWaves 2011-2019

Definition in file trace.c.