]>
Commit | Line | Data |
---|---|---|
80a9a84d WW |
1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM ocfs2 | |
3 | ||
4 | #if !defined(_TRACE_OCFS2_H) || defined(TRACE_HEADER_MULTI_READ) | |
5 | #define _TRACE_OCFS2_H | |
6 | ||
7 | #include <linux/tracepoint.h> | |
8 | ||
a09d09b8 TM |
9 | DECLARE_EVENT_CLASS(ocfs2__int, |
10 | TP_PROTO(int num), | |
11 | TP_ARGS(num), | |
12 | TP_STRUCT__entry( | |
13 | __field(int, num) | |
14 | ), | |
15 | TP_fast_assign( | |
16 | __entry->num = num; | |
17 | ), | |
18 | TP_printk("%d", __entry->num) | |
19 | ); | |
20 | ||
21 | #define DEFINE_OCFS2_INT_EVENT(name) \ | |
22 | DEFINE_EVENT(ocfs2__int, name, \ | |
23 | TP_PROTO(int num), \ | |
24 | TP_ARGS(num)) | |
25 | ||
a04733d8 TM |
26 | DECLARE_EVENT_CLASS(ocfs2__uint, |
27 | TP_PROTO(unsigned int num), | |
28 | TP_ARGS(num), | |
29 | TP_STRUCT__entry( | |
30 | __field( unsigned int, num ) | |
31 | ), | |
32 | TP_fast_assign( | |
33 | __entry->num = num; | |
34 | ), | |
35 | TP_printk("%u", __entry->num) | |
36 | ); | |
37 | ||
38 | #define DEFINE_OCFS2_UINT_EVENT(name) \ | |
39 | DEFINE_EVENT(ocfs2__uint, name, \ | |
40 | TP_PROTO(unsigned int num), \ | |
41 | TP_ARGS(num)) | |
42 | ||
a09d09b8 TM |
43 | DECLARE_EVENT_CLASS(ocfs2__int_int, |
44 | TP_PROTO(int value1, int value2), | |
45 | TP_ARGS(value1, value2), | |
46 | TP_STRUCT__entry( | |
47 | __field(int, value1) | |
48 | __field(int, value2) | |
49 | ), | |
50 | TP_fast_assign( | |
51 | __entry->value1 = value1; | |
52 | __entry->value2 = value2; | |
53 | ), | |
54 | TP_printk("%d %d", __entry->value1, __entry->value2) | |
55 | ); | |
56 | ||
57 | #define DEFINE_OCFS2_INT_INT_EVENT(name) \ | |
58 | DEFINE_EVENT(ocfs2__int_int, name, \ | |
59 | TP_PROTO(int val1, int val2), \ | |
60 | TP_ARGS(val1, val2)) | |
61 | ||
62 | DECLARE_EVENT_CLASS(ocfs2__ull_uint, | |
63 | TP_PROTO(unsigned long long value1, unsigned int value2), | |
64 | TP_ARGS(value1, value2), | |
65 | TP_STRUCT__entry( | |
66 | __field(unsigned long long, value1) | |
67 | __field(unsigned int, value2) | |
68 | ), | |
69 | TP_fast_assign( | |
70 | __entry->value1 = value1; | |
71 | __entry->value2 = value2; | |
72 | ), | |
73 | TP_printk("%llu %u", __entry->value1, __entry->value2) | |
74 | ); | |
75 | ||
76 | #define DEFINE_OCFS2_ULL_UINT_EVENT(name) \ | |
77 | DEFINE_EVENT(ocfs2__ull_uint, name, \ | |
78 | TP_PROTO(unsigned long long val1, unsigned int val2), \ | |
79 | TP_ARGS(val1, val2)) | |
80 | ||
a04733d8 TM |
81 | DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint, |
82 | TP_PROTO(unsigned int value1, unsigned int value2, | |
83 | unsigned int value3), | |
84 | TP_ARGS(value1, value2, value3), | |
85 | TP_STRUCT__entry( | |
86 | __field( unsigned int, value1 ) | |
87 | __field( unsigned int, value2 ) | |
88 | __field( unsigned int, value3 ) | |
89 | ), | |
90 | TP_fast_assign( | |
91 | __entry->value1 = value1; | |
92 | __entry->value2 = value2; | |
93 | __entry->value3 = value3; | |
94 | ), | |
95 | TP_printk("%u %u %u", __entry->value1, __entry->value2, __entry->value3) | |
96 | ); | |
97 | ||
98 | #define DEFINE_OCFS2_UINT_UINT_UINT_EVENT(name) \ | |
99 | DEFINE_EVENT(ocfs2__uint_uint_uint, name, \ | |
100 | TP_PROTO(unsigned int value1, unsigned int value2, \ | |
101 | unsigned int value3), \ | |
102 | TP_ARGS(value1, value2, value3)) | |
103 | ||
104 | DECLARE_EVENT_CLASS(ocfs2__ull_int_int_int, | |
105 | TP_PROTO(unsigned long long ull, int value1, int value2, int value3), | |
106 | TP_ARGS(ull, value1, value2, value3), | |
107 | TP_STRUCT__entry( | |
108 | __field( unsigned long long, ull ) | |
109 | __field( int, value1 ) | |
110 | __field( int, value2 ) | |
111 | __field( int, value3 ) | |
112 | ), | |
113 | TP_fast_assign( | |
114 | __entry->ull = ull; | |
115 | __entry->value1 = value1; | |
116 | __entry->value2 = value2; | |
117 | __entry->value3 = value3; | |
118 | ), | |
119 | TP_printk("%llu %d %d %d", | |
120 | __entry->ull, __entry->value1, | |
121 | __entry->value2, __entry->value3) | |
122 | ); | |
123 | ||
124 | #define DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(name) \ | |
125 | DEFINE_EVENT(ocfs2__ull_int_int_int, name, \ | |
126 | TP_PROTO(unsigned long long ull, int value1, \ | |
127 | int value2, int value3), \ | |
128 | TP_ARGS(ull, value1, value2, value3)) | |
129 | ||
a09d09b8 TM |
130 | /* Trace events for fs/ocfs2/alloc.c. */ |
131 | DECLARE_EVENT_CLASS(ocfs2__btree_ops, | |
132 | TP_PROTO(unsigned long long owner,\ | |
133 | unsigned int value1, unsigned int value2), | |
134 | TP_ARGS(owner, value1, value2), | |
135 | TP_STRUCT__entry( | |
136 | __field(unsigned long long, owner) | |
137 | __field(unsigned int, value1) | |
138 | __field(unsigned int, value2) | |
139 | ), | |
140 | TP_fast_assign( | |
141 | __entry->owner = owner; | |
142 | __entry->value1 = value1; | |
143 | __entry->value2 = value2; | |
144 | ), | |
145 | TP_printk("%llu %u %u", | |
146 | __entry->owner, __entry->value1, __entry->value2) | |
147 | ); | |
148 | ||
149 | #define DEFINE_OCFS2_BTREE_EVENT(name) \ | |
150 | DEFINE_EVENT(ocfs2__btree_ops, name, \ | |
151 | TP_PROTO(unsigned long long owner, \ | |
152 | unsigned int value1, unsigned int value2), \ | |
153 | TP_ARGS(owner, value1, value2)) | |
154 | ||
155 | DEFINE_OCFS2_BTREE_EVENT(ocfs2_adjust_rightmost_branch); | |
156 | ||
157 | DEFINE_OCFS2_BTREE_EVENT(ocfs2_rotate_tree_right); | |
158 | ||
159 | DEFINE_OCFS2_BTREE_EVENT(ocfs2_append_rec_to_path); | |
160 | ||
161 | DEFINE_OCFS2_BTREE_EVENT(ocfs2_insert_extent_start); | |
162 | ||
163 | DEFINE_OCFS2_BTREE_EVENT(ocfs2_add_clusters_in_btree); | |
164 | ||
165 | DEFINE_OCFS2_INT_EVENT(ocfs2_num_free_extents); | |
166 | ||
167 | DEFINE_OCFS2_INT_EVENT(ocfs2_complete_edge_insert); | |
168 | ||
169 | TRACE_EVENT(ocfs2_grow_tree, | |
170 | TP_PROTO(unsigned long long owner, int depth), | |
171 | TP_ARGS(owner, depth), | |
172 | TP_STRUCT__entry( | |
173 | __field(unsigned long long, owner) | |
174 | __field(int, depth) | |
175 | ), | |
176 | TP_fast_assign( | |
177 | __entry->owner = owner; | |
178 | __entry->depth = depth; | |
179 | ), | |
180 | TP_printk("%llu %d", __entry->owner, __entry->depth) | |
181 | ); | |
182 | ||
183 | TRACE_EVENT(ocfs2_rotate_subtree, | |
184 | TP_PROTO(int subtree_root, unsigned long long blkno, | |
185 | int depth), | |
186 | TP_ARGS(subtree_root, blkno, depth), | |
187 | TP_STRUCT__entry( | |
188 | __field(int, subtree_root) | |
189 | __field(unsigned long long, blkno) | |
190 | __field(int, depth) | |
191 | ), | |
192 | TP_fast_assign( | |
193 | __entry->subtree_root = subtree_root; | |
194 | __entry->blkno = blkno; | |
195 | __entry->depth = depth; | |
196 | ), | |
197 | TP_printk("%d %llu %d", __entry->subtree_root, | |
198 | __entry->blkno, __entry->depth) | |
199 | ); | |
200 | ||
201 | TRACE_EVENT(ocfs2_insert_extent, | |
202 | TP_PROTO(unsigned int ins_appending, unsigned int ins_contig, | |
203 | int ins_contig_index, int free_records, int ins_tree_depth), | |
204 | TP_ARGS(ins_appending, ins_contig, ins_contig_index, free_records, | |
205 | ins_tree_depth), | |
206 | TP_STRUCT__entry( | |
207 | __field(unsigned int, ins_appending) | |
208 | __field(unsigned int, ins_contig) | |
209 | __field(int, ins_contig_index) | |
210 | __field(int, free_records) | |
211 | __field(int, ins_tree_depth) | |
212 | ), | |
213 | TP_fast_assign( | |
214 | __entry->ins_appending = ins_appending; | |
215 | __entry->ins_contig = ins_contig; | |
216 | __entry->ins_contig_index = ins_contig_index; | |
217 | __entry->free_records = free_records; | |
218 | __entry->ins_tree_depth = ins_tree_depth; | |
219 | ), | |
220 | TP_printk("%u %u %d %d %d", | |
221 | __entry->ins_appending, __entry->ins_contig, | |
222 | __entry->ins_contig_index, __entry->free_records, | |
223 | __entry->ins_tree_depth) | |
224 | ); | |
225 | ||
226 | TRACE_EVENT(ocfs2_split_extent, | |
227 | TP_PROTO(int split_index, unsigned int c_contig_type, | |
228 | unsigned int c_has_empty_extent, | |
229 | unsigned int c_split_covers_rec), | |
230 | TP_ARGS(split_index, c_contig_type, | |
231 | c_has_empty_extent, c_split_covers_rec), | |
232 | TP_STRUCT__entry( | |
233 | __field(int, split_index) | |
234 | __field(unsigned int, c_contig_type) | |
235 | __field(unsigned int, c_has_empty_extent) | |
236 | __field(unsigned int, c_split_covers_rec) | |
237 | ), | |
238 | TP_fast_assign( | |
239 | __entry->split_index = split_index; | |
240 | __entry->c_contig_type = c_contig_type; | |
241 | __entry->c_has_empty_extent = c_has_empty_extent; | |
242 | __entry->c_split_covers_rec = c_split_covers_rec; | |
243 | ), | |
244 | TP_printk("%d %u %u %u", __entry->split_index, __entry->c_contig_type, | |
245 | __entry->c_has_empty_extent, __entry->c_split_covers_rec) | |
246 | ); | |
247 | ||
248 | TRACE_EVENT(ocfs2_remove_extent, | |
249 | TP_PROTO(unsigned long long owner, unsigned int cpos, | |
250 | unsigned int len, int index, | |
251 | unsigned int e_cpos, unsigned int clusters), | |
252 | TP_ARGS(owner, cpos, len, index, e_cpos, clusters), | |
253 | TP_STRUCT__entry( | |
254 | __field(unsigned long long, owner) | |
255 | __field(unsigned int, cpos) | |
256 | __field(unsigned int, len) | |
257 | __field(int, index) | |
258 | __field(unsigned int, e_cpos) | |
259 | __field(unsigned int, clusters) | |
260 | ), | |
261 | TP_fast_assign( | |
262 | __entry->owner = owner; | |
263 | __entry->cpos = cpos; | |
264 | __entry->len = len; | |
265 | __entry->index = index; | |
266 | __entry->e_cpos = e_cpos; | |
267 | __entry->clusters = clusters; | |
268 | ), | |
269 | TP_printk("%llu %u %u %d %u %u", | |
270 | __entry->owner, __entry->cpos, __entry->len, __entry->index, | |
271 | __entry->e_cpos, __entry->clusters) | |
272 | ); | |
273 | ||
274 | TRACE_EVENT(ocfs2_commit_truncate, | |
275 | TP_PROTO(unsigned long long ino, unsigned int new_cpos, | |
276 | unsigned int clusters, unsigned int depth), | |
277 | TP_ARGS(ino, new_cpos, clusters, depth), | |
278 | TP_STRUCT__entry( | |
279 | __field(unsigned long long, ino) | |
280 | __field(unsigned int, new_cpos) | |
281 | __field(unsigned int, clusters) | |
282 | __field(unsigned int, depth) | |
283 | ), | |
284 | TP_fast_assign( | |
285 | __entry->ino = ino; | |
286 | __entry->new_cpos = new_cpos; | |
287 | __entry->clusters = clusters; | |
288 | __entry->depth = depth; | |
289 | ), | |
290 | TP_printk("%llu %u %u %u", | |
291 | __entry->ino, __entry->new_cpos, | |
292 | __entry->clusters, __entry->depth) | |
293 | ); | |
294 | ||
295 | TRACE_EVENT(ocfs2_validate_extent_block, | |
296 | TP_PROTO(unsigned long long blkno), | |
297 | TP_ARGS(blkno), | |
298 | TP_STRUCT__entry( | |
299 | __field(unsigned long long, blkno) | |
300 | ), | |
301 | TP_fast_assign( | |
302 | __entry->blkno = blkno; | |
303 | ), | |
304 | TP_printk("%llu ", __entry->blkno) | |
305 | ); | |
306 | ||
307 | TRACE_EVENT(ocfs2_rotate_leaf, | |
308 | TP_PROTO(unsigned int insert_cpos, int insert_index, | |
309 | int has_empty, int next_free, | |
310 | unsigned int l_count), | |
311 | TP_ARGS(insert_cpos, insert_index, has_empty, | |
312 | next_free, l_count), | |
313 | TP_STRUCT__entry( | |
314 | __field(unsigned int, insert_cpos) | |
315 | __field(int, insert_index) | |
316 | __field(int, has_empty) | |
317 | __field(int, next_free) | |
318 | __field(unsigned int, l_count) | |
319 | ), | |
320 | TP_fast_assign( | |
321 | __entry->insert_cpos = insert_cpos; | |
322 | __entry->insert_index = insert_index; | |
323 | __entry->has_empty = has_empty; | |
324 | __entry->next_free = next_free; | |
325 | __entry->l_count = l_count; | |
326 | ), | |
327 | TP_printk("%u %d %d %d %u", __entry->insert_cpos, | |
328 | __entry->insert_index, __entry->has_empty, | |
329 | __entry->next_free, __entry->l_count) | |
330 | ); | |
331 | ||
332 | TRACE_EVENT(ocfs2_add_clusters_in_btree_ret, | |
333 | TP_PROTO(int status, int reason, int err), | |
334 | TP_ARGS(status, reason, err), | |
335 | TP_STRUCT__entry( | |
336 | __field(int, status) | |
337 | __field(int, reason) | |
338 | __field(int, err) | |
339 | ), | |
340 | TP_fast_assign( | |
341 | __entry->status = status; | |
342 | __entry->reason = reason; | |
343 | __entry->err = err; | |
344 | ), | |
345 | TP_printk("%d %d %d", __entry->status, | |
346 | __entry->reason, __entry->err) | |
347 | ); | |
348 | ||
349 | TRACE_EVENT(ocfs2_mark_extent_written, | |
350 | TP_PROTO(unsigned long long owner, unsigned int cpos, | |
351 | unsigned int len, unsigned int phys), | |
352 | TP_ARGS(owner, cpos, len, phys), | |
353 | TP_STRUCT__entry( | |
354 | __field(unsigned long long, owner) | |
355 | __field(unsigned int, cpos) | |
356 | __field(unsigned int, len) | |
357 | __field(unsigned int, phys) | |
358 | ), | |
359 | TP_fast_assign( | |
360 | __entry->owner = owner; | |
361 | __entry->cpos = cpos; | |
362 | __entry->len = len; | |
363 | __entry->phys = phys; | |
364 | ), | |
365 | TP_printk("%llu %u %u %u", | |
366 | __entry->owner, __entry->cpos, | |
367 | __entry->len, __entry->phys) | |
368 | ); | |
369 | ||
370 | DECLARE_EVENT_CLASS(ocfs2__truncate_log_ops, | |
371 | TP_PROTO(unsigned long long blkno, int index, | |
372 | unsigned int start, unsigned int num), | |
373 | TP_ARGS(blkno, index, start, num), | |
374 | TP_STRUCT__entry( | |
375 | __field(unsigned long long, blkno) | |
376 | __field(int, index) | |
377 | __field(unsigned int, start) | |
378 | __field(unsigned int, num) | |
379 | ), | |
380 | TP_fast_assign( | |
381 | __entry->blkno = blkno; | |
382 | __entry->index = index; | |
383 | __entry->start = start; | |
384 | __entry->num = num; | |
385 | ), | |
386 | TP_printk("%llu %d %u %u", | |
387 | __entry->blkno, __entry->index, | |
388 | __entry->start, __entry->num) | |
389 | ); | |
390 | ||
391 | #define DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(name) \ | |
392 | DEFINE_EVENT(ocfs2__truncate_log_ops, name, \ | |
393 | TP_PROTO(unsigned long long blkno, int index, \ | |
394 | unsigned int start, unsigned int num), \ | |
395 | TP_ARGS(blkno, index, start, num)) | |
396 | ||
397 | DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(ocfs2_truncate_log_append); | |
398 | ||
399 | DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(ocfs2_replay_truncate_records); | |
400 | ||
401 | DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_flush_truncate_log); | |
402 | ||
403 | DEFINE_OCFS2_INT_EVENT(ocfs2_begin_truncate_log_recovery); | |
404 | ||
405 | DEFINE_OCFS2_INT_EVENT(ocfs2_truncate_log_recovery_num); | |
406 | ||
407 | DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_complete_truncate_log_recovery); | |
408 | ||
409 | DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_free_cached_blocks); | |
410 | ||
411 | DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_cache_cluster_dealloc); | |
412 | ||
413 | DEFINE_OCFS2_INT_INT_EVENT(ocfs2_run_deallocs); | |
414 | ||
415 | TRACE_EVENT(ocfs2_cache_block_dealloc, | |
416 | TP_PROTO(int type, int slot, unsigned long long suballoc, | |
417 | unsigned long long blkno, unsigned int bit), | |
418 | TP_ARGS(type, slot, suballoc, blkno, bit), | |
419 | TP_STRUCT__entry( | |
420 | __field(int, type) | |
421 | __field(int, slot) | |
422 | __field(unsigned long long, suballoc) | |
423 | __field(unsigned long long, blkno) | |
424 | __field(unsigned int, bit) | |
425 | ), | |
426 | TP_fast_assign( | |
427 | __entry->type = type; | |
428 | __entry->slot = slot; | |
429 | __entry->suballoc = suballoc; | |
430 | __entry->blkno = blkno; | |
431 | __entry->bit = bit; | |
432 | ), | |
433 | TP_printk("%d %d %llu %llu %u", | |
434 | __entry->type, __entry->slot, __entry->suballoc, | |
435 | __entry->blkno, __entry->bit) | |
436 | ); | |
437 | ||
438 | /* End of trace events for fs/ocfs2/alloc.c. */ | |
80a9a84d | 439 | |
a04733d8 TM |
440 | /* Trace events for fs/ocfs2/localalloc.c. */ |
441 | ||
442 | DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_la_set_sizes); | |
443 | ||
444 | DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_alloc_should_use_local); | |
445 | ||
446 | DEFINE_OCFS2_INT_EVENT(ocfs2_load_local_alloc); | |
447 | ||
448 | DEFINE_OCFS2_INT_EVENT(ocfs2_begin_local_alloc_recovery); | |
449 | ||
450 | DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_reserve_local_alloc_bits); | |
451 | ||
452 | DEFINE_OCFS2_UINT_EVENT(ocfs2_local_alloc_count_bits); | |
453 | ||
454 | DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits_search_bitmap); | |
455 | ||
456 | DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits); | |
457 | ||
458 | DEFINE_OCFS2_INT_INT_EVENT(ocfs2_sync_local_to_main); | |
459 | ||
460 | TRACE_EVENT(ocfs2_sync_local_to_main_free, | |
461 | TP_PROTO(int count, int bit, unsigned long long start_blk, | |
462 | unsigned long long blkno), | |
463 | TP_ARGS(count, bit, start_blk, blkno), | |
464 | TP_STRUCT__entry( | |
465 | __field(int, count) | |
466 | __field(int, bit) | |
467 | __field(unsigned long long, start_blk) | |
468 | __field(unsigned long long, blkno) | |
469 | ), | |
470 | TP_fast_assign( | |
471 | __entry->count = count; | |
472 | __entry->bit = bit; | |
473 | __entry->start_blk = start_blk; | |
474 | __entry->blkno = blkno; | |
475 | ), | |
476 | TP_printk("%d %d %llu %llu", | |
477 | __entry->count, __entry->bit, __entry->start_blk, | |
478 | __entry->blkno) | |
479 | ); | |
480 | ||
481 | DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_new_window); | |
482 | ||
483 | DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result); | |
484 | ||
485 | /* End of trace events for fs/ocfs2/localalloc.c. */ | |
80a9a84d WW |
486 | #endif /* _TRACE_OCFS2_H */ |
487 | ||
488 | /* This part must be outside protection */ | |
489 | #undef TRACE_INCLUDE_PATH | |
490 | #define TRACE_INCLUDE_PATH . | |
491 | #define TRACE_INCLUDE_FILE ocfs2_trace | |
492 | #include <trace/define_trace.h> |