10e3073fe972bb6a698e386fde9999880b4cbb10
[lttng-modules.git] / instrumentation / events / lttng-module / jbd2.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM jbd2
4
5 #if !defined(LTTNG_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_JBD2_H
7
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/jbd2.h>
10 #include <linux/version.h>
11
12 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
13 #ifndef _TRACE_JBD2_DEF
14 #define _TRACE_JBD2_DEF
15 struct transaction_chp_stats_s;
16 struct transaction_run_stats_s;
17 #endif
18 #endif
19
20 LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint,
21
22 TP_PROTO(journal_t *journal, int result),
23
24 TP_ARGS(journal, result),
25
26 TP_FIELDS(
27 ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev)
28 ctf_integer(int, result, result)
29 )
30 )
31
32 LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit,
33
34 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
35
36 TP_ARGS(journal, commit_transaction),
37
38 TP_FIELDS(
39 ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev)
40 ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit)
41 ctf_integer(int, transaction, commit_transaction->t_tid)
42 )
43 )
44
45 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_start_commit,
46
47 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
48
49 TP_ARGS(journal, commit_transaction)
50 )
51
52 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_locking,
53
54 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
55
56 TP_ARGS(journal, commit_transaction)
57 )
58
59 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_flushing,
60
61 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
62
63 TP_ARGS(journal, commit_transaction)
64 )
65
66 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_logging,
67
68 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
69
70 TP_ARGS(journal, commit_transaction)
71 )
72
73 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
74 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_drop_transaction,
75
76 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
77
78 TP_ARGS(journal, commit_transaction)
79 )
80 #endif
81
82 LTTNG_TRACEPOINT_EVENT(jbd2_end_commit,
83 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
84
85 TP_ARGS(journal, commit_transaction),
86
87 TP_FIELDS(
88 ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev)
89 ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit)
90 ctf_integer(int, transaction, commit_transaction->t_tid)
91 ctf_integer(int, head, journal->j_tail_sequence)
92 )
93 )
94
95 LTTNG_TRACEPOINT_EVENT(jbd2_submit_inode_data,
96 TP_PROTO(struct inode *inode),
97
98 TP_ARGS(inode),
99
100 TP_FIELDS(
101 ctf_integer(dev_t, dev, inode->i_sb->s_dev)
102 ctf_integer(ino_t, ino, inode->i_ino)
103 )
104 )
105
106 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
107 LTTNG_TRACEPOINT_EVENT(jbd2_run_stats,
108 TP_PROTO(dev_t dev, unsigned long tid,
109 struct transaction_run_stats_s *stats),
110
111 TP_ARGS(dev, tid, stats),
112
113 TP_FIELDS(
114 ctf_integer(dev_t, dev, dev)
115 ctf_integer(unsigned long, tid, tid)
116 ctf_integer(unsigned long, wait, stats->rs_wait)
117 ctf_integer(unsigned long, running, stats->rs_running)
118 ctf_integer(unsigned long, locked, stats->rs_locked)
119 ctf_integer(unsigned long, flushing, stats->rs_flushing)
120 ctf_integer(unsigned long, logging, stats->rs_logging)
121 ctf_integer(__u32, handle_count, stats->rs_handle_count)
122 ctf_integer(__u32, blocks, stats->rs_blocks)
123 ctf_integer(__u32, blocks_logged, stats->rs_blocks_logged)
124 )
125 )
126
127 LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint_stats,
128 TP_PROTO(dev_t dev, unsigned long tid,
129 struct transaction_chp_stats_s *stats),
130
131 TP_ARGS(dev, tid, stats),
132
133 TP_FIELDS(
134 ctf_integer(dev_t, dev, dev)
135 ctf_integer(unsigned long, tid, tid)
136 ctf_integer(unsigned long, chp_time, stats->cs_chp_time)
137 ctf_integer(__u32, forced_to_close, stats->cs_forced_to_close)
138 ctf_integer(__u32, written, stats->cs_written)
139 ctf_integer(__u32, dropped, stats->cs_dropped)
140 )
141 )
142 #endif
143
144 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
145 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
146 LTTNG_TRACEPOINT_EVENT(jbd2_update_log_tail,
147 #else
148 LTTNG_TRACEPOINT_EVENT(jbd2_cleanup_journal_tail,
149 #endif
150
151 TP_PROTO(journal_t *journal, tid_t first_tid,
152 unsigned long block_nr, unsigned long freed),
153
154 TP_ARGS(journal, first_tid, block_nr, freed),
155
156 TP_FIELDS(
157 ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev)
158 ctf_integer(tid_t, tail_sequence, journal->j_tail_sequence)
159 ctf_integer(tid_t, first_tid, first_tid)
160 ctf_integer(unsigned long, block_nr, block_nr)
161 ctf_integer(unsigned long, freed, freed)
162 )
163 )
164 #endif
165
166 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
167 LTTNG_TRACEPOINT_EVENT(jbd2_write_superblock,
168
169 TP_PROTO(journal_t *journal, int write_op),
170
171 TP_ARGS(journal, write_op),
172
173 TP_FIELDS(
174 ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev)
175 ctf_integer(int, write_op, write_op)
176 )
177 )
178 #endif
179
180 #endif /* LTTNG_TRACE_JBD2_H */
181
182 /* This part must be outside protection */
183 #include <probes/define_trace.h>
This page took 0.032579 seconds and 3 git commands to generate.