config/dracut/90zfs: handle cases where hostid(1) returns all zeros
[zfs.git] / include / os / linux / zfs / sys / trace_zio.h
blob8655e245c0436c70381a2a991aa3edf25107e189
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 #include <sys/list.h>
24 #if defined(_KERNEL)
25 #if defined(HAVE_DECLARE_EVENT_CLASS)
27 #undef TRACE_SYSTEM
28 #define TRACE_SYSTEM zfs
30 #undef TRACE_SYSTEM_VAR
31 #define TRACE_SYSTEM_VAR zfs_zio
33 #if !defined(_TRACE_ZIO_H) || defined(TRACE_HEADER_MULTI_READ)
34 #define _TRACE_ZIO_H
36 #include <linux/tracepoint.h>
37 #include <sys/types.h>
38 #include <sys/trace_common.h> /* For ZIO macros */
40 /* BEGIN CSTYLED */
41 TRACE_EVENT(zfs_zio__delay__miss,
42 TP_PROTO(zio_t *zio, hrtime_t now),
43 TP_ARGS(zio, now),
44 TP_STRUCT__entry(
45 ZIO_TP_STRUCT_ENTRY
46 __field(hrtime_t, now)
48 TP_fast_assign(
49 ZIO_TP_FAST_ASSIGN
50 __entry->now = now;
52 TP_printk("now %llu " ZIO_TP_PRINTK_FMT, __entry->now,
53 ZIO_TP_PRINTK_ARGS)
56 TRACE_EVENT(zfs_zio__delay__hit,
57 TP_PROTO(zio_t *zio, hrtime_t now, hrtime_t diff),
58 TP_ARGS(zio, now, diff),
59 TP_STRUCT__entry(
60 ZIO_TP_STRUCT_ENTRY
61 __field(hrtime_t, now)
62 __field(hrtime_t, diff)
64 TP_fast_assign(
65 ZIO_TP_FAST_ASSIGN
66 __entry->now = now;
67 __entry->diff = diff;
69 TP_printk("now %llu diff %llu " ZIO_TP_PRINTK_FMT, __entry->now,
70 __entry->diff, ZIO_TP_PRINTK_ARGS)
73 TRACE_EVENT(zfs_zio__delay__skip,
74 TP_PROTO(zio_t *zio),
75 TP_ARGS(zio),
76 TP_STRUCT__entry(ZIO_TP_STRUCT_ENTRY),
77 TP_fast_assign(ZIO_TP_FAST_ASSIGN),
78 TP_printk(ZIO_TP_PRINTK_FMT, ZIO_TP_PRINTK_ARGS)
80 /* END CSTYLED */
82 #endif /* _TRACE_ZIO_H */
84 #undef TRACE_INCLUDE_PATH
85 #undef TRACE_INCLUDE_FILE
86 #define TRACE_INCLUDE_PATH sys
87 #define TRACE_INCLUDE_FILE trace_zio
88 #include <trace/define_trace.h>
90 #else
92 DEFINE_DTRACE_PROBE2(zio__delay__miss);
93 DEFINE_DTRACE_PROBE3(zio__delay__hit);
94 DEFINE_DTRACE_PROBE1(zio__delay__skip);
96 #endif /* HAVE_DECLARE_EVENT_CLASS */
97 #endif /* _KERNEL */