Print this page
10686 Debug macros causes smatch issues
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_debug.h
+++ new/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_debug.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23 23 */
24 24
25 +/*
26 + * Copyright 2019, Joyent, Inc.
27 + */
28 +
25 29 #ifndef _RDSV3_DEBUG_H
26 30 #define _RDSV3_DEBUG_H
27 31
28 32 #ifdef __cplusplus
29 33 extern "C" {
30 34 #endif
31 35
32 36 #define LABEL "RDSV3"
33 37
34 38 /*
35 39 * warnings, console & syslog buffer.
36 40 * For Non recoverable or Major Errors
37 41 */
38 42 #define RDSV3_LOG_L0 0
39 43
40 44 /*
41 45 * syslog buffer or RDS trace buffer (console if booted /w debug)
42 46 * For additional information on Non recoverable errors and
43 47 * warnings/informational message for sys-admin types.
44 48 */
45 49 #define RDSV3_LOG_L1 1
46 50
47 51 /*
48 52 * debug only
49 53 * for more verbose trace than L1, for e.g. recoverable errors,
50 54 * or intersting trace
51 55 */
52 56 #define RDSV3_LOG_L2 2
53 57
54 58 /*
55 59 * debug only
56 60 * for more verbose trace than L2, for e.g. informational messages
57 61 */
58 62 #define RDSV3_LOG_L3 3
59 63
60 64 /*
61 65 * debug only
62 66 * for more verbose trace than L3, for e.g. printing function entries...
63 67 */
64 68 #define RDSV3_LOG_L4 4
65 69
66 70 /*
67 71 * debug only
68 72 * most verbose level. Used only for excessive trace, for e.g.
69 73 * printing structures etc.
70 74 */
71 75 #define RDSV3_LOG_L5 5
72 76
73 77 /*
74 78 * debug only
75 79 * for messages from softints, taskqs, intr handlers, timeout handlers etc.
76 80 */
77 81 #define RDSV3_LOG_LINTR 6
78 82
79 83
80 84 #ifdef DEBUG
81 85 #define RDSV3_DPRINTF_INTR rdsv3_dprintf_intr
82 86 #define RDSV3_DPRINTF5 rdsv3_dprintf5
83 87 #define RDSV3_DPRINTF4 rdsv3_dprintf4
84 88 #define RDSV3_DPRINTF3 rdsv3_dprintf3
85 89
86 90 void rdsv3_dprintf_intr(
87 91 char *name,
88 92 char *fmt, ...);
↓ open down ↓ |
54 lines elided |
↑ open up ↑ |
89 93 void rdsv3_dprintf5(
90 94 char *name,
91 95 char *fmt, ...);
92 96 void rdsv3_dprintf4(
93 97 char *name,
94 98 char *fmt, ...);
95 99 void rdsv3_dprintf3(
96 100 char *name,
97 101 char *fmt, ...);
98 102 #else
99 -#define RDSV3_DPRINTF_INTR 0 &&
100 -#define RDSV3_DPRINTF5 0 &&
101 -#define RDSV3_DPRINTF4 0 &&
102 -#define RDSV3_DPRINTF3 0 &&
103 +#define RDSV3_DPRINTF_INTR(...)
104 +#define RDSV3_DPRINTF5(...)
105 +#define RDSV3_DPRINTF4(...)
106 +#define RDSV3_DPRINTF3(...)
103 107 #endif
104 108
105 109 #define RDSV3_DPRINTF2 rdsv3_dprintf2
106 110 #define RDSV3_DPRINTF1 rdsv3_dprintf1
107 111 #define RDSV3_DPRINTF0 rdsv3_dprintf0
108 112
109 113 void rdsv3_dprintf2(
110 114 char *name,
111 115 char *fmt, ...);
112 116 void rdsv3_dprintf1(
113 117 char *name,
114 118 char *fmt, ...);
115 119 void rdsv3_dprintf0(
116 120 char *name,
117 121 char *fmt, ...);
118 122
119 123 void rdsv3_trace(
120 124 char *name,
121 125 uint8_t lvl,
122 126 char *fmt, ...);
123 127
124 128 void rdsv3_vprintk(
125 129 char *name,
126 130 uint8_t lvl,
127 131 const char *fmt,
128 132 va_list ap);
129 133
130 134 /* defined in rds_debug.c */
131 135 void rdsv3_logging_initialization();
132 136 void rdsv3_logging_destroy();
133 137 int rdsv3_printk_ratelimit(void);
134 138
135 139 #ifdef __cplusplus
136 140 }
137 141 #endif
138 142
139 143 #endif /* _RDSV3_DEBUG_H */
↓ open down ↓ |
27 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX