summaryrefslogtreecommitdiffstats
path: root/src/occ/trac/trac.h
blob: 87f669bd26da6a4e0edb3f18397b0a1d473bedfb (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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/occ/trac/trac.h $                                         */
/*                                                                        */
/* OpenPOWER OnChipController Project                                     */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2011,2015                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#ifndef _trac_h
#define _trac_h
//*************************************************************************
// Includes
//*************************************************************************
#include <trac_interface.h>
//*************************************************************************
// Externs
//*************************************************************************

//*************************************************************************
// Macros
//*************************************************************************

//*************************************************************************
// Defines/Enums
//*************************************************************************
#ifndef NO_TRAC_STRINGS

#define ERR_MRK         "ERR: "
#define INFO_MRK        "INF: "
#define IMP_MRK         "IMP: "
#define DBG_MRK         "DBG: "

//NOTE: TRAC_ERR must be used for tracing error related information only
//      TRAC_IMP must be used for tracing important OCC state/status that
//               changes once or twice OCC lifetime. It must NOT be used
//               for tracing anything that seems important to particular
//               developer. This trace buffer must not wrap so use it with
//               caution.
//      TRAC_INFO must be used for anything that does not fall under
//               TRAC_ERR or TRAC_IMP. Any debug or informational traces.
//      TRAC_DBG must be used for debug purpose only. This traces will be
//               turned OFF with product code.
#ifdef TRAC_TO_SIMICS
#define TRAC_ERR(frmt,args...)  \
        printf(ERR_MRK "%s: "frmt "\n",__FUNCTION__,##args)
#define TRAC_INFO(frmt,args...)  \
        printf(INFO_MRK "%s: "frmt "\n",__FUNCTION__,##args)
#define TRAC_IMP(frmt,args...)  \
        printf(IMP_MRK "%s: "frmt "\n",__FUNCTION__,##args)

#define DBG_PRINT(fmt,args...)  \
        printf(DBG_MRK "%s: "fmt "\n",__FUNCTION__,##args)

extern void dumpHexString(const void *i_data, const unsigned int len, const char *string);
#define DEBUG_HEXDUMP(data, len, string)  \
        dumpHexString(data, len, string)

#else  //TRAC_TO_SIMICS

#define TRAC_ERR(frmt,args...)  \
        TRACE(g_trac_err,ERR_MRK frmt,##args)
#define TRAC_INFO(frmt,args...)  \
        TRACE(g_trac_inf,INFO_MRK frmt,##args)
#define TRAC_IMP(frmt,args...)  \
        TRACE(g_trac_imp,IMP_MRK frmt,##args)
#define DBG_PRINT(fmt,args...)  \
        TRACE(g_trac_inf,DBG_MRK fmt,##args)
#define DEBUG_HEXDUMP(data, len, string)  \
        TRACEBIN(g_trac_inf, string, data,len)

#endif  //TRAC_TO_SIMICS


#ifdef MAIN_DEBUG
  #define MAIN_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define MAIN_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define MAIN_DBG(frmt,args...)
  #define MAIN_DBG_HEXDUMP(data, len, string)
#endif

#ifdef RTLS_DEBUG
  #define RTLS_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define RTLS_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define RTLS_DBG(frmt,args...)
  #define RTLS_DBG_HEXDUMP(data, len, string)
#endif

#ifdef PROC_DEBUG
  #define PROC_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define PROC_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define PROC_DBG(frmt,args...)
  #define PROC_DBG_HEXDUMP(data, len, string)
#endif

#ifdef CENT_DEBUG
  #define CENT_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define CENT_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define CENT_DBG(frmt,args...)
  #define CENT_DBG_HEXDUMP(data, len, string)
#endif

#ifdef THRD_DEBUG
  #define THRD_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define THRD_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define THRD_DBG(frmt,args...)
  #define THRD_DBG_HEXDUMP(data, len, string)
#endif

#ifdef AMEC_DEBUG
  #define AMEC_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define AMEC_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define AMEC_DBG(frmt,args...)
  #define AMEC_DBG_HEXDUMP(data, len, string)
#endif

#ifdef APLT_DEBUG
  #define APLT_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define APLT_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define APLT_DBG(frmt,args...)
  #define APLT_DBG_HEXDUMP(data, len, string)
#endif

#ifdef DCOM_DEBUG
  #define DCOM_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define DCOM_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define DCOM_DBG(frmt,args...)
  #define DCOM_DBG_HEXDUMP(data, len, string)
#endif

#ifdef ERRL_DEBUG
  #define ERRL_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define ERRL_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define ERRL_DBG(frmt,args...)
  #define ERRL_DBG_HEXDUMP(data, len, string)
#endif

#ifdef APSS_DEBUG
  #define APSS_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define APSS_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define APSS_DBG(frmt,args...)
  #define APSS_DBG_HEXDUMP(data, len, string)
#endif

#ifdef DPSS_DEBUG
  #define DPSS_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define DPSS_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define DPSS_DBG(frmt,args...)
  #define DPSS_DBG_HEXDUMP(data, len, string)
#endif

#ifdef CMDH_DEBUG
  #define CMDH_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define CMDH_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define CMDH_DBG(frmt,args...)
  #define CMDH_DBG_HEXDUMP(data, len, string)
#endif

#ifdef SNSR_DEBUG
  #define SNSR_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define SNSR_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define SNSR_DBG(frmt,args...)
  #define SNSR_DBG_HEXDUMP(data, len, string)
#endif

#ifdef TMER_DEBUG
  #define TMER_DBG(frmt,args...)  \
          DBG_PRINT(frmt,##args)
  #define TMER_DBG_HEXDUMP(data, len, string)  \
          DEBUG_HEXDUMP(data, len, string)
#else
  #define TMER_DBG(frmt,args...)
  #define TMER_DBG_HEXDUMP(data, len, string)
#endif

#else // NO_TRAC_STRINGS

#define TRAC_ERR(frmt,args...)
#define TRAC_INFO(frmt,args...)
#define TRAC_IMP(frmt,args...)

#define MAIN_DBG(frmt,args...)
#define RTLS_DBG(frmt,args...)
#define PROC_DBG(frmt,args...)
#define THRD_DBG(frmt,args...)
#define AMEC_DBG(frmt,args...)
#define APLT_DBG(frmt,args...)
#define DCOM_DBG(frmt,args...)
#define ERRL_DBG(frmt,args...)
#define CENT_DBG(frmt,args...)
#define CMDH_DBG(frmt,args...)
#define APSS_DBG(frmt,args...)
#define DPSS_DBG(frmt,args...)
#define SNSR_DBG(frmt,args...)
#define TMER_DBG(frmt,args...)

#define MAIN_DBG_HEXDUMP(frmt,args...)
#define RTLS_DBG_HEXDUMP(frmt,args...)
#define PROC_DBG_HEXDUMP(frmt,args...)
#define THRD_DBG_HEXDUMP(frmt,args...)
#define AMEC_DBG_HEXDUMP(frmt,args...)
#define APLT_DBG_HEXDUMP(frmt,args...)
#define DCOM_DBG_HEXDUMP(frmt,args...)
#define ERRL_DBG_HEXDUMP(frmt,args...)
#define CENT_DBG_HEXDUMP(frmt,args...)
#define CMDH_DBG_HEXDUMP(frmt,args...)
#define APSS_DBG_HEXDUMP(frmt,args...)
#define DPSS_DBG_HEXDUMP(frmt,args...)
#define SNSR_DBG_HEXDUMP(frmt,args...)
#define TMER_DBG_HEXDUMP(frmt,args...)

#endif

//*************************************************************************
// Structures
//*************************************************************************

//*************************************************************************
// Globals
//*************************************************************************

//*************************************************************************
// Function Prototypes
//*************************************************************************

//*************************************************************************
// Functions
//*************************************************************************

#endif // _trac_h
OpenPOWER on IntegriCloud