blob: 77148e7a14f8188cae5c7b9628a820f5800534c5 [file] [log] [blame]
Wengang Wang80a9a842011-02-21 11:13:14 +08001#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
Tao Maa09d09b2011-02-22 08:21:10 +08009DECLARE_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) \
22DEFINE_EVENT(ocfs2__int, name, \
23 TP_PROTO(int num), \
24 TP_ARGS(num))
25
Tao Maa04733d2011-02-22 07:56:45 +080026DECLARE_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) \
39DEFINE_EVENT(ocfs2__uint, name, \
40 TP_PROTO(unsigned int num), \
41 TP_ARGS(num))
42
Tao Ma2f73e132011-02-22 08:22:33 +080043DECLARE_EVENT_CLASS(ocfs2__ull,
44 TP_PROTO(unsigned long long blkno),
45 TP_ARGS(blkno),
46 TP_STRUCT__entry(
47 __field(unsigned long long, blkno)
48 ),
49 TP_fast_assign(
50 __entry->blkno = blkno;
51 ),
52 TP_printk("%llu", __entry->blkno)
53);
54
55#define DEFINE_OCFS2_ULL_EVENT(name) \
56DEFINE_EVENT(ocfs2__ull, name, \
57 TP_PROTO(unsigned long long num), \
58 TP_ARGS(num))
59
Tao Maa09d09b2011-02-22 08:21:10 +080060DECLARE_EVENT_CLASS(ocfs2__int_int,
61 TP_PROTO(int value1, int value2),
62 TP_ARGS(value1, value2),
63 TP_STRUCT__entry(
64 __field(int, value1)
65 __field(int, value2)
66 ),
67 TP_fast_assign(
68 __entry->value1 = value1;
69 __entry->value2 = value2;
70 ),
71 TP_printk("%d %d", __entry->value1, __entry->value2)
72);
73
74#define DEFINE_OCFS2_INT_INT_EVENT(name) \
75DEFINE_EVENT(ocfs2__int_int, name, \
76 TP_PROTO(int val1, int val2), \
77 TP_ARGS(val1, val2))
78
Tao Ma2f73e132011-02-22 08:22:33 +080079DECLARE_EVENT_CLASS(ocfs2__uint_uint,
80 TP_PROTO(unsigned int value1, unsigned int value2),
81 TP_ARGS(value1, value2),
82 TP_STRUCT__entry(
83 __field(unsigned int, value1)
84 __field(unsigned int, value2)
85 ),
86 TP_fast_assign(
87 __entry->value1 = value1;
88 __entry->value2 = value2;
89 ),
90 TP_printk("%u %u", __entry->value1, __entry->value2)
91);
92
93#define DEFINE_OCFS2_UINT_UINT_EVENT(name) \
94DEFINE_EVENT(ocfs2__uint_uint, name, \
95 TP_PROTO(unsigned int val1, unsigned int val2), \
96 TP_ARGS(val1, val2))
97
Tao Maa09d09b2011-02-22 08:21:10 +080098DECLARE_EVENT_CLASS(ocfs2__ull_uint,
99 TP_PROTO(unsigned long long value1, unsigned int value2),
100 TP_ARGS(value1, value2),
101 TP_STRUCT__entry(
102 __field(unsigned long long, value1)
103 __field(unsigned int, value2)
104 ),
105 TP_fast_assign(
106 __entry->value1 = value1;
107 __entry->value2 = value2;
108 ),
109 TP_printk("%llu %u", __entry->value1, __entry->value2)
110);
111
112#define DEFINE_OCFS2_ULL_UINT_EVENT(name) \
113DEFINE_EVENT(ocfs2__ull_uint, name, \
114 TP_PROTO(unsigned long long val1, unsigned int val2), \
115 TP_ARGS(val1, val2))
116
Tao Ma2f73e132011-02-22 08:22:33 +0800117DECLARE_EVENT_CLASS(ocfs2__ull_ull,
118 TP_PROTO(unsigned long long value1, unsigned long long value2),
119 TP_ARGS(value1, value2),
120 TP_STRUCT__entry(
121 __field(unsigned long long, value1)
122 __field(unsigned long long, value2)
123 ),
124 TP_fast_assign(
125 __entry->value1 = value1;
126 __entry->value2 = value2;
127 ),
128 TP_printk("%llu %llu", __entry->value1, __entry->value2)
129);
130
131#define DEFINE_OCFS2_ULL_ULL_EVENT(name) \
132DEFINE_EVENT(ocfs2__ull_ull, name, \
133 TP_PROTO(unsigned long long val1, unsigned long long val2), \
134 TP_ARGS(val1, val2))
135
Tao Ma198aac282011-02-22 08:20:04 +0800136DECLARE_EVENT_CLASS(ocfs2__ull_ull_uint,
137 TP_PROTO(unsigned long long value1,
138 unsigned long long value2, unsigned int value3),
139 TP_ARGS(value1, value2, value3),
140 TP_STRUCT__entry(
141 __field(unsigned long long, value1)
142 __field(unsigned long long, value2)
143 __field(unsigned int, value3)
144 ),
145 TP_fast_assign(
146 __entry->value1 = value1;
147 __entry->value2 = value2;
148 __entry->value3 = value3;
149 ),
150 TP_printk("%llu %llu %u",
151 __entry->value1, __entry->value2, __entry->value3)
152);
153
154#define DEFINE_OCFS2_ULL_ULL_UINT_EVENT(name) \
155DEFINE_EVENT(ocfs2__ull_ull_uint, name, \
156 TP_PROTO(unsigned long long val1, \
157 unsigned long long val2, unsigned int val3), \
158 TP_ARGS(val1, val2, val3))
159
Tao Ma2f73e132011-02-22 08:22:33 +0800160DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint,
161 TP_PROTO(unsigned long long value1,
162 unsigned int value2, unsigned int value3),
163 TP_ARGS(value1, value2, value3),
164 TP_STRUCT__entry(
165 __field(unsigned long long, value1)
166 __field(unsigned int, value2)
167 __field(unsigned int, value3)
168 ),
169 TP_fast_assign(
170 __entry->value1 = value1;
171 __entry->value2 = value2;
172 __entry->value3 = value3;
173 ),
174 TP_printk("%llu %u %u", __entry->value1,
175 __entry->value2, __entry->value3)
176);
177
178#define DEFINE_OCFS2_ULL_UINT_UINT_EVENT(name) \
179DEFINE_EVENT(ocfs2__ull_uint_uint, name, \
180 TP_PROTO(unsigned long long val1, \
181 unsigned int val2, unsigned int val3), \
182 TP_ARGS(val1, val2, val3))
183
Tao Maa04733d2011-02-22 07:56:45 +0800184DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint,
185 TP_PROTO(unsigned int value1, unsigned int value2,
186 unsigned int value3),
187 TP_ARGS(value1, value2, value3),
188 TP_STRUCT__entry(
189 __field( unsigned int, value1 )
190 __field( unsigned int, value2 )
191 __field( unsigned int, value3 )
192 ),
193 TP_fast_assign(
194 __entry->value1 = value1;
195 __entry->value2 = value2;
196 __entry->value3 = value3;
197 ),
198 TP_printk("%u %u %u", __entry->value1, __entry->value2, __entry->value3)
199);
200
201#define DEFINE_OCFS2_UINT_UINT_UINT_EVENT(name) \
202DEFINE_EVENT(ocfs2__uint_uint_uint, name, \
203 TP_PROTO(unsigned int value1, unsigned int value2, \
204 unsigned int value3), \
205 TP_ARGS(value1, value2, value3))
206
207DECLARE_EVENT_CLASS(ocfs2__ull_int_int_int,
208 TP_PROTO(unsigned long long ull, int value1, int value2, int value3),
209 TP_ARGS(ull, value1, value2, value3),
210 TP_STRUCT__entry(
211 __field( unsigned long long, ull )
212 __field( int, value1 )
213 __field( int, value2 )
214 __field( int, value3 )
215 ),
216 TP_fast_assign(
217 __entry->ull = ull;
218 __entry->value1 = value1;
219 __entry->value2 = value2;
220 __entry->value3 = value3;
221 ),
222 TP_printk("%llu %d %d %d",
223 __entry->ull, __entry->value1,
224 __entry->value2, __entry->value3)
225);
226
227#define DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(name) \
228DEFINE_EVENT(ocfs2__ull_int_int_int, name, \
229 TP_PROTO(unsigned long long ull, int value1, \
230 int value2, int value3), \
231 TP_ARGS(ull, value1, value2, value3))
232
Tao Ma2f73e132011-02-22 08:22:33 +0800233DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint_uint,
234 TP_PROTO(unsigned long long ull, unsigned int value1,
235 unsigned int value2, unsigned int value3),
236 TP_ARGS(ull, value1, value2, value3),
237 TP_STRUCT__entry(
238 __field(unsigned long long, ull)
239 __field(unsigned int, value1)
240 __field(unsigned int, value2)
241 __field(unsigned int, value3)
242 ),
243 TP_fast_assign(
244 __entry->ull = ull;
245 __entry->value1 = value1;
246 __entry->value2 = value2;
247 __entry->value3 = value3;
248 ),
249 TP_printk("%llu %u %u %u",
250 __entry->ull, __entry->value1,
251 __entry->value2, __entry->value3)
252);
253
254#define DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(name) \
255DEFINE_EVENT(ocfs2__ull_uint_uint_uint, name, \
256 TP_PROTO(unsigned long long ull, unsigned int value1, \
257 unsigned int value2, unsigned int value3), \
258 TP_ARGS(ull, value1, value2, value3))
259
Tao Maa09d09b2011-02-22 08:21:10 +0800260/* Trace events for fs/ocfs2/alloc.c. */
261DECLARE_EVENT_CLASS(ocfs2__btree_ops,
262 TP_PROTO(unsigned long long owner,\
263 unsigned int value1, unsigned int value2),
264 TP_ARGS(owner, value1, value2),
265 TP_STRUCT__entry(
266 __field(unsigned long long, owner)
267 __field(unsigned int, value1)
268 __field(unsigned int, value2)
269 ),
270 TP_fast_assign(
271 __entry->owner = owner;
272 __entry->value1 = value1;
273 __entry->value2 = value2;
274 ),
275 TP_printk("%llu %u %u",
276 __entry->owner, __entry->value1, __entry->value2)
277);
278
279#define DEFINE_OCFS2_BTREE_EVENT(name) \
280DEFINE_EVENT(ocfs2__btree_ops, name, \
281 TP_PROTO(unsigned long long owner, \
282 unsigned int value1, unsigned int value2), \
283 TP_ARGS(owner, value1, value2))
284
285DEFINE_OCFS2_BTREE_EVENT(ocfs2_adjust_rightmost_branch);
286
287DEFINE_OCFS2_BTREE_EVENT(ocfs2_rotate_tree_right);
288
289DEFINE_OCFS2_BTREE_EVENT(ocfs2_append_rec_to_path);
290
291DEFINE_OCFS2_BTREE_EVENT(ocfs2_insert_extent_start);
292
293DEFINE_OCFS2_BTREE_EVENT(ocfs2_add_clusters_in_btree);
294
295DEFINE_OCFS2_INT_EVENT(ocfs2_num_free_extents);
296
297DEFINE_OCFS2_INT_EVENT(ocfs2_complete_edge_insert);
298
299TRACE_EVENT(ocfs2_grow_tree,
300 TP_PROTO(unsigned long long owner, int depth),
301 TP_ARGS(owner, depth),
302 TP_STRUCT__entry(
303 __field(unsigned long long, owner)
304 __field(int, depth)
305 ),
306 TP_fast_assign(
307 __entry->owner = owner;
308 __entry->depth = depth;
309 ),
310 TP_printk("%llu %d", __entry->owner, __entry->depth)
311);
312
313TRACE_EVENT(ocfs2_rotate_subtree,
314 TP_PROTO(int subtree_root, unsigned long long blkno,
315 int depth),
316 TP_ARGS(subtree_root, blkno, depth),
317 TP_STRUCT__entry(
318 __field(int, subtree_root)
319 __field(unsigned long long, blkno)
320 __field(int, depth)
321 ),
322 TP_fast_assign(
323 __entry->subtree_root = subtree_root;
324 __entry->blkno = blkno;
325 __entry->depth = depth;
326 ),
327 TP_printk("%d %llu %d", __entry->subtree_root,
328 __entry->blkno, __entry->depth)
329);
330
331TRACE_EVENT(ocfs2_insert_extent,
332 TP_PROTO(unsigned int ins_appending, unsigned int ins_contig,
333 int ins_contig_index, int free_records, int ins_tree_depth),
334 TP_ARGS(ins_appending, ins_contig, ins_contig_index, free_records,
335 ins_tree_depth),
336 TP_STRUCT__entry(
337 __field(unsigned int, ins_appending)
338 __field(unsigned int, ins_contig)
339 __field(int, ins_contig_index)
340 __field(int, free_records)
341 __field(int, ins_tree_depth)
342 ),
343 TP_fast_assign(
344 __entry->ins_appending = ins_appending;
345 __entry->ins_contig = ins_contig;
346 __entry->ins_contig_index = ins_contig_index;
347 __entry->free_records = free_records;
348 __entry->ins_tree_depth = ins_tree_depth;
349 ),
350 TP_printk("%u %u %d %d %d",
351 __entry->ins_appending, __entry->ins_contig,
352 __entry->ins_contig_index, __entry->free_records,
353 __entry->ins_tree_depth)
354);
355
356TRACE_EVENT(ocfs2_split_extent,
357 TP_PROTO(int split_index, unsigned int c_contig_type,
358 unsigned int c_has_empty_extent,
359 unsigned int c_split_covers_rec),
360 TP_ARGS(split_index, c_contig_type,
361 c_has_empty_extent, c_split_covers_rec),
362 TP_STRUCT__entry(
363 __field(int, split_index)
364 __field(unsigned int, c_contig_type)
365 __field(unsigned int, c_has_empty_extent)
366 __field(unsigned int, c_split_covers_rec)
367 ),
368 TP_fast_assign(
369 __entry->split_index = split_index;
370 __entry->c_contig_type = c_contig_type;
371 __entry->c_has_empty_extent = c_has_empty_extent;
372 __entry->c_split_covers_rec = c_split_covers_rec;
373 ),
374 TP_printk("%d %u %u %u", __entry->split_index, __entry->c_contig_type,
375 __entry->c_has_empty_extent, __entry->c_split_covers_rec)
376);
377
378TRACE_EVENT(ocfs2_remove_extent,
379 TP_PROTO(unsigned long long owner, unsigned int cpos,
380 unsigned int len, int index,
381 unsigned int e_cpos, unsigned int clusters),
382 TP_ARGS(owner, cpos, len, index, e_cpos, clusters),
383 TP_STRUCT__entry(
384 __field(unsigned long long, owner)
385 __field(unsigned int, cpos)
386 __field(unsigned int, len)
387 __field(int, index)
388 __field(unsigned int, e_cpos)
389 __field(unsigned int, clusters)
390 ),
391 TP_fast_assign(
392 __entry->owner = owner;
393 __entry->cpos = cpos;
394 __entry->len = len;
395 __entry->index = index;
396 __entry->e_cpos = e_cpos;
397 __entry->clusters = clusters;
398 ),
399 TP_printk("%llu %u %u %d %u %u",
400 __entry->owner, __entry->cpos, __entry->len, __entry->index,
401 __entry->e_cpos, __entry->clusters)
402);
403
404TRACE_EVENT(ocfs2_commit_truncate,
405 TP_PROTO(unsigned long long ino, unsigned int new_cpos,
406 unsigned int clusters, unsigned int depth),
407 TP_ARGS(ino, new_cpos, clusters, depth),
408 TP_STRUCT__entry(
409 __field(unsigned long long, ino)
410 __field(unsigned int, new_cpos)
411 __field(unsigned int, clusters)
412 __field(unsigned int, depth)
413 ),
414 TP_fast_assign(
415 __entry->ino = ino;
416 __entry->new_cpos = new_cpos;
417 __entry->clusters = clusters;
418 __entry->depth = depth;
419 ),
420 TP_printk("%llu %u %u %u",
421 __entry->ino, __entry->new_cpos,
422 __entry->clusters, __entry->depth)
423);
424
425TRACE_EVENT(ocfs2_validate_extent_block,
426 TP_PROTO(unsigned long long blkno),
427 TP_ARGS(blkno),
428 TP_STRUCT__entry(
429 __field(unsigned long long, blkno)
430 ),
431 TP_fast_assign(
432 __entry->blkno = blkno;
433 ),
434 TP_printk("%llu ", __entry->blkno)
435);
436
437TRACE_EVENT(ocfs2_rotate_leaf,
438 TP_PROTO(unsigned int insert_cpos, int insert_index,
439 int has_empty, int next_free,
440 unsigned int l_count),
441 TP_ARGS(insert_cpos, insert_index, has_empty,
442 next_free, l_count),
443 TP_STRUCT__entry(
444 __field(unsigned int, insert_cpos)
445 __field(int, insert_index)
446 __field(int, has_empty)
447 __field(int, next_free)
448 __field(unsigned int, l_count)
449 ),
450 TP_fast_assign(
451 __entry->insert_cpos = insert_cpos;
452 __entry->insert_index = insert_index;
453 __entry->has_empty = has_empty;
454 __entry->next_free = next_free;
455 __entry->l_count = l_count;
456 ),
457 TP_printk("%u %d %d %d %u", __entry->insert_cpos,
458 __entry->insert_index, __entry->has_empty,
459 __entry->next_free, __entry->l_count)
460);
461
462TRACE_EVENT(ocfs2_add_clusters_in_btree_ret,
463 TP_PROTO(int status, int reason, int err),
464 TP_ARGS(status, reason, err),
465 TP_STRUCT__entry(
466 __field(int, status)
467 __field(int, reason)
468 __field(int, err)
469 ),
470 TP_fast_assign(
471 __entry->status = status;
472 __entry->reason = reason;
473 __entry->err = err;
474 ),
475 TP_printk("%d %d %d", __entry->status,
476 __entry->reason, __entry->err)
477);
478
479TRACE_EVENT(ocfs2_mark_extent_written,
480 TP_PROTO(unsigned long long owner, unsigned int cpos,
481 unsigned int len, unsigned int phys),
482 TP_ARGS(owner, cpos, len, phys),
483 TP_STRUCT__entry(
484 __field(unsigned long long, owner)
485 __field(unsigned int, cpos)
486 __field(unsigned int, len)
487 __field(unsigned int, phys)
488 ),
489 TP_fast_assign(
490 __entry->owner = owner;
491 __entry->cpos = cpos;
492 __entry->len = len;
493 __entry->phys = phys;
494 ),
495 TP_printk("%llu %u %u %u",
496 __entry->owner, __entry->cpos,
497 __entry->len, __entry->phys)
498);
499
500DECLARE_EVENT_CLASS(ocfs2__truncate_log_ops,
501 TP_PROTO(unsigned long long blkno, int index,
502 unsigned int start, unsigned int num),
503 TP_ARGS(blkno, index, start, num),
504 TP_STRUCT__entry(
505 __field(unsigned long long, blkno)
506 __field(int, index)
507 __field(unsigned int, start)
508 __field(unsigned int, num)
509 ),
510 TP_fast_assign(
511 __entry->blkno = blkno;
512 __entry->index = index;
513 __entry->start = start;
514 __entry->num = num;
515 ),
516 TP_printk("%llu %d %u %u",
517 __entry->blkno, __entry->index,
518 __entry->start, __entry->num)
519);
520
521#define DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(name) \
522DEFINE_EVENT(ocfs2__truncate_log_ops, name, \
523 TP_PROTO(unsigned long long blkno, int index, \
524 unsigned int start, unsigned int num), \
525 TP_ARGS(blkno, index, start, num))
526
527DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(ocfs2_truncate_log_append);
528
529DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(ocfs2_replay_truncate_records);
530
531DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_flush_truncate_log);
532
533DEFINE_OCFS2_INT_EVENT(ocfs2_begin_truncate_log_recovery);
534
535DEFINE_OCFS2_INT_EVENT(ocfs2_truncate_log_recovery_num);
536
537DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_complete_truncate_log_recovery);
538
539DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_free_cached_blocks);
540
541DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_cache_cluster_dealloc);
542
543DEFINE_OCFS2_INT_INT_EVENT(ocfs2_run_deallocs);
544
545TRACE_EVENT(ocfs2_cache_block_dealloc,
546 TP_PROTO(int type, int slot, unsigned long long suballoc,
547 unsigned long long blkno, unsigned int bit),
548 TP_ARGS(type, slot, suballoc, blkno, bit),
549 TP_STRUCT__entry(
550 __field(int, type)
551 __field(int, slot)
552 __field(unsigned long long, suballoc)
553 __field(unsigned long long, blkno)
554 __field(unsigned int, bit)
555 ),
556 TP_fast_assign(
557 __entry->type = type;
558 __entry->slot = slot;
559 __entry->suballoc = suballoc;
560 __entry->blkno = blkno;
561 __entry->bit = bit;
562 ),
563 TP_printk("%d %d %llu %llu %u",
564 __entry->type, __entry->slot, __entry->suballoc,
565 __entry->blkno, __entry->bit)
566);
567
568/* End of trace events for fs/ocfs2/alloc.c. */
Wengang Wang80a9a842011-02-21 11:13:14 +0800569
Tao Maa04733d2011-02-22 07:56:45 +0800570/* Trace events for fs/ocfs2/localalloc.c. */
571
572DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_la_set_sizes);
573
574DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_alloc_should_use_local);
575
576DEFINE_OCFS2_INT_EVENT(ocfs2_load_local_alloc);
577
578DEFINE_OCFS2_INT_EVENT(ocfs2_begin_local_alloc_recovery);
579
580DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_reserve_local_alloc_bits);
581
582DEFINE_OCFS2_UINT_EVENT(ocfs2_local_alloc_count_bits);
583
584DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits_search_bitmap);
585
586DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits);
587
588DEFINE_OCFS2_INT_INT_EVENT(ocfs2_sync_local_to_main);
589
590TRACE_EVENT(ocfs2_sync_local_to_main_free,
591 TP_PROTO(int count, int bit, unsigned long long start_blk,
592 unsigned long long blkno),
593 TP_ARGS(count, bit, start_blk, blkno),
594 TP_STRUCT__entry(
595 __field(int, count)
596 __field(int, bit)
597 __field(unsigned long long, start_blk)
598 __field(unsigned long long, blkno)
599 ),
600 TP_fast_assign(
601 __entry->count = count;
602 __entry->bit = bit;
603 __entry->start_blk = start_blk;
604 __entry->blkno = blkno;
605 ),
606 TP_printk("%d %d %llu %llu",
607 __entry->count, __entry->bit, __entry->start_blk,
608 __entry->blkno)
609);
610
611DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_new_window);
612
613DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result);
614
615/* End of trace events for fs/ocfs2/localalloc.c. */
Tao Ma2f73e132011-02-22 08:22:33 +0800616
Tao Maa5438702011-02-22 08:24:01 +0800617/* Trace events for fs/ocfs2/resize.c. */
618
619DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_update_last_group_and_inode);
620
621DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_group_extend);
622
623DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_group_add);
624
625/* End of trace events for fs/ocfs2/resize.c. */
626
Tao Ma2f73e132011-02-22 08:22:33 +0800627/* Trace events for fs/ocfs2/suballoc.c. */
628
629DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_group_descriptor);
630
631DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_block_group_alloc_contig);
632
633DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_block_group_alloc_discontig);
634
635DEFINE_OCFS2_ULL_EVENT(ocfs2_block_group_alloc);
636
637DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_reserve_suballoc_bits_nospc);
638
639DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_reserve_suballoc_bits_no_new_group);
640
641DEFINE_OCFS2_ULL_EVENT(ocfs2_reserve_new_inode_new_group);
642
643DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_block_group_set_bits);
644
645TRACE_EVENT(ocfs2_relink_block_group,
646 TP_PROTO(unsigned long long i_blkno, unsigned int chain,
647 unsigned long long bg_blkno,
648 unsigned long long prev_blkno),
649 TP_ARGS(i_blkno, chain, bg_blkno, prev_blkno),
650 TP_STRUCT__entry(
651 __field(unsigned long long, i_blkno)
652 __field(unsigned int, chain)
653 __field(unsigned long long, bg_blkno)
654 __field(unsigned long long, prev_blkno)
655 ),
656 TP_fast_assign(
657 __entry->i_blkno = i_blkno;
658 __entry->chain = chain;
659 __entry->bg_blkno = bg_blkno;
660 __entry->prev_blkno = prev_blkno;
661 ),
662 TP_printk("%llu %u %llu %llu",
663 __entry->i_blkno, __entry->chain, __entry->bg_blkno,
664 __entry->prev_blkno)
665);
666
667DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_cluster_group_search_wrong_max_bits);
668
669DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_cluster_group_search_max_block);
670
671DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_block_group_search_max_block);
672
673DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_search_chain_begin);
674
675DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_search_chain_succ);
676
677DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_search_chain_end);
678
679DEFINE_OCFS2_UINT_EVENT(ocfs2_claim_suballoc_bits);
680
681DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_claim_new_inode_at_loc);
682
683DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_block_group_clear_bits);
684
685TRACE_EVENT(ocfs2_free_suballoc_bits,
686 TP_PROTO(unsigned long long inode, unsigned long long group,
687 unsigned int start_bit, unsigned int count),
688 TP_ARGS(inode, group, start_bit, count),
689 TP_STRUCT__entry(
690 __field(unsigned long long, inode)
691 __field(unsigned long long, group)
692 __field(unsigned int, start_bit)
693 __field(unsigned int, count)
694 ),
695 TP_fast_assign(
696 __entry->inode = inode;
697 __entry->group = group;
698 __entry->start_bit = start_bit;
699 __entry->count = count;
700 ),
701 TP_printk("%llu %llu %u %u", __entry->inode, __entry->group,
702 __entry->start_bit, __entry->count)
703);
704
705TRACE_EVENT(ocfs2_free_clusters,
706 TP_PROTO(unsigned long long bg_blkno, unsigned long long start_blk,
707 unsigned int start_bit, unsigned int count),
708 TP_ARGS(bg_blkno, start_blk, start_bit, count),
709 TP_STRUCT__entry(
710 __field(unsigned long long, bg_blkno)
711 __field(unsigned long long, start_blk)
712 __field(unsigned int, start_bit)
713 __field(unsigned int, count)
714 ),
715 TP_fast_assign(
716 __entry->bg_blkno = bg_blkno;
717 __entry->start_blk = start_blk;
718 __entry->start_bit = start_bit;
719 __entry->count = count;
720 ),
721 TP_printk("%llu %llu %u %u", __entry->bg_blkno, __entry->start_blk,
722 __entry->start_bit, __entry->count)
723);
724
725DEFINE_OCFS2_ULL_EVENT(ocfs2_get_suballoc_slot_bit);
726
727DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_test_suballoc_bit);
728
729DEFINE_OCFS2_ULL_EVENT(ocfs2_test_inode_bit);
730
731/* End of trace events for fs/ocfs2/suballoc.c. */
Tao Ma198aac282011-02-22 08:20:04 +0800732
733/* Trace events for fs/ocfs2/refcounttree.c. */
734
735DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_refcount_block);
736
737DEFINE_OCFS2_ULL_EVENT(ocfs2_purge_refcount_trees);
738
739DEFINE_OCFS2_ULL_EVENT(ocfs2_create_refcount_tree);
740
741DEFINE_OCFS2_ULL_EVENT(ocfs2_create_refcount_tree_blkno);
742
743DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_change_refcount_rec);
744
745DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_expand_inline_ref_root);
746
747DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_divide_leaf_refcount_block);
748
749DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_new_leaf_refcount_block);
750
751DECLARE_EVENT_CLASS(ocfs2__refcount_tree_ops,
752 TP_PROTO(unsigned long long blkno, int index,
753 unsigned long long cpos,
754 unsigned int clusters, unsigned int refcount),
755 TP_ARGS(blkno, index, cpos, clusters, refcount),
756 TP_STRUCT__entry(
757 __field(unsigned long long, blkno)
758 __field(int, index)
759 __field(unsigned long long, cpos)
760 __field(unsigned int, clusters)
761 __field(unsigned int, refcount)
762 ),
763 TP_fast_assign(
764 __entry->blkno = blkno;
765 __entry->index = index;
766 __entry->cpos = cpos;
767 __entry->clusters = clusters;
768 __entry->refcount = refcount;
769 ),
770 TP_printk("%llu %d %llu %u %u", __entry->blkno, __entry->index,
771 __entry->cpos, __entry->clusters, __entry->refcount)
772);
773
774#define DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(name) \
775DEFINE_EVENT(ocfs2__refcount_tree_ops, name, \
776 TP_PROTO(unsigned long long blkno, int index, \
777 unsigned long long cpos, \
778 unsigned int count, unsigned int refcount), \
779 TP_ARGS(blkno, index, cpos, count, refcount))
780
781DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(ocfs2_insert_refcount_rec);
782
783TRACE_EVENT(ocfs2_split_refcount_rec,
784 TP_PROTO(unsigned long long cpos,
785 unsigned int clusters, unsigned int refcount,
786 unsigned long long split_cpos,
787 unsigned int split_clusters, unsigned int split_refcount),
788 TP_ARGS(cpos, clusters, refcount,
789 split_cpos, split_clusters, split_refcount),
790 TP_STRUCT__entry(
791 __field(unsigned long long, cpos)
792 __field(unsigned int, clusters)
793 __field(unsigned int, refcount)
794 __field(unsigned long long, split_cpos)
795 __field(unsigned int, split_clusters)
796 __field(unsigned int, split_refcount)
797 ),
798 TP_fast_assign(
799 __entry->cpos = cpos;
800 __entry->clusters = clusters;
801 __entry->refcount = refcount;
802 __entry->split_cpos = split_cpos;
803 __entry->split_clusters = split_clusters;
804 __entry->split_refcount = split_refcount;
805 ),
806 TP_printk("%llu %u %u %llu %u %u",
807 __entry->cpos, __entry->clusters, __entry->refcount,
808 __entry->split_cpos, __entry->split_clusters,
809 __entry->split_refcount)
810);
811
812DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(ocfs2_split_refcount_rec_insert);
813
814DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_increase_refcount_begin);
815
816DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_increase_refcount_change);
817
818DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_increase_refcount_insert);
819
820DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_increase_refcount_split);
821
822DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_remove_refcount_extent);
823
824DEFINE_OCFS2_ULL_EVENT(ocfs2_restore_refcount_block);
825
826DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_decrease_refcount_rec);
827
828TRACE_EVENT(ocfs2_decrease_refcount,
829 TP_PROTO(unsigned long long owner,
830 unsigned long long cpos,
831 unsigned int len, int delete),
832 TP_ARGS(owner, cpos, len, delete),
833 TP_STRUCT__entry(
834 __field(unsigned long long, owner)
835 __field(unsigned long long, cpos)
836 __field(unsigned int, len)
837 __field(int, delete)
838 ),
839 TP_fast_assign(
840 __entry->owner = owner;
841 __entry->cpos = cpos;
842 __entry->len = len;
843 __entry->delete = delete;
844 ),
845 TP_printk("%llu %llu %u %d",
846 __entry->owner, __entry->cpos, __entry->len, __entry->delete)
847);
848
849DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_mark_extent_refcounted);
850
851DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_calc_refcount_meta_credits);
852
853TRACE_EVENT(ocfs2_calc_refcount_meta_credits_iterate,
854 TP_PROTO(int recs_add, unsigned long long cpos,
855 unsigned int clusters, unsigned long long r_cpos,
856 unsigned int r_clusters, unsigned int refcount, int index),
857 TP_ARGS(recs_add, cpos, clusters, r_cpos, r_clusters, refcount, index),
858 TP_STRUCT__entry(
859 __field(int, recs_add)
860 __field(unsigned long long, cpos)
861 __field(unsigned int, clusters)
862 __field(unsigned long long, r_cpos)
863 __field(unsigned int, r_clusters)
864 __field(unsigned int, refcount)
865 __field(int, index)
866 ),
867 TP_fast_assign(
868 __entry->recs_add = recs_add;
869 __entry->cpos = cpos;
870 __entry->clusters = clusters;
871 __entry->r_cpos = r_cpos;
872 __entry->r_clusters = r_clusters;
873 __entry->refcount = refcount;
874 __entry->index = index;
875 ),
876 TP_printk("%d %llu %u %llu %u %u %d",
877 __entry->recs_add, __entry->cpos, __entry->clusters,
878 __entry->r_cpos, __entry->r_clusters,
879 __entry->refcount, __entry->index)
880);
881
882DEFINE_OCFS2_INT_INT_EVENT(ocfs2_add_refcount_flag);
883
884DEFINE_OCFS2_INT_INT_EVENT(ocfs2_prepare_refcount_change_for_del);
885
886DEFINE_OCFS2_INT_INT_EVENT(ocfs2_lock_refcount_allocators);
887
888DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_duplicate_clusters_by_page);
889
890DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_duplicate_clusters_by_jbd);
891
892TRACE_EVENT(ocfs2_clear_ext_refcount,
893 TP_PROTO(unsigned long long ino, unsigned int cpos,
894 unsigned int len, unsigned int p_cluster,
895 unsigned int ext_flags),
896 TP_ARGS(ino, cpos, len, p_cluster, ext_flags),
897 TP_STRUCT__entry(
898 __field(unsigned long long, ino)
899 __field(unsigned int, cpos)
900 __field(unsigned int, len)
901 __field(unsigned int, p_cluster)
902 __field(unsigned int, ext_flags)
903 ),
904 TP_fast_assign(
905 __entry->ino = ino;
906 __entry->cpos = cpos;
907 __entry->len = len;
908 __entry->p_cluster = p_cluster;
909 __entry->ext_flags = ext_flags;
910 ),
911 TP_printk("%llu %u %u %u %u",
912 __entry->ino, __entry->cpos, __entry->len,
913 __entry->p_cluster, __entry->ext_flags)
914);
915
916TRACE_EVENT(ocfs2_replace_clusters,
917 TP_PROTO(unsigned long long ino, unsigned int cpos,
918 unsigned int old, unsigned int new, unsigned int len,
919 unsigned int ext_flags),
920 TP_ARGS(ino, cpos, old, new, len, ext_flags),
921 TP_STRUCT__entry(
922 __field(unsigned long long, ino)
923 __field(unsigned int, cpos)
924 __field(unsigned int, old)
925 __field(unsigned int, new)
926 __field(unsigned int, len)
927 __field(unsigned int, ext_flags)
928 ),
929 TP_fast_assign(
930 __entry->ino = ino;
931 __entry->cpos = cpos;
932 __entry->old = old;
933 __entry->new = new;
934 __entry->len = len;
935 __entry->ext_flags = ext_flags;
936 ),
937 TP_printk("%llu %u %u %u %u %u",
938 __entry->ino, __entry->cpos, __entry->old, __entry->new,
939 __entry->len, __entry->ext_flags)
940);
941
942DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_make_clusters_writable);
943
944TRACE_EVENT(ocfs2_refcount_cow_hunk,
945 TP_PROTO(unsigned long long ino, unsigned int cpos,
946 unsigned int write_len, unsigned int max_cpos,
947 unsigned int cow_start, unsigned int cow_len),
948 TP_ARGS(ino, cpos, write_len, max_cpos, cow_start, cow_len),
949 TP_STRUCT__entry(
950 __field(unsigned long long, ino)
951 __field(unsigned int, cpos)
952 __field(unsigned int, write_len)
953 __field(unsigned int, max_cpos)
954 __field(unsigned int, cow_start)
955 __field(unsigned int, cow_len)
956 ),
957 TP_fast_assign(
958 __entry->ino = ino;
959 __entry->cpos = cpos;
960 __entry->write_len = write_len;
961 __entry->max_cpos = max_cpos;
962 __entry->cow_start = cow_start;
963 __entry->cow_len = cow_len;
964 ),
965 TP_printk("%llu %u %u %u %u %u",
966 __entry->ino, __entry->cpos, __entry->write_len,
967 __entry->max_cpos, __entry->cow_start, __entry->cow_len)
968);
969
970/* End of trace events for fs/ocfs2/refcounttree.c. */
Tao Ma95581562011-02-22 21:33:59 +0800971
972/* Trace events for fs/ocfs2/aops.c. */
973
974DECLARE_EVENT_CLASS(ocfs2__get_block,
975 TP_PROTO(unsigned long long ino, unsigned long long iblock,
976 void *bh_result, int create),
977 TP_ARGS(ino, iblock, bh_result, create),
978 TP_STRUCT__entry(
979 __field(unsigned long long, ino)
980 __field(unsigned long long, iblock)
981 __field(void *, bh_result)
982 __field(int, create)
983 ),
984 TP_fast_assign(
985 __entry->ino = ino;
986 __entry->iblock = iblock;
987 __entry->bh_result = bh_result;
988 __entry->create = create;
989 ),
990 TP_printk("%llu %llu %p %d",
991 __entry->ino, __entry->iblock,
992 __entry->bh_result, __entry->create)
993);
994
995#define DEFINE_OCFS2_GET_BLOCK_EVENT(name) \
996DEFINE_EVENT(ocfs2__get_block, name, \
997 TP_PROTO(unsigned long long ino, unsigned long long iblock, \
998 void *bh_result, int create), \
999 TP_ARGS(ino, iblock, bh_result, create))
1000
1001DEFINE_OCFS2_GET_BLOCK_EVENT(ocfs2_symlink_get_block);
1002
1003DEFINE_OCFS2_GET_BLOCK_EVENT(ocfs2_get_block);
1004
1005DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_get_block_end);
1006
1007DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_readpage);
1008
1009DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_writepage);
1010
1011DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_bmap);
1012
1013TRACE_EVENT(ocfs2_try_to_write_inline_data,
1014 TP_PROTO(unsigned long long ino, unsigned int len,
1015 unsigned long long pos, unsigned int flags),
1016 TP_ARGS(ino, len, pos, flags),
1017 TP_STRUCT__entry(
1018 __field(unsigned long long, ino)
1019 __field(unsigned int, len)
1020 __field(unsigned long long, pos)
1021 __field(unsigned int, flags)
1022 ),
1023 TP_fast_assign(
1024 __entry->ino = ino;
1025 __entry->len = len;
1026 __entry->pos = pos;
1027 __entry->flags = flags;
1028 ),
1029 TP_printk("%llu %u %llu 0x%x",
1030 __entry->ino, __entry->len, __entry->pos, __entry->flags)
1031);
1032
1033TRACE_EVENT(ocfs2_write_begin_nolock,
1034 TP_PROTO(unsigned long long ino,
1035 long long i_size, unsigned int i_clusters,
1036 unsigned long long pos, unsigned int len,
1037 unsigned int flags, void *page,
1038 unsigned int clusters, unsigned int extents_to_split),
1039 TP_ARGS(ino, i_size, i_clusters, pos, len, flags,
1040 page, clusters, extents_to_split),
1041 TP_STRUCT__entry(
1042 __field(unsigned long long, ino)
1043 __field(long long, i_size)
1044 __field(unsigned int, i_clusters)
1045 __field(unsigned long long, pos)
1046 __field(unsigned int, len)
1047 __field(unsigned int, flags)
1048 __field(void *, page)
1049 __field(unsigned int, clusters)
1050 __field(unsigned int, extents_to_split)
1051 ),
1052 TP_fast_assign(
1053 __entry->ino = ino;
1054 __entry->i_size = i_size;
1055 __entry->i_clusters = i_clusters;
1056 __entry->pos = pos;
1057 __entry->len = len;
1058 __entry->flags = flags;
1059 __entry->page = page;
1060 __entry->clusters = clusters;
1061 __entry->extents_to_split = extents_to_split;
1062 ),
1063 TP_printk("%llu %lld %u %llu %u %u %p %u %u",
1064 __entry->ino, __entry->i_size, __entry->i_clusters,
1065 __entry->pos, __entry->len,
1066 __entry->flags, __entry->page, __entry->clusters,
1067 __entry->extents_to_split)
1068);
1069
1070TRACE_EVENT(ocfs2_write_end_inline,
1071 TP_PROTO(unsigned long long ino,
1072 unsigned long long pos, unsigned int copied,
1073 unsigned int id_count, unsigned int features),
1074 TP_ARGS(ino, pos, copied, id_count, features),
1075 TP_STRUCT__entry(
1076 __field(unsigned long long, ino)
1077 __field(unsigned long long, pos)
1078 __field(unsigned int, copied)
1079 __field(unsigned int, id_count)
1080 __field(unsigned int, features)
1081 ),
1082 TP_fast_assign(
1083 __entry->ino = ino;
1084 __entry->pos = pos;
1085 __entry->copied = copied;
1086 __entry->id_count = id_count;
1087 __entry->features = features;
1088 ),
1089 TP_printk("%llu %llu %u %u %u",
1090 __entry->ino, __entry->pos, __entry->copied,
1091 __entry->id_count, __entry->features)
1092);
1093
1094/* End of trace events for fs/ocfs2/aops.c. */
Tao Ma614a9e82011-02-22 21:59:46 +08001095
1096/* Trace events for fs/ocfs2/mmap.c. */
1097
1098TRACE_EVENT(ocfs2_fault,
1099 TP_PROTO(unsigned long long ino,
1100 void *area, void *page, unsigned long pgoff),
1101 TP_ARGS(ino, area, page, pgoff),
1102 TP_STRUCT__entry(
1103 __field(unsigned long long, ino)
1104 __field(void *, area)
1105 __field(void *, page)
1106 __field(unsigned long, pgoff)
1107 ),
1108 TP_fast_assign(
1109 __entry->ino = ino;
1110 __entry->area = area;
1111 __entry->page = page;
1112 __entry->pgoff = pgoff;
1113 ),
1114 TP_printk("%llu %p %p %lu",
1115 __entry->ino, __entry->area, __entry->page, __entry->pgoff)
1116);
1117
1118/* End of trace events for fs/ocfs2/mmap.c. */
1119
Wengang Wang80a9a842011-02-21 11:13:14 +08001120#endif /* _TRACE_OCFS2_H */
1121
1122/* This part must be outside protection */
1123#undef TRACE_INCLUDE_PATH
1124#define TRACE_INCLUDE_PATH .
1125#define TRACE_INCLUDE_FILE ocfs2_trace
1126#include <trace/define_trace.h>