zfs_debug.c (219089) | zfs_debug.c (240415) |
---|---|
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 --- 6 unchanged lines hidden (view full) --- 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. | 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 --- 6 unchanged lines hidden (view full) --- 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 * Copyright (c) 2012 by Delphix. All rights reserved. |
|
23 */ 24 25#include <sys/zfs_context.h> 26 27list_t zfs_dbgmsgs; 28int zfs_dbgmsg_size; 29kmutex_t zfs_dbgmsgs_lock; 30int zfs_dbgmsg_maxsize = 1<<20; /* 1MB */ --- 12 unchanged lines hidden (view full) --- 43 zfs_dbgmsg_t *zdm; 44 45 while ((zdm = list_remove_head(&zfs_dbgmsgs)) != NULL) { 46 int size = sizeof (zfs_dbgmsg_t) + strlen(zdm->zdm_msg); 47 kmem_free(zdm, size); 48 zfs_dbgmsg_size -= size; 49 } 50 mutex_destroy(&zfs_dbgmsgs_lock); | 24 */ 25 26#include <sys/zfs_context.h> 27 28list_t zfs_dbgmsgs; 29int zfs_dbgmsg_size; 30kmutex_t zfs_dbgmsgs_lock; 31int zfs_dbgmsg_maxsize = 1<<20; /* 1MB */ --- 12 unchanged lines hidden (view full) --- 44 zfs_dbgmsg_t *zdm; 45 46 while ((zdm = list_remove_head(&zfs_dbgmsgs)) != NULL) { 47 int size = sizeof (zfs_dbgmsg_t) + strlen(zdm->zdm_msg); 48 kmem_free(zdm, size); 49 zfs_dbgmsg_size -= size; 50 } 51 mutex_destroy(&zfs_dbgmsgs_lock); |
51 ASSERT3U(zfs_dbgmsg_size, ==, 0); | 52 ASSERT0(zfs_dbgmsg_size); |
52} 53 54/* 55 * Print these messages by running: | 53} 54 55/* 56 * Print these messages by running: |
56 * echo ::zfs_dbgmsg | mdb -k | 57 * echo ::zfs_dbgmsg | mdb -k |
57 * 58 * Monitor these messages by running: 59 * dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' 60 */ 61void 62zfs_dbgmsg(const char *fmt, ...) 63{ 64 int size; --- 31 unchanged lines hidden --- | 58 * 59 * Monitor these messages by running: 60 * dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' 61 */ 62void 63zfs_dbgmsg(const char *fmt, ...) 64{ 65 int size; --- 31 unchanged lines hidden --- |