summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/inc/trace.h
blob: d418596b9cac6f160d069ed32eadc6faae4ce311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef ce_rx_inc_trace_h
#define ce_rx_inc_trace_h
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    ce/rx/inc/trace.h
 * \brief   Trace event for the CE/RX.
 * \ingroup ce_rx
 */

#include "lib/trace.h"
#include "ce/rx/inc/rx.h"

/**
 * Shortcut for tracing inside CE RX.
 */
#define CE_RX_TRACE(id, args...) \
    TRACE_SHORT (CE_RX_TRACE_, &ce_rx->trace, id, phy_date (), ## args)

#define CE_RX_TRACE_N(id, args, nb_args) \
    TRACE_N_SHORT (CE_RX_TRACE_, &ce_rx->trace, id, args, nb_args)

#define CE_RX_TRACE_VERBOSE(id, args...) \
    TRACE_FAST_SHORT (CE_RX_TRACE_, &ce_rx->trace_verbose, id, phy_date (), \
    ## args)

#if CONFIG_TRACE

enum
{
    CE_RX_TRACE_INIT,
    CE_RX_TRACE_UNINIT,
    CE_RX_TRACE_MEASURE_HANDLING,
    CE_RX_TRACE_SAR_CB,
    CE_RX_TRACE_BL_INITIAL,
    CE_RX_TRACE_SEND_TONEMAP,
    CE_RX_TRACE_SEND_TONEMAP_REFRESH,
    CE_RX_TRACE_FSM_FROM_TO,
    CE_RX_TRACE_TONEMAP,
    CE_RX_TRACE_INITIAL_WORSE_THAN_ROBO,
    CE_RX_TRACE_RESTART_FORCED,
    CE_RX_TRACE_PB_ERR_RATE_HIGH,
    CE_RX_TRACE_RESTART_PB_ERR,
    CE_RX_TRACE_RESTART_BER,
};

BEGIN_DECLS

/**
 * Initialise trace buffer.
 * \param  ctx  ce_rx context.
 */
void
ce_rx_trace_init (ce_rx_t *ctx);

/**
 * Un-initialise trace buffer.
 * \param  ctx  ce_rx context.
 */
void
ce_rx_trace_uninit (ce_rx_t *ctx);

END_DECLS

#else /* !CONFIG_TRACE */

# define ce_rx_trace_init(ctx) ((void) 0)
# define ce_rx_trace_uninit(ctx) ((void) 0)

#endif /* !CONFIG_TRACE */

#endif /* ce_rx_inc_trace_h */