1/*
2 * Copyright (c) 2014 ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#ifndef LIB_XOMP_DEBUG_H_
11#define LIB_XOMP_DEBUG_H_
12
13/// XOMP main debug switch
14#define XOMP_DEBUG_ENABLED 0
15
16/// XOMP subsystems debug switches
17#define XOMP_DEBUG_MASTER_ENABLED 1
18#define XOMP_DEBUG_WORKER_ENABLED 0
19
20#define XOMP_DEBUG_INIT_ENABLED 0
21#define XOMP_DEBUG_PROCESS_ENABLED 1
22#define XOMP_DEBUG_REPLICATIION_ENABLED 0
23#define XOMP_DEBUG_GATEWAY_ENABLED 0
24
25#if XOMP_DEBUG_ENABLED
26#define XOMP_DEBUG_PRINT(x...) debug_printf(x)
27#else
28#define XOMP_DEBUG_PRINT(x...)
29#endif
30
31/*
32 * ----------------------------------------------------------------------------
33 * XOMP Master Debug
34 * ----------------------------------------------------------------------------
35 */
36#if XOMP_DEBUG_MASTER_ENABLED
37#define XOMP_DEBUG_MASTER_PRINT(x...) XOMP_DEBUG_PRINT(x)
38#else
39#define XOMP_DEBUG_MASTER_PRINT(x...)
40#endif
41#if XOMP_DEBUG_INIT_ENABLED
42#define XMI_DEBUG(x...) XOMP_DEBUG_MASTER_PRINT("[xomp.m.init] " x)
43#else
44#define XMI_DEBUG(x...)
45#endif
46#if XOMP_DEBUG_PROCESS_ENABLED
47#define XMP_DEBUG(x...) XOMP_DEBUG_MASTER_PRINT("[xomp.m.proc] " x)
48#else
49#define XMP_DEBUG(x...)
50#endif
51
52
53/*
54 * ----------------------------------------------------------------------------
55 * XOMP Worker Debug
56 * ----------------------------------------------------------------------------
57 */
58#if XOMP_DEBUG_WORKER_ENABLED
59#define XOMP_DEBUG_WORKER_PRINT(x...) XOMP_DEBUG_PRINT(x)
60#else
61#define XOMP_DEBUG_WORKER_PRINT(x...)
62#endif
63#if XOMP_DEBUG_INIT_ENABLED
64#define XWI_DEBUG(x...) XOMP_DEBUG_WORKER_PRINT("[xomp.w.init] " x)
65#else
66#define XWI_DEBUG(x...)
67#endif
68#if XOMP_DEBUG_PROCESS_ENABLED
69#define XWP_DEBUG(x...) XOMP_DEBUG_WORKER_PRINT("[xomp.w.proc] " x)
70#else
71#define XWP_DEBUG(x...)
72#endif
73#if XOMP_DEBUG_REPLICATIION_ENABLED
74#define XWR_DEBUG(x...) XOMP_DEBUG_WORKER_PRINT("[xomp.w.repl] " x)
75#else
76#define XWR_DEBUG(x...)
77#endif
78#if XOMP_DEBUG_GATEWAY_ENABLED
79#define XWG_DEBUG(x...) XOMP_DEBUG_WORKER_PRINT("[xomp.w.gw] " x)
80#else
81#define XWG_DEBUG(x...)
82#endif
83
84#endif /* LIB_XOMP_DEBUG_H_ */
85