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