]> git.proxmox.com Git - mirror_zfs-debian.git/blame - include/sys/trace_zil.h
Imported Upstream version 0.6.4.2
[mirror_zfs-debian.git] / include / sys / trace_zil.h
CommitLineData
ea04106b
AX
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#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
23
24#undef TRACE_SYSTEM
25#define TRACE_SYSTEM zfs
26
27#if !defined(_TRACE_ZIL_H) || defined(TRACE_HEADER_MULTI_READ)
28#define _TRACE_ZIL_H
29
30#include <linux/tracepoint.h>
31#include <sys/types.h>
32
33/*
34 * Generic support for one argument tracepoints of the form:
35 *
36 * DTRACE_PROBE1(...,
37 * zilog_t *, ...);
38 */
39
40DECLARE_EVENT_CLASS(zfs_zil_class,
41 TP_PROTO(zilog_t *zilog),
42 TP_ARGS(zilog),
43 TP_STRUCT__entry(
44 __field(uint64_t, zl_lr_seq)
45 __field(uint64_t, zl_commit_lr_seq)
46 __field(uint64_t, zl_destroy_txg)
47 __field(uint64_t, zl_replaying_seq)
48 __field(uint32_t, zl_suspend)
49 __field(uint8_t, zl_suspending)
50 __field(uint8_t, zl_keep_first)
51 __field(uint8_t, zl_replay)
52 __field(uint8_t, zl_stop_sync)
53 __field(uint8_t, zl_writer)
54 __field(uint8_t, zl_logbias)
55 __field(uint8_t, zl_sync)
56 __field(int, zl_parse_error)
57 __field(uint64_t, zl_parse_blk_seq)
58 __field(uint64_t, zl_parse_lr_seq)
59 __field(uint64_t, zl_parse_blk_count)
60 __field(uint64_t, zl_parse_lr_count)
61 __field(uint64_t, zl_next_batch)
62 __field(uint64_t, zl_com_batch)
63 __field(uint64_t, zl_itx_list_sz)
64 __field(uint64_t, zl_cur_used)
65 __field(clock_t, zl_replay_time)
66 __field(uint64_t, zl_replay_blks)
67 ),
68 TP_fast_assign(
69 __entry->zl_lr_seq = zilog->zl_lr_seq;
70 __entry->zl_commit_lr_seq = zilog->zl_commit_lr_seq;
71 __entry->zl_destroy_txg = zilog->zl_destroy_txg;
72 __entry->zl_replaying_seq = zilog->zl_replaying_seq;
73 __entry->zl_suspend = zilog->zl_suspend;
74 __entry->zl_suspending = zilog->zl_suspending;
75 __entry->zl_keep_first = zilog->zl_keep_first;
76 __entry->zl_replay = zilog->zl_replay;
77 __entry->zl_stop_sync = zilog->zl_stop_sync;
78 __entry->zl_writer = zilog->zl_writer;
79 __entry->zl_logbias = zilog->zl_logbias;
80 __entry->zl_sync = zilog->zl_sync;
81 __entry->zl_parse_error = zilog->zl_parse_error;
82 __entry->zl_parse_blk_seq = zilog->zl_parse_blk_seq;
83 __entry->zl_parse_lr_seq = zilog->zl_parse_lr_seq;
84 __entry->zl_parse_blk_count = zilog->zl_parse_blk_count;
85 __entry->zl_parse_lr_count = zilog->zl_parse_lr_count;
86 __entry->zl_next_batch = zilog->zl_next_batch;
87 __entry->zl_com_batch = zilog->zl_com_batch;
88 __entry->zl_itx_list_sz = zilog->zl_itx_list_sz;
89 __entry->zl_cur_used = zilog->zl_cur_used;
90 __entry->zl_replay_time = zilog->zl_replay_time;
91 __entry->zl_replay_blks = zilog->zl_replay_blks;
92 ),
93 TP_printk("zl { lr_seq %llu commit_lr_seq %llu destroy_txg %llu "
94 "replaying_seq %llu suspend %u suspending %u keep_first %u "
95 "replay %u stop_sync %u writer %u logbias %u sync %u "
96 "parse_error %u parse_blk_seq %llu parse_lr_seq %llu "
97 "parse_blk_count %llu parse_lr_count %llu next_batch %llu "
98 "com_batch %llu itx_list_sz %llu cur_used %llu replay_time %lu "
99 "replay_blks %llu }",
100 __entry->zl_lr_seq, __entry->zl_commit_lr_seq,
101 __entry->zl_destroy_txg, __entry->zl_replaying_seq,
102 __entry->zl_suspend, __entry->zl_suspending, __entry->zl_keep_first,
103 __entry->zl_replay, __entry->zl_stop_sync, __entry->zl_writer,
104 __entry->zl_logbias, __entry->zl_sync, __entry->zl_parse_error,
105 __entry->zl_parse_blk_seq, __entry->zl_parse_lr_seq,
106 __entry->zl_parse_blk_count, __entry->zl_parse_lr_count,
107 __entry->zl_next_batch, __entry->zl_com_batch,
108 __entry->zl_itx_list_sz, __entry->zl_cur_used,
109 __entry->zl_replay_time, __entry->zl_replay_blks)
110);
111
112#define DEFINE_ZIL_EVENT(name) \
113DEFINE_EVENT(zfs_zil_class, name, \
114 TP_PROTO(zilog_t *zilog), \
115 TP_ARGS(zilog))
116DEFINE_ZIL_EVENT(zfs_zil__cw1);
117DEFINE_ZIL_EVENT(zfs_zil__cw2);
118
119#endif /* _TRACE_ZIL_H */
120
121#undef TRACE_INCLUDE_PATH
122#undef TRACE_INCLUDE_FILE
123#define TRACE_INCLUDE_PATH sys
124#define TRACE_INCLUDE_FILE trace_zil
125#include <trace/define_trace.h>
126
127#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */