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 VIRTIO_DEBUG_H_
11#define VIRTIO_DEBUG_H_
12
13/// Global VirtIO debug switch
14#define VIRTIO_DEBUG_ENABLED 1
15
16/// Enables the virtqueue debugging
17#define VIRTIO_DEBUG_VQ_ENABLED 1
18
19/// Enables the VirtIO general device debugging messages
20#define VIRTIO_DEBUG_DEV_ENABLED 1
21
22/// Enables the VirtIO device specific debugging messages
23#define VIRTIO_DEBUG_DT_ENABLED 1
24
25/// Enables the VirtIO transport layer debug messages
26#define VIRTIO_DEBUG_TL_ENABLED 1
27
28/// Enables the VirtIO management layer debug messages
29#define VIRTIO_DEBUG_CHAN_ENABLED 1
30
31#define VIRTIO_DEBUG_BUF_ENABELD 1
32
33#if VIRTIO_DEBUG_ENABLED
34#define VIRTIO_DEBUG_PRINT(msg...) debug_printf(msg)
35#else
36#define VIRTIO_DEBUG_PRINT(msg...)
37#endif
38
39#ifdef VIRTIO_DEBUG_VQ_ENABLED
40#define VIRTIO_DEBUG_VQ(msg...) VIRTIO_DEBUG_PRINT("[virtq] " msg)
41#else
42#define VIRTIO_DEBUG_VQ(msg...)
43#endif
44
45#ifdef VIRTIO_DEBUG_DEV_ENABLED
46#define VIRTIO_DEBUG_DEV(msg...) VIRTIO_DEBUG_PRINT("[virtio dev] " msg)
47#else
48#define VIRTIO_DEBUG_DEV(msg...)
49#endif
50
51#ifdef VIRTIO_DEBUG_DT_ENABLED
52#define VIRTIO_DEBUG_DT(msg...) VIRTIO_DEBUG_PRINT("[virtio type] " msg)
53#else
54#define VIRTIO_DEBUG_DT(msg...)
55#endif
56
57#ifdef VIRTIO_DEBUG_TL_ENABLED
58#define VIRTIO_DEBUG_TL(msg...) VIRTIO_DEBUG_PRINT("[virtio tl] " msg)
59#else
60#define VIRTIO_DEBUG_TL(msg...)
61#endif
62
63#ifdef VIRTIO_DEBUG_CHAN_ENABLED
64#define VIRTIO_DEBUG_CHAN(msg...) VIRTIO_DEBUG_PRINT("[virtio chan] " msg)
65#else
66#define VIRTIO_DEBUG_CHAN(msg...)
67#endif
68
69#ifdef VIRTIO_DEBUG_BUF_ENABELD
70#define VIRTIO_DEBUG_BUF(msg...) VIRTIO_DEBUG_PRINT("[virtio buf] " msg)
71#else
72#define VIRTIO_DEBUG_BUF(msg...)
73#endif
74#endif /* VIRTIO_DEBUG_H_ */
75