summaryrefslogtreecommitdiffstats
path: root/src/sbefw/sbetrace.H
blob: d73a2f9503e500f1df481e9a06a52dfc036d589d (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/sbefw/sbetrace.H $                                        */
/*                                                                        */
/* OpenPOWER sbe Project                                                  */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2015,2016                        */
/* [+] 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 __SBEFW_SBE_TRACE_H
#define __SBEFW_SBE_TRACE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "pk_api.h"
#include "trac_interface.h"

#ifdef __cplusplus
}
#endif

#define  SBE_ENTER_MRK ">>"
#define  SBE_EXIT_MRK "<<"
#define  SBE_ERR_MRK "E>"
#define  SBE_INF_MRK "I>"
#define  SBE_DEBUG_MRK "D>"

#define SBE_ERROR(args...)
#define SBE_INFO(args...)
#define SBE_ENTER(args...)
#define SBE_EXIT(args...)
#define SBE_DEBUG(args...)

// Levels of logging
// 0 - No tracing
// 1 - Error
// 2 - Error, info
// 3 - Error, info, entry/exit
// 4 - Error, info, entry/exit, debug
#if (SBE_TRACE_LEVEL >= 1)
#undef SBE_ERROR
#define SBE_ERROR(args...) PK_TRACE(SBE_ERR_MRK"" args)
#endif
#if (SBE_TRACE_LEVEL >= 2)
#undef SBE_INFO
#define SBE_INFO(args...) PK_TRACE(SBE_INF_MRK"" args)
#endif
#if (SBE_TRACE_LEVEL >= 3)
#undef SBE_ENTER
#undef SBE_EXIT
#define SBE_ENTER(args...) PK_TRACE(SBE_ENTER_MRK"" args)
#define SBE_EXIT(args...) PK_TRACE(SBE_EXIT_MRK"" args)
#endif
#if (SBE_TRACE_LEVEL >= 4)
#undef SBE_DEBUG
#define SBE_DEBUG(args...) PK_TRACE(SBE_DEBUG_MRK"" args)
#endif
#define SBE_TRACE(args...) PK_TRACE(args)
#endif // __SBEFW_SBE_TRACE_H
OpenPOWER on IntegriCloud