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
10TRACE_EVENT(jbd_checkpoint,
11
12	TP_PROTO(journal_t *journal, int result),
13
14	TP_ARGS(journal, result),
15
16	TP_STRUCT__entry(
17		__field(	dev_t,	dev			)
18		__field(	int,	result			)
19	),
20
21	TP_fast_assign(
22		__entry->dev		= journal->j_fs_dev->bd_dev;
23		__entry->result		= result;
24	),
25
26	TP_printk("dev %d,%d result %d",
27		  MAJOR(__entry->dev), MINOR(__entry->dev),
28		  __entry->result)
29);
30
31DECLARE_EVENT_CLASS(jbd_commit,
32
33	TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
34
35	TP_ARGS(journal, commit_transaction),
36
37	TP_STRUCT__entry(
38		__field(	dev_t,	dev			)
39		__field(	int,	transaction		)
40	),
41
42	TP_fast_assign(
43		__entry->dev		= journal->j_fs_dev->bd_dev;
44		__entry->transaction	= commit_transaction->t_tid;
45	),
46
47	TP_printk("dev %d,%d transaction %d",
48		  MAJOR(__entry->dev), MINOR(__entry->dev),
49		  __entry->transaction)
50);
51
52DEFINE_EVENT(jbd_commit, jbd_start_commit,
53
54	TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
55
56	TP_ARGS(journal, commit_transaction)
57);
58
59DEFINE_EVENT(jbd_commit, jbd_commit_locking,
60
61	TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
62
63	TP_ARGS(journal, commit_transaction)
64);
65
66DEFINE_EVENT(jbd_commit, jbd_commit_flushing,
67
68	TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
69
70	TP_ARGS(journal, commit_transaction)
71);
72
73DEFINE_EVENT(jbd_commit, jbd_commit_logging,
74
75	TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
76
77	TP_ARGS(journal, commit_transaction)
78);
79
80TRACE_EVENT(jbd_drop_transaction,
81
82	TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
83
84	TP_ARGS(journal, commit_transaction),
85
86	TP_STRUCT__entry(
87		__field(	dev_t,	dev			)
88		__field(	int,	transaction		)
89	),
90
91	TP_fast_assign(
92		__entry->dev		= journal->j_fs_dev->bd_dev;
93		__entry->transaction	= commit_transaction->t_tid;
94	),
95
96	TP_printk("dev %d,%d transaction %d",
97		  MAJOR(__entry->dev), MINOR(__entry->dev),
98		  __entry->transaction)
99);
100
101TRACE_EVENT(jbd_end_commit,
102	TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
103
104	TP_ARGS(journal, commit_transaction),
105
106	TP_STRUCT__entry(
107		__field(	dev_t,	dev			)
108		__field(	int,	transaction		)
109		__field(	int,	head			)
110	),
111
112	TP_fast_assign(
113		__entry->dev		= journal->j_fs_dev->bd_dev;
114		__entry->transaction	= commit_transaction->t_tid;
115		__entry->head		= journal->j_tail_sequence;
116	),
117
118	TP_printk("dev %d,%d transaction %d head %d",
119		  MAJOR(__entry->dev), MINOR(__entry->dev),
120		  __entry->transaction, __entry->head)
121);
122
123TRACE_EVENT(jbd_do_submit_data,
124	TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
125
126	TP_ARGS(journal, commit_transaction),
127
128	TP_STRUCT__entry(
129		__field(	dev_t,	dev			)
130		__field(	int,	transaction		)
131	),
132
133	TP_fast_assign(
134		__entry->dev		= journal->j_fs_dev->bd_dev;
135		__entry->transaction	= commit_transaction->t_tid;
136	),
137
138	TP_printk("dev %d,%d transaction %d",
139		  MAJOR(__entry->dev), MINOR(__entry->dev),
140		   __entry->transaction)
141);
142
143TRACE_EVENT(jbd_cleanup_journal_tail,
144
145	TP_PROTO(journal_t *journal, tid_t first_tid,
146		 unsigned long block_nr, unsigned long freed),
147
148	TP_ARGS(journal, first_tid, block_nr, freed),
149
150	TP_STRUCT__entry(
151		__field(	dev_t,	dev			)
152		__field(	tid_t,	tail_sequence		)
153		__field(	tid_t,	first_tid		)
154		__field(unsigned long,	block_nr		)
155		__field(unsigned long,	freed			)
156	),
157
158	TP_fast_assign(
159		__entry->dev		= journal->j_fs_dev->bd_dev;
160		__entry->tail_sequence	= journal->j_tail_sequence;
161		__entry->first_tid	= first_tid;
162		__entry->block_nr	= block_nr;
163		__entry->freed		= freed;
164	),
165
166	TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
167		  MAJOR(__entry->dev), MINOR(__entry->dev),
168		  __entry->tail_sequence, __entry->first_tid,
169		  __entry->block_nr, __entry->freed)
170);
171
172TRACE_EVENT(journal_write_superblock,
173	TP_PROTO(journal_t *journal, int write_op),
174
175	TP_ARGS(journal, write_op),
176
177	TP_STRUCT__entry(
178		__field(	dev_t,	dev			)
179		__field(	int,	write_op		)
180	),
181
182	TP_fast_assign(
183		__entry->dev		= journal->j_fs_dev->bd_dev;
184		__entry->write_op	= write_op;
185	),
186
187	TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev),
188		  MINOR(__entry->dev), __entry->write_op)
189);
190
191#endif /* _TRACE_JBD_H */
192
193/* This part must be outside protection */
194#include <trace/define_trace.h>
195