1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*
  27  * Copyright 2019, Joyent, Inc.
  28  */
  29 
  30 #ifndef _RDSIB_DEBUG_H
  31 #define _RDSIB_DEBUG_H
  32 
  33 #ifdef __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #define         LABEL   "RDS"
  38 
  39 /*
  40  * warnings, console & syslog buffer.
  41  * For Non recoverable or Major Errors
  42  */
  43 #define RDS_LOG_L0      0
  44 
  45 /*
  46  * syslog buffer or RDS trace buffer (console if booted /w debug)
  47  * For additional information on Non recoverable errors and
  48  * warnings/informational message for sys-admin types.
  49  */
  50 #define RDS_LOG_L1      1
  51 
  52 /*
  53  * debug only
  54  * for more verbose trace than L1, for e.g. recoverable errors,
  55  * or intersting trace
  56  */
  57 #define RDS_LOG_L2      2
  58 
  59 /*
  60  * debug only
  61  * for more verbose trace than L2, for e.g. informational messages
  62  */
  63 #define RDS_LOG_L3      3
  64 
  65 /*
  66  * debug only
  67  * for more verbose trace than L3, for e.g. printing function entries...
  68  */
  69 #define RDS_LOG_L4      4
  70 
  71 /*
  72  * debug only
  73  * most verbose level. Used only for  excessive trace, for e.g.
  74  * printing structures etc.
  75  */
  76 #define RDS_LOG_L5      5
  77 
  78 /*
  79  * debug only
  80  * for messages from softints, taskqs, intr handlers, timeout handlers etc.
  81  */
  82 #define RDS_LOG_LINTR   6
  83 
  84 
  85 #ifdef DEBUG
  86 #define RDS_DPRINTF_INTR        rds_dprintf_intr
  87 #define RDS_DPRINTF5            rds_dprintf5
  88 #define RDS_DPRINTF4            rds_dprintf4
  89 #define RDS_DPRINTF3            rds_dprintf3
  90 
  91 void rds_dprintf_intr(
  92                 char            *name,
  93                 char            *fmt, ...);
  94 void rds_dprintf5(
  95                 char            *name,
  96                 char            *fmt, ...);
  97 void rds_dprintf4(
  98                 char            *name,
  99                 char            *fmt, ...);
 100 void rds_dprintf3(
 101                 char            *name,
 102                 char            *fmt, ...);
 103 #else
 104 #define RDS_DPRINTF_INTR(...)   (void)(0)
 105 #define RDS_DPRINTF5(...)       (void)(0)
 106 #define RDS_DPRINTF4(...)       (void)(0)
 107 #define RDS_DPRINTF3(...)       (void)(0)
 108 #endif
 109 
 110 #define RDS_DPRINTF2    rds_dprintf2
 111 #define RDS_DPRINTF1    rds_dprintf1
 112 #define RDS_DPRINTF0    rds_dprintf0
 113 
 114 void rds_dprintf2(
 115                 char            *name,
 116                 char            *fmt, ...);
 117 void rds_dprintf1(
 118                 char            *name,
 119                 char            *fmt, ...);
 120 void rds_dprintf0(
 121                 char            *name,
 122                 char            *fmt, ...);
 123 
 124 #ifdef __cplusplus
 125 }
 126 #endif
 127 
 128 #endif  /* _RDSIB_DEBUG_H */