Print this page
10686 Debug macros causes smatch issues


   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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 




  25 #ifndef _RDSV3_DEBUG_H
  26 #define _RDSV3_DEBUG_H
  27 
  28 #ifdef __cplusplus
  29 extern "C" {
  30 #endif
  31 
  32 #define         LABEL   "RDSV3"
  33 
  34 /*
  35  * warnings, console & syslog buffer.
  36  * For Non recoverable or Major Errors
  37  */
  38 #define RDSV3_LOG_L0    0
  39 
  40 /*
  41  * syslog buffer or RDS trace buffer (console if booted /w debug)
  42  * For additional information on Non recoverable errors and
  43  * warnings/informational message for sys-admin types.
  44  */


  79 
  80 #ifdef DEBUG
  81 #define RDSV3_DPRINTF_INTR      rdsv3_dprintf_intr
  82 #define RDSV3_DPRINTF5          rdsv3_dprintf5
  83 #define RDSV3_DPRINTF4          rdsv3_dprintf4
  84 #define RDSV3_DPRINTF3          rdsv3_dprintf3
  85 
  86 void rdsv3_dprintf_intr(
  87                 char            *name,
  88                 char            *fmt, ...);
  89 void rdsv3_dprintf5(
  90                 char            *name,
  91                 char            *fmt, ...);
  92 void rdsv3_dprintf4(
  93                 char            *name,
  94                 char            *fmt, ...);
  95 void rdsv3_dprintf3(
  96                 char            *name,
  97                 char            *fmt, ...);
  98 #else
  99 #define RDSV3_DPRINTF_INTR      0 &&
 100 #define RDSV3_DPRINTF5          0 &&
 101 #define RDSV3_DPRINTF4          0 &&
 102 #define RDSV3_DPRINTF3          0 &&
 103 #endif
 104 
 105 #define RDSV3_DPRINTF2          rdsv3_dprintf2
 106 #define RDSV3_DPRINTF1          rdsv3_dprintf1
 107 #define RDSV3_DPRINTF0          rdsv3_dprintf0
 108 
 109 void rdsv3_dprintf2(
 110                 char            *name,
 111                 char            *fmt, ...);
 112 void rdsv3_dprintf1(
 113                 char            *name,
 114                 char            *fmt, ...);
 115 void rdsv3_dprintf0(
 116                 char            *name,
 117                 char            *fmt, ...);
 118 
 119 void rdsv3_trace(
 120                 char            *name,
 121                 uint8_t         lvl,
 122                 char            *fmt, ...);


   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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 
  25 /*
  26  * Copyright 2019, Joyent, Inc.
  27  */
  28 
  29 #ifndef _RDSV3_DEBUG_H
  30 #define _RDSV3_DEBUG_H
  31 
  32 #ifdef __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 #define         LABEL   "RDSV3"
  37 
  38 /*
  39  * warnings, console & syslog buffer.
  40  * For Non recoverable or Major Errors
  41  */
  42 #define RDSV3_LOG_L0    0
  43 
  44 /*
  45  * syslog buffer or RDS trace buffer (console if booted /w debug)
  46  * For additional information on Non recoverable errors and
  47  * warnings/informational message for sys-admin types.
  48  */


  83 
  84 #ifdef DEBUG
  85 #define RDSV3_DPRINTF_INTR      rdsv3_dprintf_intr
  86 #define RDSV3_DPRINTF5          rdsv3_dprintf5
  87 #define RDSV3_DPRINTF4          rdsv3_dprintf4
  88 #define RDSV3_DPRINTF3          rdsv3_dprintf3
  89 
  90 void rdsv3_dprintf_intr(
  91                 char            *name,
  92                 char            *fmt, ...);
  93 void rdsv3_dprintf5(
  94                 char            *name,
  95                 char            *fmt, ...);
  96 void rdsv3_dprintf4(
  97                 char            *name,
  98                 char            *fmt, ...);
  99 void rdsv3_dprintf3(
 100                 char            *name,
 101                 char            *fmt, ...);
 102 #else
 103 #define RDSV3_DPRINTF_INTR(...)
 104 #define RDSV3_DPRINTF5(...)
 105 #define RDSV3_DPRINTF4(...)
 106 #define RDSV3_DPRINTF3(...)
 107 #endif
 108 
 109 #define RDSV3_DPRINTF2          rdsv3_dprintf2
 110 #define RDSV3_DPRINTF1          rdsv3_dprintf1
 111 #define RDSV3_DPRINTF0          rdsv3_dprintf0
 112 
 113 void rdsv3_dprintf2(
 114                 char            *name,
 115                 char            *fmt, ...);
 116 void rdsv3_dprintf1(
 117                 char            *name,
 118                 char            *fmt, ...);
 119 void rdsv3_dprintf0(
 120                 char            *name,
 121                 char            *fmt, ...);
 122 
 123 void rdsv3_trace(
 124                 char            *name,
 125                 uint8_t         lvl,
 126                 char            *fmt, ...);