Cleaning up uio headers
[zfs.git] / include / os / linux / zfs / sys / trace_dbgmsg.h
blob513918d004a4f830d4b504f52ba0a29c2034d8a2
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 #if defined(_KERNEL)
23 #if defined(HAVE_DECLARE_EVENT_CLASS)
25 #undef TRACE_SYSTEM
26 #define TRACE_SYSTEM zfs
28 #undef TRACE_SYSTEM_VAR
29 #define TRACE_SYSTEM_VAR zfs_dbgmsg
31 #if !defined(_TRACE_DBGMSG_H) || defined(TRACE_HEADER_MULTI_READ)
32 #define _TRACE_DBGMSG_H
34 #include <linux/tracepoint.h>
37 * This file defines tracepoint events for use by the dbgmsg(),
38 * dprintf(), and SET_ERROR() interfaces. These are grouped here because
39 * they all provide a way to store simple messages in the debug log (as
40 * opposed to events used by the DTRACE_PROBE interfaces which typically
41 * dump structured data).
43 * This header is included inside the trace.h multiple inclusion guard,
44 * and it is guarded above against direct inclusion, so it and need not
45 * be guarded separately.
49 * Generic support for one argument tracepoints of the form:
51 * DTRACE_PROBE1(...,
52 * const char *, ...);
54 /* BEGIN CSTYLED */
55 DECLARE_EVENT_CLASS(zfs_dprintf_class,
56 TP_PROTO(const char *msg),
57 TP_ARGS(msg),
58 TP_STRUCT__entry(
59 __string(msg, msg)
61 TP_fast_assign(
62 __assign_str(msg, msg);
64 TP_printk("%s", __get_str(msg))
66 /* END CSTYLED */
68 /* BEGIN CSTYLED */
69 #define DEFINE_DPRINTF_EVENT(name) \
70 DEFINE_EVENT(zfs_dprintf_class, name, \
71 TP_PROTO(const char *msg), \
72 TP_ARGS(msg))
73 /* END CSTYLED */
74 DEFINE_DPRINTF_EVENT(zfs_zfs__dprintf);
76 #endif /* _TRACE_DBGMSG_H */
78 #undef TRACE_INCLUDE_PATH
79 #undef TRACE_INCLUDE_FILE
80 #define TRACE_INCLUDE_PATH sys
81 #define TRACE_INCLUDE_FILE trace_dbgmsg
82 #include <trace/define_trace.h>
84 #else
86 DEFINE_DTRACE_PROBE1(zfs__dprintf);
88 #endif /* HAVE_DECLARE_EVENT_CLASS */
89 #endif /* _KERNEL */