]> git.proxmox.com Git - mirror_ovs.git/blame - datapath-windows/ovsext/Debug.h
ovn-controller-vtep.at: Check the successful exit of ovn-controller-vtep.
[mirror_ovs.git] / datapath-windows / ovsext / Debug.h
CommitLineData
c803536e
SS
1/*
2 * Copyright (c) 2014 VMware, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
fa1324c9
SG
17#ifndef __DEBUG_H_
18#define __DEBUG_H_ 1
c803536e
SS
19
20#define OVS_DBG_INIT BIT32(0)
21#define OVS_DBG_SWITCH BIT32(1)
22#define OVS_DBG_VPORT BIT32(2)
23#define OVS_DBG_FLOW BIT32(3)
24#define OVS_DBG_QOS BIT32(4)
25#define OVS_DBG_USER BIT32(5)
26#define OVS_DBG_EXECUTE BIT32(6)
27#define OVS_DBG_EVENT BIT32(7)
28#define OVS_DBG_DISPATCH BIT32(8)
29#define OVS_DBG_OID BIT32(9)
30#define OVS_DBG_STATUS BIT32(10)
31#define OVS_DBG_CHECKSUM BIT32(11)
32#define OVS_DBG_VXLAN BIT32(12)
33#define OVS_DBG_GRE BIT32(13)
34#define OVS_DBG_GRE64 BIT32(14)
35#define OVS_DBG_ACTION BIT32(15)
4f3988e0 36#define OVS_DBG_DATAPATH BIT32(16)
c803536e
SS
37#define OVS_DBG_PROPERTY BIT32(17)
38#define OVS_DBG_IPHELPER BIT32(18)
39#define OVS_DBG_BUFMGMT BIT32(19)
40#define OVS_DBG_OTHERS BIT32(21)
d838e577 41#define OVS_DBG_NETLINK BIT32(22)
be92b251 42#define OVS_DBG_TUNFLT BIT32(23)
022c2040 43#define OVS_DBG_STT BIT32(24)
c803536e
SS
44
45#define OVS_DBG_RESERVED BIT32(31)
46//Please add above OVS_DBG_RESERVED.
47
48#define OVS_DBG_ERROR DPFLTR_ERROR_LEVEL
49#define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
50#define OVS_DBG_TRACE DPFLTR_TRACE_LEVEL
51#define OVS_DBG_INFO DPFLTR_INFO_LEVEL
52#define OVS_DBG_LOUD (DPFLTR_INFO_LEVEL + 1)
53
54
55
56VOID OvsLog(UINT32 level, UINT32 flag, CHAR *funcName,
57 UINT32 line, CHAR *format, ...);
58
59
60#define OVS_LOG_LOUD(_format, ...) \
61 OvsLog(OVS_DBG_LOUD, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
62
63#define OVS_LOG_INFO(_format, ...) \
64 OvsLog(OVS_DBG_INFO, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
65
66#define OVS_LOG_TRACE(_format, ...) \
67 OvsLog(OVS_DBG_TRACE, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
68
69#define OVS_LOG_ERROR(_format, ...) \
70 OvsLog(OVS_DBG_ERROR, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
71
72#define OVS_LOG_WARN(_format, ...) \
73 OvsLog(OVS_DBG_WARN, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
74
75#if DBG
76#define OVS_VERIFY_IRQL(_x) \
77 if (KeGetCurrentIrql() != (KIRQL)_x) { \
78 OVS_LOG_WARN("expected IRQL %u, actual IRQL: %u", \
79 _x, KeGetCurrentIrql()); \
80 }
81
82#define OVS_VERIFY_IRQL_LE(_x) \
83 if (KeGetCurrentIrql() > (KIRQL)_x) { \
84 OVS_LOG_WARN("expected IRQL <= %u, actual IRQL: %u", \
85 _x, KeGetCurrentIrql()); \
86 }
87
88#else
89#define OVS_VERIFY_IRQL(_x)
90#define OVS_VERIFY_IRQL_LE(_x)
91#endif
92
fa1324c9 93#endif /* __DEBUG_H_ */