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