Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / lttng / instrumentation / events / lttng-module / jbd.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM jbd
3
4 #if !defined(_TRACE_JBD_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_JBD_H
6
7 #include <linux/jbd.h>
8 #include <linux/tracepoint.h>
9 #include <linux/version.h>
10
11 TRACE_EVENT(jbd_checkpoint,
12
13         TP_PROTO(journal_t *journal, int result),
14
15         TP_ARGS(journal, result),
16
17         TP_STRUCT__entry(
18                 __field(        dev_t,  dev                     )
19                 __field(        int,    result                  )
20         ),
21
22         TP_fast_assign(
23                 tp_assign(dev, journal->j_fs_dev->bd_dev)
24                 tp_assign(result, result)
25         ),
26
27         TP_printk("dev %d,%d result %d",
28                   MAJOR(__entry->dev), MINOR(__entry->dev),
29                   __entry->result)
30 )
31
32 DECLARE_EVENT_CLASS(jbd_commit,
33
34         TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
35
36         TP_ARGS(journal, commit_transaction),
37
38         TP_STRUCT__entry(
39                 __field(        dev_t,  dev                     )
40 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
41                 __field(        char,   sync_commit             )
42 #endif
43                 __field(        int,    transaction             )
44         ),
45
46         TP_fast_assign(
47                 tp_assign(dev, journal->j_fs_dev->bd_dev)
48 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
49                 tp_assign(sync_commit, commit_transaction->t_synchronous_commit)
50 #endif
51                 tp_assign(transaction, commit_transaction->t_tid)
52         ),
53
54 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
55         TP_printk("dev %d,%d transaction %d sync %d",
56                   MAJOR(__entry->dev), MINOR(__entry->dev),
57                   __entry->transaction, __entry->sync_commit)
58 #else
59         TP_printk("dev %d,%d transaction %d",
60                   MAJOR(__entry->dev), MINOR(__entry->dev),
61                   __entry->transaction)
62 #endif
63 )
64
65 DEFINE_EVENT(jbd_commit, jbd_start_commit,
66
67         TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
68
69         TP_ARGS(journal, commit_transaction)
70 )
71
72 DEFINE_EVENT(jbd_commit, jbd_commit_locking,
73
74         TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
75
76         TP_ARGS(journal, commit_transaction)
77 )
78
79 DEFINE_EVENT(jbd_commit, jbd_commit_flushing,
80
81         TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
82
83         TP_ARGS(journal, commit_transaction)
84 )
85
86 DEFINE_EVENT(jbd_commit, jbd_commit_logging,
87
88         TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
89
90         TP_ARGS(journal, commit_transaction)
91 )
92
93 TRACE_EVENT(jbd_drop_transaction,
94
95         TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
96
97         TP_ARGS(journal, commit_transaction),
98
99         TP_STRUCT__entry(
100                 __field(        dev_t,  dev                     )
101 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
102                 __field(        char,   sync_commit             )
103 #endif
104                 __field(        int,    transaction             )
105         ),
106
107         TP_fast_assign(
108                 tp_assign(dev, journal->j_fs_dev->bd_dev)
109 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
110                 tp_assign(sync_commit, commit_transaction->t_synchronous_commit)
111 #endif
112                 tp_assign(transaction, commit_transaction->t_tid)
113         ),
114
115 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
116         TP_printk("dev %d,%d transaction %d sync %d",
117                   MAJOR(__entry->dev), MINOR(__entry->dev),
118                   __entry->transaction, __entry->sync_commit)
119 #else
120         TP_printk("dev %d,%d transaction %d",
121                   MAJOR(__entry->dev), MINOR(__entry->dev),
122                   __entry->transaction)
123 #endif
124 )
125
126 TRACE_EVENT(jbd_end_commit,
127         TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
128
129         TP_ARGS(journal, commit_transaction),
130
131         TP_STRUCT__entry(
132                 __field(        dev_t,  dev                     )
133 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
134                 __field(        char,   sync_commit             )
135 #endif
136                 __field(        int,    transaction             )
137                 __field(        int,    head                    )
138         ),
139
140         TP_fast_assign(
141                 tp_assign(dev, journal->j_fs_dev->bd_dev)
142 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
143                 tp_assign(sync_commit, commit_transaction->t_synchronous_commit)
144 #endif
145                 tp_assign(transaction, commit_transaction->t_tid)
146                 tp_assign(head, journal->j_tail_sequence)
147         ),
148
149 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
150         TP_printk("dev %d,%d transaction %d sync %d head %d",
151                   MAJOR(__entry->dev), MINOR(__entry->dev),
152                   __entry->transaction, __entry->sync_commit, __entry->head)
153 #else
154         TP_printk("dev %d,%d transaction %d head %d",
155                   MAJOR(__entry->dev), MINOR(__entry->dev),
156                   __entry->transaction, __entry->head)
157 #endif
158 )
159
160 TRACE_EVENT(jbd_do_submit_data,
161         TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
162
163         TP_ARGS(journal, commit_transaction),
164
165         TP_STRUCT__entry(
166                 __field(        dev_t,  dev                     )
167 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
168                 __field(        char,   sync_commit             )
169 #endif
170                 __field(        int,    transaction             )
171         ),
172
173         TP_fast_assign(
174                 tp_assign(dev, journal->j_fs_dev->bd_dev)
175 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
176                 tp_assign(sync_commit, commit_transaction->t_synchronous_commit)
177 #endif
178                 tp_assign(transaction, commit_transaction->t_tid)
179         ),
180
181 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
182         TP_printk("dev %d,%d transaction %d sync %d",
183                   MAJOR(__entry->dev), MINOR(__entry->dev),
184                    __entry->transaction, __entry->sync_commit)
185 #else
186         TP_printk("dev %d,%d transaction %d",
187                   MAJOR(__entry->dev), MINOR(__entry->dev),
188                    __entry->transaction)
189 #endif
190 )
191
192 TRACE_EVENT(jbd_cleanup_journal_tail,
193
194         TP_PROTO(journal_t *journal, tid_t first_tid,
195                  unsigned long block_nr, unsigned long freed),
196
197         TP_ARGS(journal, first_tid, block_nr, freed),
198
199         TP_STRUCT__entry(
200                 __field(        dev_t,  dev                     )
201                 __field(        tid_t,  tail_sequence           )
202                 __field(        tid_t,  first_tid               )
203                 __field(unsigned long,  block_nr                )
204                 __field(unsigned long,  freed                   )
205         ),
206
207         TP_fast_assign(
208                 tp_assign(dev, journal->j_fs_dev->bd_dev)
209                 tp_assign(tail_sequence, journal->j_tail_sequence)
210                 tp_assign(first_tid, first_tid)
211                 tp_assign(block_nr, block_nr)
212                 tp_assign(freed, freed)
213         ),
214
215         TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
216                   MAJOR(__entry->dev), MINOR(__entry->dev),
217                   __entry->tail_sequence, __entry->first_tid,
218                   __entry->block_nr, __entry->freed)
219 )
220
221 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
222 TRACE_EVENT_MAP(journal_write_superblock,
223
224         jbd_journal_write_superblock,
225
226         TP_PROTO(journal_t *journal, int write_op),
227
228         TP_ARGS(journal, write_op),
229
230         TP_STRUCT__entry(
231                 __field(        dev_t,  dev                     )
232                 __field(        int,    write_op                )
233         ),
234
235         TP_fast_assign(
236                 tp_assign(dev, journal->j_fs_dev->bd_dev)
237                 tp_assign(write_op, write_op)
238         ),
239
240         TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev),
241                   MINOR(__entry->dev), __entry->write_op)
242 )
243 #else
244 TRACE_EVENT(jbd_update_superblock_end,
245         TP_PROTO(journal_t *journal, int wait),
246
247         TP_ARGS(journal, wait),
248
249         TP_STRUCT__entry(
250                 __field(        dev_t,  dev                     )
251                 __field(        int,    wait                    )
252         ),
253
254         TP_fast_assign(
255                 tp_assign(dev, journal->j_fs_dev->bd_dev)
256                 tp_assign(wait, wait)
257         ),
258
259         TP_printk("dev %d,%d wait %d",
260                   MAJOR(__entry->dev), MINOR(__entry->dev),
261                    __entry->wait)
262 )
263 #endif
264
265 #endif /* _TRACE_JBD_H */
266
267 /* This part must be outside protection */
268 #include "../../../probes/define_trace.h"