zfs_debug.c revision 9fa718d2f477620f14e3f2948dd03e3470add804
/*
* 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
*/
/*
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
int zfs_dbgmsg_size;
void
zfs_dbgmsg_init(void)
{
}
void
zfs_dbgmsg_fini(void)
{
zfs_dbgmsg_size -= size;
}
}
/*
* Print these messages by running:
* echo ::zfs_dbgmsg | mdb -k
*
* Monitor these messages by running:
* dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}'
*/
void
zfs_dbgmsg(const char *fmt, ...)
{
int size;
/*
* There is one byte of string in sizeof (zfs_dbgmsg_t), used
* for the terminating null.
*/
while (zfs_dbgmsg_size > zfs_dbgmsg_maxsize) {
zfs_dbgmsg_size -= size;
}
}