]> git.proxmox.com Git - mirror_zfs.git/blob - include/sys/trace_dbgmsg.h
ztest: scrub ddt repair
[mirror_zfs.git] / include / sys / trace_dbgmsg.h
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 /* Do not include this file directly. Please use <sys/trace.h> instead. */
23 #ifndef _SYS_TRACE_DBGMSG_INDIRECT
24 #error "trace_dbgmsg.h included directly"
25 #endif
26
27 /*
28 * This file defines tracepoint events for use by the dbgmsg(),
29 * dprintf(), and SET_ERROR() interfaces. These are grouped here because
30 * they all provide a way to store simple messages in the debug log (as
31 * opposed to events used by the DTRACE_PROBE interfaces which typically
32 * dump structured data).
33 *
34 * This header is included inside the trace.h multiple inclusion guard,
35 * and it is guarded above against direct inclusion, so it and need not
36 * be guarded separately.
37 */
38
39 /*
40 * Generic support for one argument tracepoints of the form:
41 *
42 * DTRACE_PROBE1(...,
43 * const char *, ...);
44 */
45 /* BEGIN CSTYLED */
46 DECLARE_EVENT_CLASS(zfs_dprintf_class,
47 TP_PROTO(const char *msg),
48 TP_ARGS(msg),
49 TP_STRUCT__entry(
50 __string(msg, msg)
51 ),
52 TP_fast_assign(
53 __assign_str(msg, msg);
54 ),
55 TP_printk("%s", __get_str(msg))
56 );
57 /* END CSTYLED */
58
59 /* BEGIN CSTYLED */
60 #define DEFINE_DPRINTF_EVENT(name) \
61 DEFINE_EVENT(zfs_dprintf_class, name, \
62 TP_PROTO(const char *msg), \
63 TP_ARGS(msg))
64 /* END CSTYLED */
65 DEFINE_DPRINTF_EVENT(zfs_zfs__dprintf);