rdsv3_debug.c revision c0dd49bdd68c0d758a67d56f07826f3b45cfc664
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/*
* This file contains the debug defines and routines.
* Debugging information is collected in a circular kernel buffer. Debug
* messages with level lower than rdsv3dbglvl are ignored. The size of the
* of the debug buffer can be changed by setting 'rdsv3_debug_buf_size' in
*
* The debug buffer can be cleared by setting 'rdsv3_clear_debug_buf_flag = 1'
* on a running system.
*/
#define RDSV3_DEBUG_SIZE_EXTRA_ALLOC 8
#define RDSV3_MIN_DEBUG_BUF_SIZE 0x1000
#define RDSV3_FUNCNAME_LEN 40
#define RDSV3_PRINTBUF_LEN 4096
#ifdef DEBUG
#else
#define RDSV3_DEBUG_BUF_SIZE 0x2000
#endif /* DEBUG */
/* Max length of a debug statement */
#define RDSV3_PRINT_BUF_LEN 4096
static int rdsv3_suppress_dprintf; /* Suppress debug printing */
static int rdsv3_allow_intr_msgs = 0; /* log "intr" messages */
int rdsv3_clear_debug_buf_flag = 0; /* Clear debug buffer */
/*
* Print Buffer protected by mutex for debug stuff. The mutex also
* ensures serializing debug messages.
*/
static kmutex_t rdsv3_debug_mutex;
static char rdsv3_print_buf[RDSV3_PRINT_BUF_LEN];
/* Function Prototypes */
static void rdsv3_clear_print_buf();
/* RDS logging init */
void
{
}
/* if it is less that RDSV3_MIN_DEBUG_BUF_SIZE, adjust it */
"adjusted to %x", rdsv3_debug_buf_size);
}
}
/* RDS logging destroy */
void
{
if (rdsv3_debug_buf) {
}
}
/*
* debug, log, and console message handling
*/
/*
* clear the RDS debug buffer
*/
static void
{
if (rdsv3_debug_buf) {
}
}
static void
{
char *msg_ptr;
/* if not using logging scheme; quit */
return;
}
/* If user requests to clear debug buffer, go ahead */
if (rdsv3_clear_debug_buf_flag != 0) {
}
/*
* put "label" into the buffer
*/
/*
* stuff the message in the debug buf
*/
if (rdsv3_buffer_dprintf) {
/*
* overwrite >>>> that might be over the end of the
* the buffer
*/
*rdsv3_buf_sptr = '\0';
} else {
rdsv3_buf_sptr += len;
}
/* add marker */
}
/*
* LINTR, L5-L2 message may go to the rdsv3_debug_buf
* L0 messages will go to console (debug & non-debug).
*/
switch (level) {
case RDSV3_LOG_LINTR:
case RDSV3_LOG_L5:
case RDSV3_LOG_L4:
case RDSV3_LOG_L3:
case RDSV3_LOG_L2:
if (!rdsv3_buffer_dprintf) {
}
break;
case RDSV3_LOG_L1:
if (!rdsv3_buffer_dprintf) {
} else {
/* go to messages file */
}
break;
case RDSV3_LOG_L0:
/* Strip the "\n" added earlier */
}
}
/* go to console */
break;
}
}
void
{
}
/*
* Check individual subsystem err levels
*/
#define RDSV3_CHECK_ERR_LEVEL(level) \
if (rdsv3dbglvl < level) \
return; \
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
/*
* Function:
* rdsv3_dprintf0
* Input:
* name - Name of the function generating the debug message
* fmt - The message to be displayed.
* Output:
* none
* Returns:
* none
* Description:
* A generic log function to display RDS debug messages.
*/
void
{
}
/* For ofed rdstrace */
void
{
}