xref: /onnv-gate/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_debug.h (revision 12414:c6b8d642b079)
112198SEiji.Ota@Sun.COM /*
212198SEiji.Ota@Sun.COM  * CDDL HEADER START
312198SEiji.Ota@Sun.COM  *
412198SEiji.Ota@Sun.COM  * The contents of this file are subject to the terms of the
512198SEiji.Ota@Sun.COM  * Common Development and Distribution License (the "License").
612198SEiji.Ota@Sun.COM  * You may not use this file except in compliance with the License.
712198SEiji.Ota@Sun.COM  *
812198SEiji.Ota@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
912198SEiji.Ota@Sun.COM  * or http://www.opensolaris.org/os/licensing.
1012198SEiji.Ota@Sun.COM  * See the License for the specific language governing permissions
1112198SEiji.Ota@Sun.COM  * and limitations under the License.
1212198SEiji.Ota@Sun.COM  *
1312198SEiji.Ota@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
1412198SEiji.Ota@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1512198SEiji.Ota@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
1612198SEiji.Ota@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
1712198SEiji.Ota@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
1812198SEiji.Ota@Sun.COM  *
1912198SEiji.Ota@Sun.COM  * CDDL HEADER END
2012198SEiji.Ota@Sun.COM  */
2112198SEiji.Ota@Sun.COM /*
2212198SEiji.Ota@Sun.COM  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2312198SEiji.Ota@Sun.COM  */
2412198SEiji.Ota@Sun.COM 
2512198SEiji.Ota@Sun.COM #ifndef _RDSV3_DEBUG_H
2612198SEiji.Ota@Sun.COM #define	_RDSV3_DEBUG_H
2712198SEiji.Ota@Sun.COM 
2812198SEiji.Ota@Sun.COM #ifdef __cplusplus
2912198SEiji.Ota@Sun.COM extern "C" {
3012198SEiji.Ota@Sun.COM #endif
3112198SEiji.Ota@Sun.COM 
3212198SEiji.Ota@Sun.COM #define		LABEL	"RDSV3"
3312198SEiji.Ota@Sun.COM 
3412198SEiji.Ota@Sun.COM /*
3512198SEiji.Ota@Sun.COM  * warnings, console & syslog buffer.
3612198SEiji.Ota@Sun.COM  * For Non recoverable or Major Errors
3712198SEiji.Ota@Sun.COM  */
3812198SEiji.Ota@Sun.COM #define	RDSV3_LOG_L0	0
3912198SEiji.Ota@Sun.COM 
4012198SEiji.Ota@Sun.COM /*
4112198SEiji.Ota@Sun.COM  * syslog buffer or RDS trace buffer (console if booted /w debug)
4212198SEiji.Ota@Sun.COM  * For additional information on Non recoverable errors and
4312198SEiji.Ota@Sun.COM  * warnings/informational message for sys-admin types.
4412198SEiji.Ota@Sun.COM  */
4512198SEiji.Ota@Sun.COM #define	RDSV3_LOG_L1	1
4612198SEiji.Ota@Sun.COM 
4712198SEiji.Ota@Sun.COM /*
4812198SEiji.Ota@Sun.COM  * debug only
4912198SEiji.Ota@Sun.COM  * for more verbose trace than L1, for e.g. recoverable errors,
5012198SEiji.Ota@Sun.COM  * or intersting trace
5112198SEiji.Ota@Sun.COM  */
5212198SEiji.Ota@Sun.COM #define	RDSV3_LOG_L2	2
5312198SEiji.Ota@Sun.COM 
5412198SEiji.Ota@Sun.COM /*
5512198SEiji.Ota@Sun.COM  * debug only
5612198SEiji.Ota@Sun.COM  * for more verbose trace than L2, for e.g. informational messages
5712198SEiji.Ota@Sun.COM  */
5812198SEiji.Ota@Sun.COM #define	RDSV3_LOG_L3	3
5912198SEiji.Ota@Sun.COM 
6012198SEiji.Ota@Sun.COM /*
6112198SEiji.Ota@Sun.COM  * debug only
6212198SEiji.Ota@Sun.COM  * for more verbose trace than L3, for e.g. printing function entries...
6312198SEiji.Ota@Sun.COM  */
6412198SEiji.Ota@Sun.COM #define	RDSV3_LOG_L4	4
6512198SEiji.Ota@Sun.COM 
6612198SEiji.Ota@Sun.COM /*
6712198SEiji.Ota@Sun.COM  * debug only
6812198SEiji.Ota@Sun.COM  * most verbose level. Used only for  excessive trace, for e.g.
6912198SEiji.Ota@Sun.COM  * printing structures etc.
7012198SEiji.Ota@Sun.COM  */
7112198SEiji.Ota@Sun.COM #define	RDSV3_LOG_L5	5
7212198SEiji.Ota@Sun.COM 
7312198SEiji.Ota@Sun.COM /*
7412198SEiji.Ota@Sun.COM  * debug only
7512198SEiji.Ota@Sun.COM  * for messages from softints, taskqs, intr handlers, timeout handlers etc.
7612198SEiji.Ota@Sun.COM  */
7712198SEiji.Ota@Sun.COM #define	RDSV3_LOG_LINTR	6
7812198SEiji.Ota@Sun.COM 
7912198SEiji.Ota@Sun.COM 
8012198SEiji.Ota@Sun.COM #ifdef DEBUG
8112198SEiji.Ota@Sun.COM #define	RDSV3_DPRINTF_INTR	rdsv3_dprintf_intr
8212198SEiji.Ota@Sun.COM #define	RDSV3_DPRINTF5		rdsv3_dprintf5
8312198SEiji.Ota@Sun.COM #define	RDSV3_DPRINTF4		rdsv3_dprintf4
8412198SEiji.Ota@Sun.COM #define	RDSV3_DPRINTF3		rdsv3_dprintf3
8512198SEiji.Ota@Sun.COM 
8612198SEiji.Ota@Sun.COM void rdsv3_dprintf_intr(
8712198SEiji.Ota@Sun.COM 		char		*name,
8812198SEiji.Ota@Sun.COM 		char		*fmt, ...);
8912198SEiji.Ota@Sun.COM void rdsv3_dprintf5(
9012198SEiji.Ota@Sun.COM 		char		*name,
9112198SEiji.Ota@Sun.COM 		char		*fmt, ...);
9212198SEiji.Ota@Sun.COM void rdsv3_dprintf4(
9312198SEiji.Ota@Sun.COM 		char		*name,
9412198SEiji.Ota@Sun.COM 		char		*fmt, ...);
9512198SEiji.Ota@Sun.COM void rdsv3_dprintf3(
9612198SEiji.Ota@Sun.COM 		char		*name,
9712198SEiji.Ota@Sun.COM 		char		*fmt, ...);
9812320SGiri.Adari@Sun.COM #else
9912320SGiri.Adari@Sun.COM #define	RDSV3_DPRINTF_INTR	0 &&
10012320SGiri.Adari@Sun.COM #define	RDSV3_DPRINTF5		0 &&
10112320SGiri.Adari@Sun.COM #define	RDSV3_DPRINTF4		0 &&
10212320SGiri.Adari@Sun.COM #define	RDSV3_DPRINTF3		0 &&
10312320SGiri.Adari@Sun.COM #endif
10412320SGiri.Adari@Sun.COM 
10512320SGiri.Adari@Sun.COM #define	RDSV3_DPRINTF2		rdsv3_dprintf2
10612320SGiri.Adari@Sun.COM #define	RDSV3_DPRINTF1		rdsv3_dprintf1
10712320SGiri.Adari@Sun.COM #define	RDSV3_DPRINTF0		rdsv3_dprintf0
10812320SGiri.Adari@Sun.COM 
10912198SEiji.Ota@Sun.COM void rdsv3_dprintf2(
11012198SEiji.Ota@Sun.COM 		char		*name,
11112198SEiji.Ota@Sun.COM 		char		*fmt, ...);
11212198SEiji.Ota@Sun.COM void rdsv3_dprintf1(
11312198SEiji.Ota@Sun.COM 		char		*name,
11412198SEiji.Ota@Sun.COM 		char		*fmt, ...);
11512198SEiji.Ota@Sun.COM void rdsv3_dprintf0(
11612198SEiji.Ota@Sun.COM 		char		*name,
11712198SEiji.Ota@Sun.COM 		char		*fmt, ...);
11812198SEiji.Ota@Sun.COM 
11912198SEiji.Ota@Sun.COM void rdsv3_trace(
12012198SEiji.Ota@Sun.COM 		char		*name,
12112198SEiji.Ota@Sun.COM 		uint8_t		lvl,
12212198SEiji.Ota@Sun.COM 		char		*fmt, ...);
12312198SEiji.Ota@Sun.COM 
12412198SEiji.Ota@Sun.COM void rdsv3_vprintk(
12512198SEiji.Ota@Sun.COM 		char		*name,
12612198SEiji.Ota@Sun.COM 		uint8_t		lvl,
12712198SEiji.Ota@Sun.COM 		const char	*fmt,
12812198SEiji.Ota@Sun.COM 		va_list		ap);
12912198SEiji.Ota@Sun.COM 
13012198SEiji.Ota@Sun.COM /* defined in rds_debug.c */
13112198SEiji.Ota@Sun.COM void rdsv3_logging_initialization();
13212198SEiji.Ota@Sun.COM void rdsv3_logging_destroy();
133*12414SEiji.Ota@Sun.COM int rdsv3_printk_ratelimit(void);
13412198SEiji.Ota@Sun.COM 
13512198SEiji.Ota@Sun.COM #ifdef __cplusplus
13612198SEiji.Ota@Sun.COM }
13712198SEiji.Ota@Sun.COM #endif
13812198SEiji.Ota@Sun.COM 
13912198SEiji.Ota@Sun.COM #endif	/* _RDSV3_DEBUG_H */
140