]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - zfs/include/sys/trace_dbgmsg.h
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]
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"
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).
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.
40 * Generic support for four argument tracepoints of the form:
49 DECLARE_EVENT_CLASS(zfs_dprintf_class
,
50 TP_PROTO(const char *file
, const char *function
, int line
,
52 TP_ARGS(file
, function
, line
, msg
),
54 __field(const char *, file
)
55 __field(const char *, function
)
61 __entry
->function
= function
;
63 __assign_str(msg
, msg
);
65 TP_printk("%s:%d:%s(): %s", __entry
->file
, __entry
->line
,
66 __entry
->function
, __get_str(msg
))
69 #define DEFINE_DPRINTF_EVENT(name) \
70 DEFINE_EVENT(zfs_dprintf_class, name, \
71 TP_PROTO(const char *file, const char *function, int line, \
73 TP_ARGS(file, function, line, msg))
74 DEFINE_DPRINTF_EVENT(zfs_zfs__dprintf
);
77 * Generic support for four argument tracepoints of the form:
86 DECLARE_EVENT_CLASS(zfs_set_error_class
,
87 TP_PROTO(const char *file
, const char *function
, int line
,
89 TP_ARGS(file
, function
, line
, error
),
91 __field(const char *, file
)
92 __field(const char *, function
)
94 __field(uintptr_t, error
)
97 __entry
->file
= strchr(file
, '/') ? strrchr(file
, '/') + 1 : file
;
98 __entry
->function
= function
;
100 __entry
->error
= error
;
102 TP_printk("%s:%d:%s(): error 0x%lx", __entry
->file
, __entry
->line
,
103 __entry
->function
, __entry
->error
)
106 #define DEFINE_SET_ERROR_EVENT(name) \
107 DEFINE_EVENT(zfs_set_error_class, name, \
108 TP_PROTO(const char *file, const char *function, int line, \
110 TP_ARGS(file, function, line, error))
111 DEFINE_SET_ERROR_EVENT(zfs_set__error
);