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 VBLOCK_DEBUG_H_
11#define VBLOCK_DEBUG_H_
12
13#define VBLOCK_DEBUG_HOST_ENABLED 1
14#define VBLOCK_DEBUG_GUEST_ENABLED 1
15
16#define VBLOCK_DEBUG_SVC_ENABLED 1
17#define VBLOCK_DEBUG_REQ_ENABLED 1
18#define VBLOCK_DEBUG_DEV_ENABLED 1
19
20
21#ifdef __VIRTIO_HOST__
22#define VBLOCK_DEBUG_HOST VBLOCK_DEBUG_HOST_ENABLED
23#define VBLOCK_DEBUG_GUEST 0
24#else
25#define VBLOCK_DEBUG_HOST 0
26#define VBLOCK_DEBUG_GUEST VBLOCK_DEBUG_GUEST_ENABLED
27#endif
28
29
30#if VBLOCK_DEBUG_HOST
31#define VBLOCK_DEBUG_PRINT_HOST(msg...) debug_printf(msg)
32#else
33#define VBLOCK_DEBUG_PRINT_HOST(msg...)
34#endif
35
36#if VBLOCK_DEBUG_GUEST
37#define VBLOCK_DEBUG_PRINT_GUEST(msg...) debug_printf(msg)
38#else
39#define VBLOCK_DEBUG_PRINT_GUEST(msg...)
40#endif
41
42#define VBLOCK_DEBUG_PRINT(msg...) VBLOCK_DEBUG_PRINT_HOST(msg) \
43                                   VBLOCK_DEBUG_PRINT_GUEST(msg)
44
45#ifdef VBLOCK_DEBUG_DEV_ENABLED
46#define VBLOCK_DEBUG_DEV(msg...) VBLOCK_DEBUG_PRINT("[dev] " msg)
47#else
48#define VBLOCK_DEBUG_DEV(msg...)
49#endif
50
51#ifdef VBLOCK_DEBUG_REQ_ENABLED
52#define VBLOCK_DEBUG_REQ(msg...) VBLOCK_DEBUG_PRINT("[req] " msg)
53#else
54#define VBLOCK_DEBUG_REQ(msg...)
55#endif
56
57#ifdef VBLOCK_DEBUG_SVC_ENABLED
58#define VBLOCK_DEBUG_SVC(msg...) VBLOCK_DEBUG_PRINT("[svc] " msg)
59#else
60#define VBLOCK_DEBUG_SVC(msg...)
61#endif
62
63#endif /* VBLOCK_DEBUG_H_ */
64