2 #define TRACE_SYSTEM ocfs2
4 #if !defined(_TRACE_OCFS2_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/tracepoint.h>
9 DECLARE_EVENT_CLASS(ocfs2__int,
18 TP_printk("%d", __entry->num)
21 #define DEFINE_OCFS2_INT_EVENT(name) \
22 DEFINE_EVENT(ocfs2__int, name, \
26 DECLARE_EVENT_CLASS(ocfs2__uint,
27 TP_PROTO(unsigned int num),
30 __field( unsigned int, num )
35 TP_printk("%u", __entry->num)
38 #define DEFINE_OCFS2_UINT_EVENT(name) \
39 DEFINE_EVENT(ocfs2__uint, name, \
40 TP_PROTO(unsigned int num), \
43 DECLARE_EVENT_CLASS(ocfs2__int_int,
44 TP_PROTO(int value1, int value2),
45 TP_ARGS(value1, value2),
51 __entry->value1 = value1;
52 __entry->value2 = value2;
54 TP_printk("%d %d", __entry->value1, __entry->value2)
57 #define DEFINE_OCFS2_INT_INT_EVENT(name) \
58 DEFINE_EVENT(ocfs2__int_int, name, \
59 TP_PROTO(int val1, int val2), \
62 DECLARE_EVENT_CLASS(ocfs2__ull_uint,
63 TP_PROTO(unsigned long long value1, unsigned int value2),
64 TP_ARGS(value1, value2),
66 __field(unsigned long long, value1)
67 __field(unsigned int, value2)
70 __entry->value1 = value1;
71 __entry->value2 = value2;
73 TP_printk("%llu %u", __entry->value1, __entry->value2)
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), \
81 DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint,
82 TP_PROTO(unsigned int value1, unsigned int value2,
84 TP_ARGS(value1, value2, value3),
86 __field( unsigned int, value1 )
87 __field( unsigned int, value2 )
88 __field( unsigned int, value3 )
91 __entry->value1 = value1;
92 __entry->value2 = value2;
93 __entry->value3 = value3;
95 TP_printk("%u %u %u", __entry->value1, __entry->value2, __entry->value3)
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))
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),
108 __field( unsigned long long, ull )
109 __field( int, value1 )
110 __field( int, value2 )
111 __field( int, value3 )
115 __entry->value1 = value1;
116 __entry->value2 = value2;
117 __entry->value3 = value3;
119 TP_printk("%llu %d %d %d",
120 __entry->ull, __entry->value1,
121 __entry->value2, __entry->value3)
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))
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),
136 __field(unsigned long long, owner)
137 __field(unsigned int, value1)
138 __field(unsigned int, value2)
141 __entry->owner = owner;
142 __entry->value1 = value1;
143 __entry->value2 = value2;
145 TP_printk("%llu %u %u",
146 __entry->owner, __entry->value1, __entry->value2)
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))
155 DEFINE_OCFS2_BTREE_EVENT(ocfs2_adjust_rightmost_branch);
157 DEFINE_OCFS2_BTREE_EVENT(ocfs2_rotate_tree_right);
159 DEFINE_OCFS2_BTREE_EVENT(ocfs2_append_rec_to_path);
161 DEFINE_OCFS2_BTREE_EVENT(ocfs2_insert_extent_start);
163 DEFINE_OCFS2_BTREE_EVENT(ocfs2_add_clusters_in_btree);
165 DEFINE_OCFS2_INT_EVENT(ocfs2_num_free_extents);
167 DEFINE_OCFS2_INT_EVENT(ocfs2_complete_edge_insert);
169 TRACE_EVENT(ocfs2_grow_tree,
170 TP_PROTO(unsigned long long owner, int depth),
171 TP_ARGS(owner, depth),
173 __field(unsigned long long, owner)
177 __entry->owner = owner;
178 __entry->depth = depth;
180 TP_printk("%llu %d", __entry->owner, __entry->depth)
183 TRACE_EVENT(ocfs2_rotate_subtree,
184 TP_PROTO(int subtree_root, unsigned long long blkno,
186 TP_ARGS(subtree_root, blkno, depth),
188 __field(int, subtree_root)
189 __field(unsigned long long, blkno)
193 __entry->subtree_root = subtree_root;
194 __entry->blkno = blkno;
195 __entry->depth = depth;
197 TP_printk("%d %llu %d", __entry->subtree_root,
198 __entry->blkno, __entry->depth)
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,
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)
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;
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)
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),
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)
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;
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)
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),
254 __field(unsigned long long, owner)
255 __field(unsigned int, cpos)
256 __field(unsigned int, len)
258 __field(unsigned int, e_cpos)
259 __field(unsigned int, clusters)
262 __entry->owner = owner;
263 __entry->cpos = cpos;
265 __entry->index = index;
266 __entry->e_cpos = e_cpos;
267 __entry->clusters = clusters;
269 TP_printk("%llu %u %u %d %u %u",
270 __entry->owner, __entry->cpos, __entry->len, __entry->index,
271 __entry->e_cpos, __entry->clusters)
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),
279 __field(unsigned long long, ino)
280 __field(unsigned int, new_cpos)
281 __field(unsigned int, clusters)
282 __field(unsigned int, depth)
286 __entry->new_cpos = new_cpos;
287 __entry->clusters = clusters;
288 __entry->depth = depth;
290 TP_printk("%llu %u %u %u",
291 __entry->ino, __entry->new_cpos,
292 __entry->clusters, __entry->depth)
295 TRACE_EVENT(ocfs2_validate_extent_block,
296 TP_PROTO(unsigned long long blkno),
299 __field(unsigned long long, blkno)
302 __entry->blkno = blkno;
304 TP_printk("%llu ", __entry->blkno)
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,
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)
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;
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)
332 TRACE_EVENT(ocfs2_add_clusters_in_btree_ret,
333 TP_PROTO(int status, int reason, int err),
334 TP_ARGS(status, reason, err),
341 __entry->status = status;
342 __entry->reason = reason;
345 TP_printk("%d %d %d", __entry->status,
346 __entry->reason, __entry->err)
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),
354 __field(unsigned long long, owner)
355 __field(unsigned int, cpos)
356 __field(unsigned int, len)
357 __field(unsigned int, phys)
360 __entry->owner = owner;
361 __entry->cpos = cpos;
363 __entry->phys = phys;
365 TP_printk("%llu %u %u %u",
366 __entry->owner, __entry->cpos,
367 __entry->len, __entry->phys)
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),
375 __field(unsigned long long, blkno)
377 __field(unsigned int, start)
378 __field(unsigned int, num)
381 __entry->blkno = blkno;
382 __entry->index = index;
383 __entry->start = start;
386 TP_printk("%llu %d %u %u",
387 __entry->blkno, __entry->index,
388 __entry->start, __entry->num)
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))
397 DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(ocfs2_truncate_log_append);
399 DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(ocfs2_replay_truncate_records);
401 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_flush_truncate_log);
403 DEFINE_OCFS2_INT_EVENT(ocfs2_begin_truncate_log_recovery);
405 DEFINE_OCFS2_INT_EVENT(ocfs2_truncate_log_recovery_num);
407 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_complete_truncate_log_recovery);
409 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_free_cached_blocks);
411 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_cache_cluster_dealloc);
413 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_run_deallocs);
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),
422 __field(unsigned long long, suballoc)
423 __field(unsigned long long, blkno)
424 __field(unsigned int, bit)
427 __entry->type = type;
428 __entry->slot = slot;
429 __entry->suballoc = suballoc;
430 __entry->blkno = blkno;
433 TP_printk("%d %d %llu %llu %u",
434 __entry->type, __entry->slot, __entry->suballoc,
435 __entry->blkno, __entry->bit)
438 /* End of trace events for fs/ocfs2/alloc.c. */
440 /* Trace events for fs/ocfs2/localalloc.c. */
442 DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_la_set_sizes);
444 DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_alloc_should_use_local);
446 DEFINE_OCFS2_INT_EVENT(ocfs2_load_local_alloc);
448 DEFINE_OCFS2_INT_EVENT(ocfs2_begin_local_alloc_recovery);
450 DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_reserve_local_alloc_bits);
452 DEFINE_OCFS2_UINT_EVENT(ocfs2_local_alloc_count_bits);
454 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits_search_bitmap);
456 DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits);
458 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_sync_local_to_main);
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),
467 __field(unsigned long long, start_blk)
468 __field(unsigned long long, blkno)
471 __entry->count = count;
473 __entry->start_blk = start_blk;
474 __entry->blkno = blkno;
476 TP_printk("%d %d %llu %llu",
477 __entry->count, __entry->bit, __entry->start_blk,
481 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_new_window);
483 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result);
485 /* End of trace events for fs/ocfs2/localalloc.c. */
486 #endif /* _TRACE_OCFS2_H */
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>