1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #define TRACE_SYSTEM jbd
5 #if !defined(LTTNG_TRACE_JBD_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_JBD_H
8 #include <lttng/tracepoint-event.h>
10 #include <linux/version.h>
12 LTTNG_TRACEPOINT_EVENT(jbd_checkpoint
,
14 TP_PROTO(journal_t
*journal
, int result
),
16 TP_ARGS(journal
, result
),
19 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
20 ctf_integer(int, result
, result
)
24 LTTNG_TRACEPOINT_EVENT_CLASS(jbd_commit
,
26 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
28 TP_ARGS(journal
, commit_transaction
),
31 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
32 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
33 ctf_integer(char, sync_commit
, commit_transaction
->t_synchronous_commit
)
35 ctf_integer(int, transaction
, commit_transaction
->t_tid
)
39 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit
, jbd_start_commit
,
41 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
43 TP_ARGS(journal
, commit_transaction
)
46 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit
, jbd_commit_locking
,
48 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
50 TP_ARGS(journal
, commit_transaction
)
53 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit
, jbd_commit_flushing
,
55 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
57 TP_ARGS(journal
, commit_transaction
)
60 LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit
, jbd_commit_logging
,
62 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
64 TP_ARGS(journal
, commit_transaction
)
67 LTTNG_TRACEPOINT_EVENT(jbd_drop_transaction
,
69 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
71 TP_ARGS(journal
, commit_transaction
),
74 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
75 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
76 ctf_integer(char, sync_commit
, commit_transaction
->t_synchronous_commit
)
78 ctf_integer(int, transaction
, commit_transaction
->t_tid
)
82 LTTNG_TRACEPOINT_EVENT(jbd_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 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
90 ctf_integer(char, sync_commit
, commit_transaction
->t_synchronous_commit
)
92 ctf_integer(int, transaction
, commit_transaction
->t_tid
)
93 ctf_integer(int, head
, journal
->j_tail_sequence
)
97 LTTNG_TRACEPOINT_EVENT(jbd_do_submit_data
,
98 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
100 TP_ARGS(journal
, commit_transaction
),
103 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
104 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
105 ctf_integer(char, sync_commit
, commit_transaction
->t_synchronous_commit
)
107 ctf_integer(int, transaction
, commit_transaction
->t_tid
)
111 LTTNG_TRACEPOINT_EVENT(jbd_cleanup_journal_tail
,
113 TP_PROTO(journal_t
*journal
, tid_t first_tid
,
114 unsigned long block_nr
, unsigned long freed
),
116 TP_ARGS(journal
, first_tid
, block_nr
, freed
),
119 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
120 ctf_integer(tid_t
, tail_sequence
, journal
->j_tail_sequence
)
121 ctf_integer(tid_t
, first_tid
, first_tid
)
122 ctf_integer(unsigned long, block_nr
, block_nr
)
123 ctf_integer(unsigned long, freed
, freed
)
127 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
128 LTTNG_TRACEPOINT_EVENT_MAP(journal_write_superblock
,
130 jbd_journal_write_superblock
,
132 TP_PROTO(journal_t
*journal
, int write_op
),
134 TP_ARGS(journal
, write_op
),
137 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
138 ctf_integer(int, write_op
, write_op
)
142 LTTNG_TRACEPOINT_EVENT(jbd_update_superblock_end
,
143 TP_PROTO(journal_t
*journal
, int wait
),
145 TP_ARGS(journal
, wait
),
148 ctf_integer(dev_t
, dev
, journal
->j_fs_dev
->bd_dev
)
149 ctf_integer(int, wait
, wait
)
154 #endif /* LTTNG_TRACE_JBD_H */
156 /* This part must be outside protection */
157 #include <lttng/define_trace.h>