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#include <IxOsal.h>
46
47#ifdef IX_UNIT_TEST
48#define NULL_PRINT_ROUTINE(format, arg...)
49#else
50#define NULL_PRINT_ROUTINE if(0) printf
51#endif
52
53
54
55
56
57#define HAS_ERROR_LOG
58#define HAS_ERROR_IRQ_LOG
59#define HAS_WARNING_LOG
60
61
62
63
64
65
66
67#ifndef NDEBUG
68
69#undef HAS_EVENTS_TRACE
70#undef HAS_EVENTS_VERBOSE_TRACE
71
72#undef HAS_SUPPORT_TRACE
73#undef HAS_SUPPORT_VERBOSE_TRACE
74
75#undef HAS_NPE_TRACE
76#undef HAS_NPE_VERBOSE_TRACE
77#undef HAS_DUMP_NPE_TREE
78
79#undef HAS_UPDATE_TRACE
80#undef HAS_UPDATE_VERBOSE_TRACE
81
82#endif
83
84
85
86
87
88
89
90
91#ifdef HAS_ERROR_LOG
92
93 #define ERROR_LOG printf
94
95#else
96
97 #define ERROR_LOG NULL_PRINT_ROUTINE
98
99#endif
100
101#ifdef HAS_ERROR_IRQ_LOG
102
103 #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)
104
105#else
106
107 #define ERROR_IRQ_LOG(format, arg1, arg2, arg3, arg4, arg5, arg6)
108
109#endif
110
111#ifdef HAS_WARNING_LOG
112
113 #define WARNING_LOG printf
114
115#else
116
117 #define WARNING_LOG NULL_PRINT_ROUTINE
118
119#endif
120
121
122
123#ifdef HAS_EVENTS_TRACE
124
125 #define IX_ETH_DB_EVENTS_TRACE printf
126 #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)
127
128 #ifdef HAS_EVENTS_VERBOSE_TRACE
129
130 #define IX_ETH_DB_EVENTS_VERBOSE_TRACE printf
131
132 #else
133
134 #define IX_ETH_DB_EVENTS_VERBOSE_TRACE NULL_PRINT_ROUTINE
135
136 #endif
137
138#else
139
140 #define IX_ETH_DB_EVENTS_TRACE NULL_PRINT_ROUTINE
141 #define IX_ETH_DB_EVENTS_VERBOSE_TRACE NULL_PRINT_ROUTINE
142 #define IX_ETH_DB_IRQ_EVENTS_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6)
143
144#endif
145
146
147
148#ifdef HAS_SUPPORT_TRACE
149
150 #define IX_ETH_DB_SUPPORT_TRACE printf
151 #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)
152
153 #ifdef HAS_SUPPORT_VERBOSE_TRACE
154
155 #define IX_ETH_DB_SUPPORT_VERBOSE_TRACE printf
156
157 #else
158
159 #define IX_ETH_DB_SUPPORT_VERBOSE_TRACE NULL_PRINT_ROUTINE
160
161 #endif
162
163#else
164
165 #define IX_ETH_DB_SUPPORT_TRACE NULL_PRINT_ROUTINE
166 #define IX_ETH_DB_SUPPORT_VERBOSE_TRACE NULL_PRINT_ROUTINE
167 #define IX_ETH_DB_SUPPORT_IRQ_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6)
168
169#endif
170
171
172
173#ifdef HAS_NPE_TRACE
174
175 #define IX_ETH_DB_NPE_TRACE printf
176 #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)
177
178 #ifdef HAS_NPE_VERBOSE_TRACE
179
180 #define IX_ETH_DB_NPE_VERBOSE_TRACE printf
181
182 #else
183
184 #define IX_ETH_DB_NPE_VERBOSE_TRACE NULL_PRINT_ROUTINE
185
186 #endif
187
188#else
189
190 #define IX_ETH_DB_NPE_TRACE NULL_PRINT_ROUTINE
191 #define IX_ETH_DB_NPE_VERBOSE_TRACE NULL_PRINT_ROUTINE
192 #define IX_ETH_DB_NPE_IRQ_TRACE(format, arg1, arg2, arg3, arg4, arg5, arg6)
193
194#endif
195
196#ifdef HAS_DUMP_NPE_TREE
197
198#define IX_ETH_DB_NPE_DUMP_ELT(eltBaseAddress, eltSize) ixEthELTDumpTree(eltBaseAddress, eltSize)
199
200#else
201
202#define IX_ETH_DB_NPE_DUMP_ELT(eltBaseAddress, eltSize)
203
204#endif
205
206
207
208#ifdef HAS_UPDATE_TRACE
209
210 #define IX_ETH_DB_UPDATE_TRACE printf
211
212 #ifdef HAS_UPDATE_VERBOSE_TRACE
213
214 #define IX_ETH_DB_UPDATE_VERBOSE_TRACE printf
215
216 #else
217
218 #define IX_ETH_DB_UPDATE_VERBOSE_TRACE NULL_PRINT_ROUTINE
219
220 #endif
221
222#else
223
224 #define IX_ETH_DB_UPDATE_TRACE NULL_PRINT_ROUTINE
225 #define IX_ETH_DB_UPDATE_VERBOSE_TRACE NULL_PRINT_ROUTINE
226
227#endif
228