]> git.proxmox.com Git - mirror_zfs.git/blame - include/sys/trace.h
Add CODE_OF_CONDUCT.md
[mirror_zfs.git] / include / sys / trace.h
CommitLineData
0b39b9f9
PS
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 */
0b39b9f9
PS
21
22#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
23
24#undef TRACE_SYSTEM
25#define TRACE_SYSTEM zfs
26
27#if !defined(_TRACE_ZFS_H) || defined(TRACE_HEADER_MULTI_READ)
28#define _TRACE_ZFS_H
29
30#include <linux/tracepoint.h>
31#include <sys/types.h>
49ee64e5
NB
32
33/*
34 * The sys/trace_dbgmsg.h header defines tracepoint events for
35 * dprintf(), dbgmsg(), and SET_ERROR().
36 */
37#define _SYS_TRACE_DBGMSG_INDIRECT
38#include <sys/trace_dbgmsg.h>
39#undef _SYS_TRACE_DBGMSG_INDIRECT
0b39b9f9
PS
40
41/*
42 * Redefine the DTRACE_PROBE* functions to use Linux tracepoints
43 */
44#undef DTRACE_PROBE1
45#define DTRACE_PROBE1(name, t1, arg1) \
46 trace_zfs_##name((arg1))
47
48#undef DTRACE_PROBE2
49#define DTRACE_PROBE2(name, t1, arg1, t2, arg2) \
50 trace_zfs_##name((arg1), (arg2))
51
52#undef DTRACE_PROBE3
53#define DTRACE_PROBE3(name, t1, arg1, t2, arg2, t3, arg3) \
54 trace_zfs_##name((arg1), (arg2), (arg3))
55
56#undef DTRACE_PROBE4
57#define DTRACE_PROBE4(name, t1, arg1, t2, arg2, t3, arg3, t4, arg4) \
58 trace_zfs_##name((arg1), (arg2), (arg3), (arg4))
59
0b39b9f9
PS
60#endif /* _TRACE_ZFS_H */
61
62#undef TRACE_INCLUDE_PATH
49ee64e5 63#undef TRACE_INCLUDE_FILE
0b39b9f9
PS
64#define TRACE_INCLUDE_PATH sys
65#define TRACE_INCLUDE_FILE trace
66#include <trace/define_trace.h>
67
68#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */