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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
/**
* @file IxEthDBLog_p.h
*
* @brief definitions of log macros and log configuration
*
* @par
* IXP400 SW Release version 2.0
*
* -- Copyright Notice --
*
* @par
* Copyright 2001-2005, Intel Corporation.
* All rights reserved.
*
* @par
* SPDX-License-Identifier: BSD-3-Clause
* @par
* -- End of Copyright Notice --
*/
#include <IxOsal.h>
#ifdef IX_UNIT_TEST
#define NULL_PRINT_ROUTINE(format, arg...) /* nothing */
#else
#define NULL_PRINT_ROUTINE if(0) printf
#endif
/***************************************************
* Globals *
***************************************************/
/* safe to permanently leave these on */
#define HAS_ERROR_LOG
#define HAS_ERROR_IRQ_LOG
#define HAS_WARNING_LOG
/***************************************************
* Log Configuration *
***************************************************/
/* debug output can be turned on unless specifically
declared as a non-debug build */
#ifndef NDEBUG
#undef HAS_EVENTS_TRACE
#undef HAS_EVENTS_VERBOSE_TRACE
#undef HAS_SUPPORT_TRACE
#undef HAS_SUPPORT_VERBOSE_TRACE
#undef HAS_NPE_TRACE
#undef HAS_NPE_VERBOSE_TRACE
#undef HAS_DUMP_NPE_TREE
#undef HAS_UPDATE_TRACE
#undef HAS_UPDATE_VERBOSE_TRACE
#endif /* NDEBUG */
/***************************************************
* Log Macros *
***************************************************/
/************** Globals ******************/
#ifdef HAS_ERROR_LOG
#define ERROR_LOG printf
#else
#define ERROR_LOG NULL_PRINT_ROUTINE
#endif
#ifdef HAS_ERROR_IRQ_LOG
#define ERROR_IRQ_LOG(format, arg1, arg2, arg3, arg4, arg5, arg6) ixOsalLog(IX_OSAL_LOG_LVL_ERROR, IX_OSAL_LOG_DEV_STDOUT, format, arg1, arg2, arg3, arg4, arg5, arg6)
#else
#define ERROR_IRQ_LOG(format, arg1, arg2, arg3, arg4, arg5, arg6) /* nothing */
#endif
#ifdef HAS_WARNING_LOG
#define WARNING_LOG printf
#else
#define WARNING_LOG NULL_PRINT_ROUTINE
#endif
/************** Events *******************/
#ifdef HAS_EVENTS_TRACE
#define IX_ETH_DB_EVENTS_TRACE printf
#define IX_ETH_DB_IRQ_EVENTS_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6) ixOsalLog(IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, format, arg1, arg2, arg3, arg4, arg5, arg6)
#ifdef HAS_EVENTS_VERBOSE_TRACE
#define IX_ETH_DB_EVENTS_VERBOSE_TRACE printf
#else
#define IX_ETH_DB_EVENTS_VERBOSE_TRACE NULL_PRINT_ROUTINE
#endif /* HAS_EVENTS_VERBOSE_TRACE */
#else
#define IX_ETH_DB_EVENTS_TRACE NULL_PRINT_ROUTINE
#define IX_ETH_DB_EVENTS_VERBOSE_TRACE NULL_PRINT_ROUTINE
#define IX_ETH_DB_IRQ_EVENTS_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6) /* nothing */
#endif /* HAS_EVENTS_TRACE */
/************** Support *******************/
#ifdef HAS_SUPPORT_TRACE
#define IX_ETH_DB_SUPPORT_TRACE printf
#define IX_ETH_DB_SUPPORT_IRQ_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6) ixOsalLog(IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, format, arg1, arg2, arg3, arg4, arg5, arg6)
#ifdef HAS_SUPPORT_VERBOSE_TRACE
#define IX_ETH_DB_SUPPORT_VERBOSE_TRACE printf
#else
#define IX_ETH_DB_SUPPORT_VERBOSE_TRACE NULL_PRINT_ROUTINE
#endif /* HAS_SUPPORT_VERBOSE_TRACE */
#else
#define IX_ETH_DB_SUPPORT_TRACE NULL_PRINT_ROUTINE
#define IX_ETH_DB_SUPPORT_VERBOSE_TRACE NULL_PRINT_ROUTINE
#define IX_ETH_DB_SUPPORT_IRQ_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6) /* nothing */
#endif /* HAS_SUPPORT_TRACE */
/************** NPE Adaptor *******************/
#ifdef HAS_NPE_TRACE
#define IX_ETH_DB_NPE_TRACE printf
#define IX_ETH_DB_NPE_IRQ_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6) ixOsalLog(IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, format, arg1, arg2, arg3, arg4, arg5, arg6)
#ifdef HAS_NPE_VERBOSE_TRACE
#define IX_ETH_DB_NPE_VERBOSE_TRACE printf
#else
#define IX_ETH_DB_NPE_VERBOSE_TRACE NULL_PRINT_ROUTINE
#endif /* HAS_NPE_VERBOSE_TRACE */
#else
#define IX_ETH_DB_NPE_TRACE NULL_PRINT_ROUTINE
#define IX_ETH_DB_NPE_VERBOSE_TRACE NULL_PRINT_ROUTINE
#define IX_ETH_DB_NPE_IRQ_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6) /* nothing */
#endif /* HAS_NPE_TRACE */
#ifdef HAS_DUMP_NPE_TREE
#define IX_ETH_DB_NPE_DUMP_ELT(eltBaseAddress, eltSize) ixEthELTDumpTree(eltBaseAddress, eltSize)
#else
#define IX_ETH_DB_NPE_DUMP_ELT(eltBaseAddress, eltSize) /* nothing */
#endif /* HAS_DUMP_NPE_TREE */
/************** Port Update *******************/
#ifdef HAS_UPDATE_TRACE
#define IX_ETH_DB_UPDATE_TRACE printf
#ifdef HAS_UPDATE_VERBOSE_TRACE
#define IX_ETH_DB_UPDATE_VERBOSE_TRACE printf
#else
#define IX_ETH_DB_UPDATE_VERBOSE_TRACE NULL_PRINT_ROUTINE
#endif
#else /* HAS_UPDATE_VERBOSE_TRACE */
#define IX_ETH_DB_UPDATE_TRACE NULL_PRINT_ROUTINE
#define IX_ETH_DB_UPDATE_VERBOSE_TRACE NULL_PRINT_ROUTINE
#endif /* HAS_UPDATE_TRACE */
|