summaryrefslogtreecommitdiffstats
path: root/src/include/usr/targeting/common/trace.H
blob: bf42dd6252343ee0040b6869098634da81913b39 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/include/usr/targeting/common/trace.H $                    */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2012,2014                        */
/* [+] Google Inc.                                                        */
/* [+] 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 __TARGETING_COMMON_TRACE_H
#define __TARGETING_COMMON_TRACE_H

/**
 *  @file targeting/common/trace.H
 *
 *  @brief Targeting related trace macros.  Callers of these macros must
 *      define TARG_NAMESPACE, TARG_CLASS, and TARG_FN as appropriate
 */

//******************************************************************************
// Includes
//******************************************************************************

// Other includes
#include <targeting/adapters/traceadapter.H>
#ifdef __HOSTBOOT_MODULE
#include <config.h>
#endif

#define TARG_LOC TARG_NAMESPACE TARG_CLASS TARG_FN ": "

#define TARG_ERR_LOC ERR_MRK " " TARG_LOC

#define TARG_TAG "[TARG]"

#ifdef CONFIG_TARG_TRACE_AS_DEBUG
#define TARG_ENTER(args...) \
    TRACDCOMP(TARGETING::g_trac_targeting,TARG_TAG " " \
        ENTER_MRK " " TARG_NAMESPACE \
        TARG_CLASS TARG_FN " " args)
#define TARG_EXIT(args...) \
    TRACDCOMP(TARGETING::g_trac_targeting,TARG_TAG " " \
        EXIT_MRK " " TARG_NAMESPACE \
        TARG_CLASS TARG_FN " " args)
#else
#define TARG_ENTER(args...) \
    TRACFCOMP(TARGETING::g_trac_targeting,TARG_TAG " " \
        ENTER_MRK " " TARG_NAMESPACE \
        TARG_CLASS TARG_FN " " args)
#define TARG_EXIT(args...) \
    TRACFCOMP(TARGETING::g_trac_targeting,TARG_TAG " " \
        EXIT_MRK " " TARG_NAMESPACE \
        TARG_CLASS TARG_FN " " args)
#endif

#define TARG_ERR(args...) \
    TRACFCOMP(TARGETING::g_trac_targeting,TARG_TAG " " ERR_MRK " " args)

#define TARG_INF(args...) \
    TRACFCOMP(TARGETING::g_trac_targeting,TARG_TAG " " INFO_MRK " " args)

#define TARG_DBG(args...) \
    TRACDCOMP(TARGETING::g_trac_targeting,TARG_TAG " " INFO_MRK " " args)

#define TARG_BIN(args...) \
    TRACFBIN(TARGETING::g_trac_targeting,TARG_TAG " " args)

#endif // __TARGETING_COMMON_TRACE_H
OpenPOWER on IntegriCloud