1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM jbd2
5 #if !defined(LTTNG_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_JBD2_H
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/jbd2.h>
10 #include <linux/version.h>
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
;
20 LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint
,
22 TP_PROTO(journal_t
*journal
, int result
),
24 TP_ARGS(journal
, result
),
27 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
28 ctf_integer(int, result
, result
)
32 LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit
,
34 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
36 TP_ARGS(journal
, commit_transaction
),
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
)
45 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit
, jbd2_start_commit
,
47 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
49 TP_ARGS(journal
, commit_transaction
)
52 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit
, jbd2_commit_locking
,
54 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
56 TP_ARGS(journal
, commit_transaction
)
59 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit
, jbd2_commit_flushing
,
61 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
63 TP_ARGS(journal
, commit_transaction
)
66 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit
, jbd2_commit_logging
,
68 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
70 TP_ARGS(journal
, commit_transaction
)
73 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
74 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit
, jbd2_drop_transaction
,
76 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
78 TP_ARGS(journal
, commit_transaction
)
82 LTTNG_TRACEPOINT_EVENT(jbd2_end_commit
,
83 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
85 TP_ARGS(journal
, commit_transaction
),
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
)
95 LTTNG_TRACEPOINT_EVENT(jbd2_submit_inode_data
,
96 TP_PROTO(struct inode
*inode
),
101 ctf_integer(dev_t
, dev
, inode
->i_sb
->s_dev
)
102 ctf_integer(ino_t
, ino
, inode
->i_ino
)
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
),
111 TP_ARGS(dev
, tid
, stats
),
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
)
127 LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint_stats
,
128 TP_PROTO(dev_t dev
, unsigned long tid
,
129 struct transaction_chp_stats_s
*stats
),
131 TP_ARGS(dev
, tid
, stats
),
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
)
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
,
148 LTTNG_TRACEPOINT_EVENT(jbd2_cleanup_journal_tail
,
151 TP_PROTO(journal_t
*journal
, tid_t first_tid
,
152 unsigned long block_nr
, unsigned long freed
),
154 TP_ARGS(journal
, first_tid
, block_nr
, freed
),
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
)
166 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
167 LTTNG_TRACEPOINT_EVENT(jbd2_write_superblock
,
169 TP_PROTO(journal_t
*journal
, int write_op
),
171 TP_ARGS(journal
, write_op
),
174 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
175 ctf_integer(int, write_op
, write_op
)
180 #endif /* LTTNG_TRACE_JBD2_H */
182 /* This part must be outside protection */
183 #include <probes/define_trace.h>