ocfs2: Remove masklog ML_EXTENT_MAP.
[pandora-kernel.git] / fs / ocfs2 / ocfs2_trace.h
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
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
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
43 DECLARE_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)    \
56 DEFINE_EVENT(ocfs2__ull, name,  \
57         TP_PROTO(unsigned long long num),       \
58         TP_ARGS(num))
59
60 DECLARE_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)        \
75 DEFINE_EVENT(ocfs2__int_int, name,      \
76         TP_PROTO(int val1, int val2),   \
77         TP_ARGS(val1, val2))
78
79 DECLARE_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)      \
94 DEFINE_EVENT(ocfs2__uint_uint, name,    \
95         TP_PROTO(unsigned int val1, unsigned int val2), \
96         TP_ARGS(val1, val2))
97
98 DECLARE_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)       \
113 DEFINE_EVENT(ocfs2__ull_uint, name,     \
114         TP_PROTO(unsigned long long val1, unsigned int val2),   \
115         TP_ARGS(val1, val2))
116
117 DECLARE_EVENT_CLASS(ocfs2__ull_int,
118         TP_PROTO(unsigned long long value1, int value2),
119         TP_ARGS(value1, value2),
120         TP_STRUCT__entry(
121                 __field(unsigned long long, value1)
122                 __field(int, value2)
123         ),
124         TP_fast_assign(
125                 __entry->value1 = value1;
126                 __entry->value2 = value2;
127         ),
128         TP_printk("%llu %d", __entry->value1, __entry->value2)
129 );
130
131 #define DEFINE_OCFS2_ULL_INT_EVENT(name)        \
132 DEFINE_EVENT(ocfs2__ull_int, name,      \
133         TP_PROTO(unsigned long long val1, int val2),    \
134         TP_ARGS(val1, val2))
135
136 DECLARE_EVENT_CLASS(ocfs2__ull_ull,
137         TP_PROTO(unsigned long long value1, unsigned long long value2),
138         TP_ARGS(value1, value2),
139         TP_STRUCT__entry(
140                 __field(unsigned long long, value1)
141                 __field(unsigned long long, value2)
142         ),
143         TP_fast_assign(
144                 __entry->value1 = value1;
145                 __entry->value2 = value2;
146         ),
147         TP_printk("%llu %llu", __entry->value1, __entry->value2)
148 );
149
150 #define DEFINE_OCFS2_ULL_ULL_EVENT(name)        \
151 DEFINE_EVENT(ocfs2__ull_ull, name,      \
152         TP_PROTO(unsigned long long val1, unsigned long long val2),     \
153         TP_ARGS(val1, val2))
154
155 DECLARE_EVENT_CLASS(ocfs2__ull_ull_uint,
156         TP_PROTO(unsigned long long value1,
157                  unsigned long long value2, unsigned int value3),
158         TP_ARGS(value1, value2, value3),
159         TP_STRUCT__entry(
160                 __field(unsigned long long, value1)
161                 __field(unsigned long long, value2)
162                 __field(unsigned int, value3)
163         ),
164         TP_fast_assign(
165                 __entry->value1 = value1;
166                 __entry->value2 = value2;
167                 __entry->value3 = value3;
168         ),
169         TP_printk("%llu %llu %u",
170                   __entry->value1, __entry->value2, __entry->value3)
171 );
172
173 #define DEFINE_OCFS2_ULL_ULL_UINT_EVENT(name)   \
174 DEFINE_EVENT(ocfs2__ull_ull_uint, name, \
175         TP_PROTO(unsigned long long val1,       \
176                  unsigned long long val2, unsigned int val3),   \
177         TP_ARGS(val1, val2, val3))
178
179 DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint,
180         TP_PROTO(unsigned long long value1,
181                  unsigned int value2, unsigned int value3),
182         TP_ARGS(value1, value2, value3),
183         TP_STRUCT__entry(
184                 __field(unsigned long long, value1)
185                 __field(unsigned int, value2)
186                 __field(unsigned int, value3)
187         ),
188         TP_fast_assign(
189                 __entry->value1 = value1;
190                 __entry->value2 = value2;
191                 __entry->value3 = value3;
192         ),
193         TP_printk("%llu %u %u", __entry->value1,
194                   __entry->value2, __entry->value3)
195 );
196
197 #define DEFINE_OCFS2_ULL_UINT_UINT_EVENT(name)  \
198 DEFINE_EVENT(ocfs2__ull_uint_uint, name,        \
199         TP_PROTO(unsigned long long val1,       \
200                  unsigned int val2, unsigned int val3), \
201         TP_ARGS(val1, val2, val3))
202
203 DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint,
204         TP_PROTO(unsigned int value1, unsigned int value2,
205                  unsigned int value3),
206         TP_ARGS(value1, value2, value3),
207         TP_STRUCT__entry(
208                 __field(        unsigned int,   value1          )
209                 __field(        unsigned int,   value2          )
210                 __field(        unsigned int,   value3          )
211         ),
212         TP_fast_assign(
213                 __entry->value1 =       value1;
214                 __entry->value2 =       value2;
215                 __entry->value3 =       value3;
216         ),
217         TP_printk("%u %u %u", __entry->value1, __entry->value2, __entry->value3)
218 );
219
220 #define DEFINE_OCFS2_UINT_UINT_UINT_EVENT(name) \
221 DEFINE_EVENT(ocfs2__uint_uint_uint, name,       \
222         TP_PROTO(unsigned int value1, unsigned int value2,      \
223                  unsigned int value3),  \
224         TP_ARGS(value1, value2, value3))
225
226 DECLARE_EVENT_CLASS(ocfs2__ull_ull_ull,
227         TP_PROTO(unsigned long long value1,
228                  unsigned long long value2, unsigned long long value3),
229         TP_ARGS(value1, value2, value3),
230         TP_STRUCT__entry(
231                 __field(unsigned long long, value1)
232                 __field(unsigned long long, value2)
233                 __field(unsigned long long, value3)
234         ),
235         TP_fast_assign(
236                 __entry->value1 = value1;
237                 __entry->value2 = value2;
238                 __entry->value3 = value3;
239         ),
240         TP_printk("%llu %llu %llu",
241                   __entry->value1, __entry->value2, __entry->value3)
242 );
243
244 #define DEFINE_OCFS2_ULL_ULL_ULL_EVENT(name)    \
245 DEFINE_EVENT(ocfs2__ull_ull_ull, name,  \
246         TP_PROTO(unsigned long long value1, unsigned long long value2,  \
247                  unsigned long long value3),    \
248         TP_ARGS(value1, value2, value3))
249
250 DECLARE_EVENT_CLASS(ocfs2__ull_int_int_int,
251         TP_PROTO(unsigned long long ull, int value1, int value2, int value3),
252         TP_ARGS(ull, value1, value2, value3),
253         TP_STRUCT__entry(
254                 __field(        unsigned long long,     ull     )
255                 __field(        int,    value1                  )
256                 __field(        int,    value2                  )
257                 __field(        int,    value3                  )
258         ),
259         TP_fast_assign(
260                 __entry->ull            = ull;
261                 __entry->value1         = value1;
262                 __entry->value2         = value2;
263                 __entry->value3         = value3;
264         ),
265         TP_printk("%llu %d %d %d",
266                   __entry->ull, __entry->value1,
267                   __entry->value2, __entry->value3)
268 );
269
270 #define DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(name)        \
271 DEFINE_EVENT(ocfs2__ull_int_int_int, name,      \
272         TP_PROTO(unsigned long long ull, int value1,    \
273                  int value2, int value3),       \
274         TP_ARGS(ull, value1, value2, value3))
275
276 DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint_uint,
277         TP_PROTO(unsigned long long ull, unsigned int value1,
278                  unsigned int value2, unsigned int value3),
279         TP_ARGS(ull, value1, value2, value3),
280         TP_STRUCT__entry(
281                 __field(unsigned long long, ull)
282                 __field(unsigned int, value1)
283                 __field(unsigned int, value2)
284                 __field(unsigned int, value3)
285         ),
286         TP_fast_assign(
287                 __entry->ull = ull;
288                 __entry->value1 = value1;
289                 __entry->value2 = value2;
290                 __entry->value3 = value3;
291         ),
292         TP_printk("%llu %u %u %u",
293                   __entry->ull, __entry->value1,
294                   __entry->value2, __entry->value3)
295 );
296
297 #define DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(name)     \
298 DEFINE_EVENT(ocfs2__ull_uint_uint_uint, name,   \
299         TP_PROTO(unsigned long long ull, unsigned int value1,   \
300                  unsigned int value2, unsigned int value3),     \
301         TP_ARGS(ull, value1, value2, value3))
302
303 /* Trace events for fs/ocfs2/alloc.c. */
304 DECLARE_EVENT_CLASS(ocfs2__btree_ops,
305         TP_PROTO(unsigned long long owner,\
306                  unsigned int value1, unsigned int value2),
307         TP_ARGS(owner, value1, value2),
308         TP_STRUCT__entry(
309                 __field(unsigned long long, owner)
310                 __field(unsigned int, value1)
311                 __field(unsigned int, value2)
312         ),
313         TP_fast_assign(
314                 __entry->owner = owner;
315                 __entry->value1 = value1;
316                 __entry->value2 = value2;
317         ),
318         TP_printk("%llu %u %u",
319                   __entry->owner, __entry->value1, __entry->value2)
320 );
321
322 #define DEFINE_OCFS2_BTREE_EVENT(name)  \
323 DEFINE_EVENT(ocfs2__btree_ops, name,    \
324         TP_PROTO(unsigned long long owner,      \
325                  unsigned int value1, unsigned int value2),     \
326         TP_ARGS(owner, value1, value2))
327
328 DEFINE_OCFS2_BTREE_EVENT(ocfs2_adjust_rightmost_branch);
329
330 DEFINE_OCFS2_BTREE_EVENT(ocfs2_rotate_tree_right);
331
332 DEFINE_OCFS2_BTREE_EVENT(ocfs2_append_rec_to_path);
333
334 DEFINE_OCFS2_BTREE_EVENT(ocfs2_insert_extent_start);
335
336 DEFINE_OCFS2_BTREE_EVENT(ocfs2_add_clusters_in_btree);
337
338 DEFINE_OCFS2_INT_EVENT(ocfs2_num_free_extents);
339
340 DEFINE_OCFS2_INT_EVENT(ocfs2_complete_edge_insert);
341
342 TRACE_EVENT(ocfs2_grow_tree,
343         TP_PROTO(unsigned long long owner, int depth),
344         TP_ARGS(owner, depth),
345         TP_STRUCT__entry(
346                 __field(unsigned long long, owner)
347                 __field(int, depth)
348         ),
349         TP_fast_assign(
350                 __entry->owner = owner;
351                 __entry->depth = depth;
352         ),
353         TP_printk("%llu %d", __entry->owner, __entry->depth)
354 );
355
356 TRACE_EVENT(ocfs2_rotate_subtree,
357         TP_PROTO(int subtree_root, unsigned long long blkno,
358                  int depth),
359         TP_ARGS(subtree_root, blkno, depth),
360         TP_STRUCT__entry(
361                 __field(int, subtree_root)
362                 __field(unsigned long long, blkno)
363                 __field(int, depth)
364         ),
365         TP_fast_assign(
366                 __entry->subtree_root = subtree_root;
367                 __entry->blkno = blkno;
368                 __entry->depth = depth;
369         ),
370         TP_printk("%d %llu %d", __entry->subtree_root,
371                   __entry->blkno, __entry->depth)
372 );
373
374 TRACE_EVENT(ocfs2_insert_extent,
375         TP_PROTO(unsigned int ins_appending, unsigned int ins_contig,
376                  int ins_contig_index, int free_records, int ins_tree_depth),
377         TP_ARGS(ins_appending, ins_contig, ins_contig_index, free_records,
378                 ins_tree_depth),
379         TP_STRUCT__entry(
380                 __field(unsigned int, ins_appending)
381                 __field(unsigned int, ins_contig)
382                 __field(int, ins_contig_index)
383                 __field(int, free_records)
384                 __field(int, ins_tree_depth)
385         ),
386         TP_fast_assign(
387                 __entry->ins_appending = ins_appending;
388                 __entry->ins_contig = ins_contig;
389                 __entry->ins_contig_index = ins_contig_index;
390                 __entry->free_records = free_records;
391                 __entry->ins_tree_depth = ins_tree_depth;
392         ),
393         TP_printk("%u %u %d %d %d",
394                   __entry->ins_appending, __entry->ins_contig,
395                   __entry->ins_contig_index, __entry->free_records,
396                   __entry->ins_tree_depth)
397 );
398
399 TRACE_EVENT(ocfs2_split_extent,
400         TP_PROTO(int split_index, unsigned int c_contig_type,
401                  unsigned int c_has_empty_extent,
402                  unsigned int c_split_covers_rec),
403         TP_ARGS(split_index, c_contig_type,
404                 c_has_empty_extent, c_split_covers_rec),
405         TP_STRUCT__entry(
406                 __field(int, split_index)
407                 __field(unsigned int, c_contig_type)
408                 __field(unsigned int, c_has_empty_extent)
409                 __field(unsigned int, c_split_covers_rec)
410         ),
411         TP_fast_assign(
412                 __entry->split_index = split_index;
413                 __entry->c_contig_type = c_contig_type;
414                 __entry->c_has_empty_extent = c_has_empty_extent;
415                 __entry->c_split_covers_rec = c_split_covers_rec;
416         ),
417         TP_printk("%d %u %u %u", __entry->split_index, __entry->c_contig_type,
418                   __entry->c_has_empty_extent, __entry->c_split_covers_rec)
419 );
420
421 TRACE_EVENT(ocfs2_remove_extent,
422         TP_PROTO(unsigned long long owner, unsigned int cpos,
423                  unsigned int len, int index,
424                  unsigned int e_cpos, unsigned int clusters),
425         TP_ARGS(owner, cpos, len, index, e_cpos, clusters),
426         TP_STRUCT__entry(
427                 __field(unsigned long long, owner)
428                 __field(unsigned int, cpos)
429                 __field(unsigned int, len)
430                 __field(int, index)
431                 __field(unsigned int, e_cpos)
432                 __field(unsigned int, clusters)
433         ),
434         TP_fast_assign(
435                 __entry->owner = owner;
436                 __entry->cpos = cpos;
437                 __entry->len = len;
438                 __entry->index = index;
439                 __entry->e_cpos = e_cpos;
440                 __entry->clusters = clusters;
441         ),
442         TP_printk("%llu %u %u %d %u %u",
443                   __entry->owner, __entry->cpos, __entry->len, __entry->index,
444                   __entry->e_cpos, __entry->clusters)
445 );
446
447 TRACE_EVENT(ocfs2_commit_truncate,
448         TP_PROTO(unsigned long long ino, unsigned int new_cpos,
449                  unsigned int clusters, unsigned int depth),
450         TP_ARGS(ino, new_cpos, clusters, depth),
451         TP_STRUCT__entry(
452                 __field(unsigned long long, ino)
453                 __field(unsigned int, new_cpos)
454                 __field(unsigned int, clusters)
455                 __field(unsigned int, depth)
456         ),
457         TP_fast_assign(
458                 __entry->ino = ino;
459                 __entry->new_cpos = new_cpos;
460                 __entry->clusters = clusters;
461                 __entry->depth = depth;
462         ),
463         TP_printk("%llu %u %u %u",
464                   __entry->ino, __entry->new_cpos,
465                   __entry->clusters, __entry->depth)
466 );
467
468 TRACE_EVENT(ocfs2_validate_extent_block,
469         TP_PROTO(unsigned long long blkno),
470         TP_ARGS(blkno),
471         TP_STRUCT__entry(
472                 __field(unsigned long long, blkno)
473         ),
474         TP_fast_assign(
475                 __entry->blkno = blkno;
476         ),
477         TP_printk("%llu ", __entry->blkno)
478 );
479
480 TRACE_EVENT(ocfs2_rotate_leaf,
481         TP_PROTO(unsigned int insert_cpos, int insert_index,
482                  int has_empty, int next_free,
483                  unsigned int l_count),
484         TP_ARGS(insert_cpos, insert_index, has_empty,
485                 next_free, l_count),
486         TP_STRUCT__entry(
487                 __field(unsigned int, insert_cpos)
488                 __field(int, insert_index)
489                 __field(int, has_empty)
490                 __field(int, next_free)
491                 __field(unsigned int, l_count)
492         ),
493         TP_fast_assign(
494                 __entry->insert_cpos = insert_cpos;
495                 __entry->insert_index = insert_index;
496                 __entry->has_empty = has_empty;
497                 __entry->next_free = next_free;
498                 __entry->l_count = l_count;
499         ),
500         TP_printk("%u %d %d %d %u", __entry->insert_cpos,
501                   __entry->insert_index, __entry->has_empty,
502                   __entry->next_free, __entry->l_count)
503 );
504
505 TRACE_EVENT(ocfs2_add_clusters_in_btree_ret,
506         TP_PROTO(int status, int reason, int err),
507         TP_ARGS(status, reason, err),
508         TP_STRUCT__entry(
509                 __field(int, status)
510                 __field(int, reason)
511                 __field(int, err)
512         ),
513         TP_fast_assign(
514                 __entry->status = status;
515                 __entry->reason = reason;
516                 __entry->err = err;
517         ),
518         TP_printk("%d %d %d", __entry->status,
519                   __entry->reason, __entry->err)
520 );
521
522 TRACE_EVENT(ocfs2_mark_extent_written,
523         TP_PROTO(unsigned long long owner, unsigned int cpos,
524                  unsigned int len, unsigned int phys),
525         TP_ARGS(owner, cpos, len, phys),
526         TP_STRUCT__entry(
527                 __field(unsigned long long, owner)
528                 __field(unsigned int, cpos)
529                 __field(unsigned int, len)
530                 __field(unsigned int, phys)
531         ),
532         TP_fast_assign(
533                 __entry->owner = owner;
534                 __entry->cpos = cpos;
535                 __entry->len = len;
536                 __entry->phys = phys;
537         ),
538         TP_printk("%llu %u %u %u",
539                   __entry->owner, __entry->cpos,
540                   __entry->len, __entry->phys)
541 );
542
543 DECLARE_EVENT_CLASS(ocfs2__truncate_log_ops,
544         TP_PROTO(unsigned long long blkno, int index,
545                  unsigned int start, unsigned int num),
546         TP_ARGS(blkno, index, start, num),
547         TP_STRUCT__entry(
548                 __field(unsigned long long, blkno)
549                 __field(int, index)
550                 __field(unsigned int, start)
551                 __field(unsigned int, num)
552         ),
553         TP_fast_assign(
554                 __entry->blkno = blkno;
555                 __entry->index = index;
556                 __entry->start = start;
557                 __entry->num = num;
558         ),
559         TP_printk("%llu %d %u %u",
560                   __entry->blkno, __entry->index,
561                   __entry->start, __entry->num)
562 );
563
564 #define DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(name)       \
565 DEFINE_EVENT(ocfs2__truncate_log_ops, name,     \
566         TP_PROTO(unsigned long long blkno, int index,   \
567                  unsigned int start, unsigned int num), \
568         TP_ARGS(blkno, index, start, num))
569
570 DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(ocfs2_truncate_log_append);
571
572 DEFINE_OCFS2_TRUNCATE_LOG_OPS_EVENT(ocfs2_replay_truncate_records);
573
574 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_flush_truncate_log);
575
576 DEFINE_OCFS2_INT_EVENT(ocfs2_begin_truncate_log_recovery);
577
578 DEFINE_OCFS2_INT_EVENT(ocfs2_truncate_log_recovery_num);
579
580 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_complete_truncate_log_recovery);
581
582 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_free_cached_blocks);
583
584 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_cache_cluster_dealloc);
585
586 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_run_deallocs);
587
588 TRACE_EVENT(ocfs2_cache_block_dealloc,
589         TP_PROTO(int type, int slot, unsigned long long suballoc,
590                  unsigned long long blkno, unsigned int bit),
591         TP_ARGS(type, slot, suballoc, blkno, bit),
592         TP_STRUCT__entry(
593                 __field(int, type)
594                 __field(int, slot)
595                 __field(unsigned long long, suballoc)
596                 __field(unsigned long long, blkno)
597                 __field(unsigned int, bit)
598         ),
599         TP_fast_assign(
600                 __entry->type = type;
601                 __entry->slot = slot;
602                 __entry->suballoc = suballoc;
603                 __entry->blkno = blkno;
604                 __entry->bit = bit;
605         ),
606         TP_printk("%d %d %llu %llu %u",
607                   __entry->type, __entry->slot, __entry->suballoc,
608                   __entry->blkno, __entry->bit)
609 );
610
611 /* End of trace events for fs/ocfs2/alloc.c. */
612
613 /* Trace events for fs/ocfs2/localalloc.c. */
614
615 DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_la_set_sizes);
616
617 DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_alloc_should_use_local);
618
619 DEFINE_OCFS2_INT_EVENT(ocfs2_load_local_alloc);
620
621 DEFINE_OCFS2_INT_EVENT(ocfs2_begin_local_alloc_recovery);
622
623 DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_reserve_local_alloc_bits);
624
625 DEFINE_OCFS2_UINT_EVENT(ocfs2_local_alloc_count_bits);
626
627 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits_search_bitmap);
628
629 DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits);
630
631 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_sync_local_to_main);
632
633 TRACE_EVENT(ocfs2_sync_local_to_main_free,
634         TP_PROTO(int count, int bit, unsigned long long start_blk,
635                  unsigned long long blkno),
636         TP_ARGS(count, bit, start_blk, blkno),
637         TP_STRUCT__entry(
638                 __field(int, count)
639                 __field(int, bit)
640                 __field(unsigned long long, start_blk)
641                 __field(unsigned long long, blkno)
642         ),
643         TP_fast_assign(
644                 __entry->count = count;
645                 __entry->bit = bit;
646                 __entry->start_blk = start_blk;
647                 __entry->blkno = blkno;
648         ),
649         TP_printk("%d %d %llu %llu",
650                   __entry->count, __entry->bit, __entry->start_blk,
651                   __entry->blkno)
652 );
653
654 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_new_window);
655
656 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result);
657
658 /* End of trace events for fs/ocfs2/localalloc.c. */
659
660 /* Trace events for fs/ocfs2/resize.c. */
661
662 DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_update_last_group_and_inode);
663
664 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_group_extend);
665
666 DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_group_add);
667
668 /* End of trace events for fs/ocfs2/resize.c. */
669
670 /* Trace events for fs/ocfs2/suballoc.c. */
671
672 DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_group_descriptor);
673
674 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_block_group_alloc_contig);
675
676 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_block_group_alloc_discontig);
677
678 DEFINE_OCFS2_ULL_EVENT(ocfs2_block_group_alloc);
679
680 DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_reserve_suballoc_bits_nospc);
681
682 DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_reserve_suballoc_bits_no_new_group);
683
684 DEFINE_OCFS2_ULL_EVENT(ocfs2_reserve_new_inode_new_group);
685
686 DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_block_group_set_bits);
687
688 TRACE_EVENT(ocfs2_relink_block_group,
689         TP_PROTO(unsigned long long i_blkno, unsigned int chain,
690                  unsigned long long bg_blkno,
691                  unsigned long long prev_blkno),
692         TP_ARGS(i_blkno, chain, bg_blkno, prev_blkno),
693         TP_STRUCT__entry(
694                 __field(unsigned long long, i_blkno)
695                 __field(unsigned int, chain)
696                 __field(unsigned long long, bg_blkno)
697                 __field(unsigned long long, prev_blkno)
698         ),
699         TP_fast_assign(
700                 __entry->i_blkno = i_blkno;
701                 __entry->chain = chain;
702                 __entry->bg_blkno = bg_blkno;
703                 __entry->prev_blkno = prev_blkno;
704         ),
705         TP_printk("%llu %u %llu %llu",
706                   __entry->i_blkno, __entry->chain, __entry->bg_blkno,
707                   __entry->prev_blkno)
708 );
709
710 DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_cluster_group_search_wrong_max_bits);
711
712 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_cluster_group_search_max_block);
713
714 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_block_group_search_max_block);
715
716 DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_search_chain_begin);
717
718 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_search_chain_succ);
719
720 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_search_chain_end);
721
722 DEFINE_OCFS2_UINT_EVENT(ocfs2_claim_suballoc_bits);
723
724 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_claim_new_inode_at_loc);
725
726 DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_block_group_clear_bits);
727
728 TRACE_EVENT(ocfs2_free_suballoc_bits,
729         TP_PROTO(unsigned long long inode, unsigned long long group,
730                  unsigned int start_bit, unsigned int count),
731         TP_ARGS(inode, group, start_bit, count),
732         TP_STRUCT__entry(
733                 __field(unsigned long long, inode)
734                 __field(unsigned long long, group)
735                 __field(unsigned int, start_bit)
736                 __field(unsigned int, count)
737         ),
738         TP_fast_assign(
739                 __entry->inode = inode;
740                 __entry->group = group;
741                 __entry->start_bit = start_bit;
742                 __entry->count = count;
743         ),
744         TP_printk("%llu %llu %u %u", __entry->inode, __entry->group,
745                   __entry->start_bit, __entry->count)
746 );
747
748 TRACE_EVENT(ocfs2_free_clusters,
749         TP_PROTO(unsigned long long bg_blkno, unsigned long long start_blk,
750                  unsigned int start_bit, unsigned int count),
751         TP_ARGS(bg_blkno, start_blk, start_bit, count),
752         TP_STRUCT__entry(
753                 __field(unsigned long long, bg_blkno)
754                 __field(unsigned long long, start_blk)
755                 __field(unsigned int, start_bit)
756                 __field(unsigned int, count)
757         ),
758         TP_fast_assign(
759                 __entry->bg_blkno = bg_blkno;
760                 __entry->start_blk = start_blk;
761                 __entry->start_bit = start_bit;
762                 __entry->count = count;
763         ),
764         TP_printk("%llu %llu %u %u", __entry->bg_blkno, __entry->start_blk,
765                   __entry->start_bit, __entry->count)
766 );
767
768 DEFINE_OCFS2_ULL_EVENT(ocfs2_get_suballoc_slot_bit);
769
770 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_test_suballoc_bit);
771
772 DEFINE_OCFS2_ULL_EVENT(ocfs2_test_inode_bit);
773
774 /* End of trace events for fs/ocfs2/suballoc.c. */
775
776 /* Trace events for fs/ocfs2/refcounttree.c. */
777
778 DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_refcount_block);
779
780 DEFINE_OCFS2_ULL_EVENT(ocfs2_purge_refcount_trees);
781
782 DEFINE_OCFS2_ULL_EVENT(ocfs2_create_refcount_tree);
783
784 DEFINE_OCFS2_ULL_EVENT(ocfs2_create_refcount_tree_blkno);
785
786 DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_change_refcount_rec);
787
788 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_expand_inline_ref_root);
789
790 DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_divide_leaf_refcount_block);
791
792 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_new_leaf_refcount_block);
793
794 DECLARE_EVENT_CLASS(ocfs2__refcount_tree_ops,
795         TP_PROTO(unsigned long long blkno, int index,
796                  unsigned long long cpos,
797                  unsigned int clusters, unsigned int refcount),
798         TP_ARGS(blkno, index, cpos, clusters, refcount),
799         TP_STRUCT__entry(
800                 __field(unsigned long long, blkno)
801                 __field(int, index)
802                 __field(unsigned long long, cpos)
803                 __field(unsigned int, clusters)
804                 __field(unsigned int, refcount)
805         ),
806         TP_fast_assign(
807                 __entry->blkno = blkno;
808                 __entry->index = index;
809                 __entry->cpos = cpos;
810                 __entry->clusters = clusters;
811                 __entry->refcount = refcount;
812         ),
813         TP_printk("%llu %d %llu %u %u", __entry->blkno, __entry->index,
814                   __entry->cpos, __entry->clusters, __entry->refcount)
815 );
816
817 #define DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(name)      \
818 DEFINE_EVENT(ocfs2__refcount_tree_ops, name,            \
819         TP_PROTO(unsigned long long blkno, int index,   \
820                  unsigned long long cpos,               \
821                  unsigned int count, unsigned int refcount),    \
822         TP_ARGS(blkno, index, cpos, count, refcount))
823
824 DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(ocfs2_insert_refcount_rec);
825
826 TRACE_EVENT(ocfs2_split_refcount_rec,
827         TP_PROTO(unsigned long long cpos,
828                  unsigned int clusters, unsigned int refcount,
829                  unsigned long long split_cpos,
830                  unsigned int split_clusters, unsigned int split_refcount),
831         TP_ARGS(cpos, clusters, refcount,
832                 split_cpos, split_clusters, split_refcount),
833         TP_STRUCT__entry(
834                 __field(unsigned long long, cpos)
835                 __field(unsigned int, clusters)
836                 __field(unsigned int, refcount)
837                 __field(unsigned long long, split_cpos)
838                 __field(unsigned int, split_clusters)
839                 __field(unsigned int, split_refcount)
840         ),
841         TP_fast_assign(
842                 __entry->cpos = cpos;
843                 __entry->clusters = clusters;
844                 __entry->refcount = refcount;
845                 __entry->split_cpos = split_cpos;
846                 __entry->split_clusters = split_clusters;
847                 __entry->split_refcount = split_refcount;
848         ),
849         TP_printk("%llu %u %u %llu %u %u",
850                   __entry->cpos, __entry->clusters, __entry->refcount,
851                   __entry->split_cpos, __entry->split_clusters,
852                   __entry->split_refcount)
853 );
854
855 DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(ocfs2_split_refcount_rec_insert);
856
857 DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_increase_refcount_begin);
858
859 DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_increase_refcount_change);
860
861 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_increase_refcount_insert);
862
863 DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_increase_refcount_split);
864
865 DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_remove_refcount_extent);
866
867 DEFINE_OCFS2_ULL_EVENT(ocfs2_restore_refcount_block);
868
869 DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_decrease_refcount_rec);
870
871 TRACE_EVENT(ocfs2_decrease_refcount,
872         TP_PROTO(unsigned long long owner,
873                  unsigned long long cpos,
874                  unsigned int len, int delete),
875         TP_ARGS(owner, cpos, len, delete),
876         TP_STRUCT__entry(
877                 __field(unsigned long long, owner)
878                 __field(unsigned long long, cpos)
879                 __field(unsigned int, len)
880                 __field(int, delete)
881         ),
882         TP_fast_assign(
883                 __entry->owner = owner;
884                 __entry->cpos = cpos;
885                 __entry->len = len;
886                 __entry->delete = delete;
887         ),
888         TP_printk("%llu %llu %u %d",
889                   __entry->owner, __entry->cpos, __entry->len, __entry->delete)
890 );
891
892 DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_mark_extent_refcounted);
893
894 DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_calc_refcount_meta_credits);
895
896 TRACE_EVENT(ocfs2_calc_refcount_meta_credits_iterate,
897         TP_PROTO(int recs_add, unsigned long long cpos,
898                  unsigned int clusters, unsigned long long r_cpos,
899                  unsigned int r_clusters, unsigned int refcount, int index),
900         TP_ARGS(recs_add, cpos, clusters, r_cpos, r_clusters, refcount, index),
901         TP_STRUCT__entry(
902                 __field(int, recs_add)
903                 __field(unsigned long long, cpos)
904                 __field(unsigned int, clusters)
905                 __field(unsigned long long, r_cpos)
906                 __field(unsigned int, r_clusters)
907                 __field(unsigned int, refcount)
908                 __field(int, index)
909         ),
910         TP_fast_assign(
911                 __entry->recs_add = recs_add;
912                 __entry->cpos = cpos;
913                 __entry->clusters = clusters;
914                 __entry->r_cpos = r_cpos;
915                 __entry->r_clusters = r_clusters;
916                 __entry->refcount = refcount;
917                 __entry->index = index;
918         ),
919         TP_printk("%d %llu %u %llu %u %u %d",
920                   __entry->recs_add, __entry->cpos, __entry->clusters,
921                   __entry->r_cpos, __entry->r_clusters,
922                   __entry->refcount, __entry->index)
923 );
924
925 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_add_refcount_flag);
926
927 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_prepare_refcount_change_for_del);
928
929 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_lock_refcount_allocators);
930
931 DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_duplicate_clusters_by_page);
932
933 DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_duplicate_clusters_by_jbd);
934
935 TRACE_EVENT(ocfs2_clear_ext_refcount,
936         TP_PROTO(unsigned long long ino, unsigned int cpos,
937                  unsigned int len, unsigned int p_cluster,
938                  unsigned int ext_flags),
939         TP_ARGS(ino, cpos, len, p_cluster, ext_flags),
940         TP_STRUCT__entry(
941                 __field(unsigned long long, ino)
942                 __field(unsigned int, cpos)
943                 __field(unsigned int, len)
944                 __field(unsigned int, p_cluster)
945                 __field(unsigned int, ext_flags)
946         ),
947         TP_fast_assign(
948                 __entry->ino = ino;
949                 __entry->cpos = cpos;
950                 __entry->len = len;
951                 __entry->p_cluster = p_cluster;
952                 __entry->ext_flags = ext_flags;
953         ),
954         TP_printk("%llu %u %u %u %u",
955                   __entry->ino, __entry->cpos, __entry->len,
956                   __entry->p_cluster, __entry->ext_flags)
957 );
958
959 TRACE_EVENT(ocfs2_replace_clusters,
960         TP_PROTO(unsigned long long ino, unsigned int cpos,
961                  unsigned int old, unsigned int new, unsigned int len,
962                  unsigned int ext_flags),
963         TP_ARGS(ino, cpos, old, new, len, ext_flags),
964         TP_STRUCT__entry(
965                 __field(unsigned long long, ino)
966                 __field(unsigned int, cpos)
967                 __field(unsigned int, old)
968                 __field(unsigned int, new)
969                 __field(unsigned int, len)
970                 __field(unsigned int, ext_flags)
971         ),
972         TP_fast_assign(
973                 __entry->ino = ino;
974                 __entry->cpos = cpos;
975                 __entry->old = old;
976                 __entry->new = new;
977                 __entry->len = len;
978                 __entry->ext_flags = ext_flags;
979         ),
980         TP_printk("%llu %u %u %u %u %u",
981                   __entry->ino, __entry->cpos, __entry->old, __entry->new,
982                   __entry->len, __entry->ext_flags)
983 );
984
985 DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_make_clusters_writable);
986
987 TRACE_EVENT(ocfs2_refcount_cow_hunk,
988         TP_PROTO(unsigned long long ino, unsigned int cpos,
989                  unsigned int write_len, unsigned int max_cpos,
990                  unsigned int cow_start, unsigned int cow_len),
991         TP_ARGS(ino, cpos, write_len, max_cpos, cow_start, cow_len),
992         TP_STRUCT__entry(
993                 __field(unsigned long long, ino)
994                 __field(unsigned int, cpos)
995                 __field(unsigned int, write_len)
996                 __field(unsigned int, max_cpos)
997                 __field(unsigned int, cow_start)
998                 __field(unsigned int, cow_len)
999         ),
1000         TP_fast_assign(
1001                 __entry->ino = ino;
1002                 __entry->cpos = cpos;
1003                 __entry->write_len = write_len;
1004                 __entry->max_cpos = max_cpos;
1005                 __entry->cow_start = cow_start;
1006                 __entry->cow_len = cow_len;
1007         ),
1008         TP_printk("%llu %u %u %u %u %u",
1009                   __entry->ino, __entry->cpos, __entry->write_len,
1010                   __entry->max_cpos, __entry->cow_start, __entry->cow_len)
1011 );
1012
1013 /* End of trace events for fs/ocfs2/refcounttree.c. */
1014
1015 /* Trace events for fs/ocfs2/aops.c. */
1016
1017 DECLARE_EVENT_CLASS(ocfs2__get_block,
1018         TP_PROTO(unsigned long long ino, unsigned long long iblock,
1019                  void *bh_result, int create),
1020         TP_ARGS(ino, iblock, bh_result, create),
1021         TP_STRUCT__entry(
1022                 __field(unsigned long long, ino)
1023                 __field(unsigned long long, iblock)
1024                 __field(void *, bh_result)
1025                 __field(int, create)
1026         ),
1027         TP_fast_assign(
1028                 __entry->ino = ino;
1029                 __entry->iblock = iblock;
1030                 __entry->bh_result = bh_result;
1031                 __entry->create = create;
1032         ),
1033         TP_printk("%llu %llu %p %d",
1034                   __entry->ino, __entry->iblock,
1035                   __entry->bh_result, __entry->create)
1036 );
1037
1038 #define DEFINE_OCFS2_GET_BLOCK_EVENT(name)      \
1039 DEFINE_EVENT(ocfs2__get_block, name,    \
1040         TP_PROTO(unsigned long long ino, unsigned long long iblock,     \
1041                  void *bh_result, int create),  \
1042         TP_ARGS(ino, iblock, bh_result, create))
1043
1044 DEFINE_OCFS2_GET_BLOCK_EVENT(ocfs2_symlink_get_block);
1045
1046 DEFINE_OCFS2_GET_BLOCK_EVENT(ocfs2_get_block);
1047
1048 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_get_block_end);
1049
1050 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_readpage);
1051
1052 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_writepage);
1053
1054 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_bmap);
1055
1056 TRACE_EVENT(ocfs2_try_to_write_inline_data,
1057         TP_PROTO(unsigned long long ino, unsigned int len,
1058                  unsigned long long pos, unsigned int flags),
1059         TP_ARGS(ino, len, pos, flags),
1060         TP_STRUCT__entry(
1061                 __field(unsigned long long, ino)
1062                 __field(unsigned int, len)
1063                 __field(unsigned long long, pos)
1064                 __field(unsigned int, flags)
1065         ),
1066         TP_fast_assign(
1067                 __entry->ino = ino;
1068                 __entry->len = len;
1069                 __entry->pos = pos;
1070                 __entry->flags = flags;
1071         ),
1072         TP_printk("%llu %u %llu 0x%x",
1073                   __entry->ino, __entry->len, __entry->pos, __entry->flags)
1074 );
1075
1076 TRACE_EVENT(ocfs2_write_begin_nolock,
1077         TP_PROTO(unsigned long long ino,
1078                  long long i_size, unsigned int i_clusters,
1079                  unsigned long long pos, unsigned int len,
1080                  unsigned int flags, void *page,
1081                  unsigned int clusters, unsigned int extents_to_split),
1082         TP_ARGS(ino, i_size, i_clusters, pos, len, flags,
1083                 page, clusters, extents_to_split),
1084         TP_STRUCT__entry(
1085                 __field(unsigned long long, ino)
1086                 __field(long long, i_size)
1087                 __field(unsigned int, i_clusters)
1088                 __field(unsigned long long, pos)
1089                 __field(unsigned int, len)
1090                 __field(unsigned int, flags)
1091                 __field(void *, page)
1092                 __field(unsigned int, clusters)
1093                 __field(unsigned int, extents_to_split)
1094         ),
1095         TP_fast_assign(
1096                 __entry->ino = ino;
1097                 __entry->i_size = i_size;
1098                 __entry->i_clusters = i_clusters;
1099                 __entry->pos = pos;
1100                 __entry->len = len;
1101                 __entry->flags = flags;
1102                 __entry->page = page;
1103                 __entry->clusters = clusters;
1104                 __entry->extents_to_split = extents_to_split;
1105         ),
1106         TP_printk("%llu %lld %u %llu %u %u %p %u %u",
1107                   __entry->ino, __entry->i_size, __entry->i_clusters,
1108                   __entry->pos, __entry->len,
1109                   __entry->flags, __entry->page, __entry->clusters,
1110                   __entry->extents_to_split)
1111 );
1112
1113 TRACE_EVENT(ocfs2_write_end_inline,
1114         TP_PROTO(unsigned long long ino,
1115                  unsigned long long pos, unsigned int copied,
1116                  unsigned int id_count, unsigned int features),
1117         TP_ARGS(ino, pos, copied, id_count, features),
1118         TP_STRUCT__entry(
1119                 __field(unsigned long long, ino)
1120                 __field(unsigned long long, pos)
1121                 __field(unsigned int, copied)
1122                 __field(unsigned int, id_count)
1123                 __field(unsigned int, features)
1124         ),
1125         TP_fast_assign(
1126                 __entry->ino = ino;
1127                 __entry->pos = pos;
1128                 __entry->copied = copied;
1129                 __entry->id_count = id_count;
1130                 __entry->features = features;
1131         ),
1132         TP_printk("%llu %llu %u %u %u",
1133                   __entry->ino, __entry->pos, __entry->copied,
1134                   __entry->id_count, __entry->features)
1135 );
1136
1137 /* End of trace events for fs/ocfs2/aops.c. */
1138
1139 /* Trace events for fs/ocfs2/mmap.c. */
1140
1141 TRACE_EVENT(ocfs2_fault,
1142         TP_PROTO(unsigned long long ino,
1143                  void *area, void *page, unsigned long pgoff),
1144         TP_ARGS(ino, area, page, pgoff),
1145         TP_STRUCT__entry(
1146                 __field(unsigned long long, ino)
1147                 __field(void *, area)
1148                 __field(void *, page)
1149                 __field(unsigned long, pgoff)
1150         ),
1151         TP_fast_assign(
1152                 __entry->ino = ino;
1153                 __entry->area = area;
1154                 __entry->page = page;
1155                 __entry->pgoff = pgoff;
1156         ),
1157         TP_printk("%llu %p %p %lu",
1158                   __entry->ino, __entry->area, __entry->page, __entry->pgoff)
1159 );
1160
1161 /* End of trace events for fs/ocfs2/mmap.c. */
1162
1163 /* Trace events for fs/ocfs2/file.c. */
1164
1165 DECLARE_EVENT_CLASS(ocfs2__file_ops,
1166         TP_PROTO(void *inode, void *file, void *dentry,
1167                  unsigned long long ino,
1168                  unsigned int d_len, const unsigned char *d_name,
1169                  unsigned long long para),
1170         TP_ARGS(inode, file, dentry, ino, d_len, d_name, para),
1171         TP_STRUCT__entry(
1172                 __field(void *, inode)
1173                 __field(void *, file)
1174                 __field(void *, dentry)
1175                 __field(unsigned long long, ino)
1176                 __field(unsigned int, d_len)
1177                 __string(d_name, d_name)
1178                 __field(unsigned long long, para)
1179         ),
1180         TP_fast_assign(
1181                 __entry->inode = inode;
1182                 __entry->file = file;
1183                 __entry->dentry = dentry;
1184                 __entry->ino = ino;
1185                 __entry->d_len = d_len;
1186                 __assign_str(d_name, d_name);
1187                 __entry->para = para;
1188         ),
1189         TP_printk("%p %p %p %llu %llu %.*s", __entry->inode, __entry->file,
1190                   __entry->dentry, __entry->ino, __entry->para,
1191                   __entry->d_len, __get_str(d_name))
1192 );
1193
1194 #define DEFINE_OCFS2_FILE_OPS(name)                             \
1195 DEFINE_EVENT(ocfs2__file_ops, name,                             \
1196 TP_PROTO(void *inode, void *file, void *dentry,                 \
1197          unsigned long long ino,                                \
1198          unsigned int d_len, const unsigned char *d_name,       \
1199          unsigned long long mode),                              \
1200         TP_ARGS(inode, file, dentry, ino, d_len, d_name, mode))
1201
1202 DEFINE_OCFS2_FILE_OPS(ocfs2_file_open);
1203
1204 DEFINE_OCFS2_FILE_OPS(ocfs2_file_release);
1205
1206 DEFINE_OCFS2_FILE_OPS(ocfs2_sync_file);
1207
1208 DEFINE_OCFS2_FILE_OPS(ocfs2_file_aio_write);
1209
1210 DEFINE_OCFS2_FILE_OPS(ocfs2_file_splice_write);
1211
1212 DEFINE_OCFS2_FILE_OPS(ocfs2_file_splice_read);
1213
1214 DEFINE_OCFS2_FILE_OPS(ocfs2_file_aio_read);
1215
1216 DEFINE_OCFS2_ULL_ULL_ULL_EVENT(ocfs2_truncate_file);
1217
1218 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_truncate_file_error);
1219
1220 TRACE_EVENT(ocfs2_extend_allocation,
1221         TP_PROTO(unsigned long long ip_blkno, unsigned long long size,
1222                  unsigned int clusters, unsigned int clusters_to_add,
1223                  int why, int restart_func),
1224         TP_ARGS(ip_blkno, size, clusters, clusters_to_add, why, restart_func),
1225         TP_STRUCT__entry(
1226                 __field(unsigned long long, ip_blkno)
1227                 __field(unsigned long long, size)
1228                 __field(unsigned int, clusters)
1229                 __field(unsigned int, clusters_to_add)
1230                 __field(int, why)
1231                 __field(int, restart_func)
1232         ),
1233         TP_fast_assign(
1234                 __entry->ip_blkno = ip_blkno;
1235                 __entry->size = size;
1236                 __entry->clusters = clusters;
1237                 __entry->clusters_to_add = clusters_to_add;
1238                 __entry->why = why;
1239                 __entry->restart_func = restart_func;
1240         ),
1241         TP_printk("%llu %llu %u %u %d %d",
1242                   __entry->ip_blkno, __entry->size, __entry->clusters,
1243                   __entry->clusters_to_add, __entry->why, __entry->restart_func)
1244 );
1245
1246 TRACE_EVENT(ocfs2_extend_allocation_end,
1247         TP_PROTO(unsigned long long ino,
1248                  unsigned int di_clusters, unsigned long long di_size,
1249                  unsigned int ip_clusters, unsigned long long i_size),
1250         TP_ARGS(ino, di_clusters, di_size, ip_clusters, i_size),
1251         TP_STRUCT__entry(
1252                 __field(unsigned long long, ino)
1253                 __field(unsigned int, di_clusters)
1254                 __field(unsigned long long, di_size)
1255                 __field(unsigned int, ip_clusters)
1256                 __field(unsigned long long, i_size)
1257         ),
1258         TP_fast_assign(
1259                 __entry->ino = ino;
1260                 __entry->di_clusters = di_clusters;
1261                 __entry->di_size = di_size;
1262                 __entry->ip_clusters = ip_clusters;
1263                 __entry->i_size = i_size;
1264         ),
1265         TP_printk("%llu %u %llu %u %llu", __entry->ino, __entry->di_clusters,
1266                   __entry->di_size, __entry->ip_clusters, __entry->i_size)
1267 );
1268
1269 TRACE_EVENT(ocfs2_write_zero_page,
1270         TP_PROTO(unsigned long long ino,
1271                  unsigned long long abs_from, unsigned long long abs_to,
1272                  unsigned long index, unsigned int zero_from,
1273                  unsigned int zero_to),
1274         TP_ARGS(ino, abs_from, abs_to, index, zero_from, zero_to),
1275         TP_STRUCT__entry(
1276                 __field(unsigned long long, ino)
1277                 __field(unsigned long long, abs_from)
1278                 __field(unsigned long long, abs_to)
1279                 __field(unsigned long, index)
1280                 __field(unsigned int, zero_from)
1281                 __field(unsigned int, zero_to)
1282         ),
1283         TP_fast_assign(
1284                 __entry->ino = ino;
1285                 __entry->abs_from = abs_from;
1286                 __entry->abs_to = abs_to;
1287                 __entry->index = index;
1288                 __entry->zero_from = zero_from;
1289                 __entry->zero_to = zero_to;
1290         ),
1291         TP_printk("%llu %llu %llu %lu %u %u", __entry->ino,
1292                   __entry->abs_from, __entry->abs_to,
1293                   __entry->index, __entry->zero_from, __entry->zero_to)
1294 );
1295
1296 DEFINE_OCFS2_ULL_ULL_ULL_EVENT(ocfs2_zero_extend_range);
1297
1298 DEFINE_OCFS2_ULL_ULL_ULL_EVENT(ocfs2_zero_extend);
1299
1300 TRACE_EVENT(ocfs2_setattr,
1301         TP_PROTO(void *inode, void *dentry,
1302                  unsigned long long ino,
1303                  unsigned int d_len, const unsigned char *d_name,
1304                  unsigned int ia_valid, unsigned int ia_mode,
1305                  unsigned int ia_uid, unsigned int ia_gid),
1306         TP_ARGS(inode, dentry, ino, d_len, d_name,
1307                 ia_valid, ia_mode, ia_uid, ia_gid),
1308         TP_STRUCT__entry(
1309                 __field(void *, inode)
1310                 __field(void *, dentry)
1311                 __field(unsigned long long, ino)
1312                 __field(unsigned int, d_len)
1313                 __string(d_name, d_name)
1314                 __field(unsigned int, ia_valid)
1315                 __field(unsigned int, ia_mode)
1316                 __field(unsigned int, ia_uid)
1317                 __field(unsigned int, ia_gid)
1318         ),
1319         TP_fast_assign(
1320                 __entry->inode = inode;
1321                 __entry->dentry = dentry;
1322                 __entry->ino = ino;
1323                 __entry->d_len = d_len;
1324                 __assign_str(d_name, d_name);
1325                 __entry->ia_valid = ia_valid;
1326                 __entry->ia_mode = ia_mode;
1327                 __entry->ia_uid = ia_uid;
1328                 __entry->ia_gid = ia_gid;
1329         ),
1330         TP_printk("%p %p %llu %.*s %u %u %u %u", __entry->inode,
1331                   __entry->dentry, __entry->ino, __entry->d_len,
1332                   __get_str(d_name), __entry->ia_valid, __entry->ia_mode,
1333                   __entry->ia_uid, __entry->ia_gid)
1334 );
1335
1336 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_write_remove_suid);
1337
1338 DEFINE_OCFS2_ULL_ULL_ULL_EVENT(ocfs2_zero_partial_clusters);
1339
1340 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_zero_partial_clusters_range1);
1341
1342 DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_zero_partial_clusters_range2);
1343
1344 DEFINE_OCFS2_ULL_ULL_ULL_EVENT(ocfs2_remove_inode_range);
1345
1346 TRACE_EVENT(ocfs2_prepare_inode_for_write,
1347         TP_PROTO(unsigned long long ino, unsigned long long saved_pos,
1348                  int appending, unsigned long count,
1349                  int *direct_io, int *has_refcount),
1350         TP_ARGS(ino, saved_pos, appending, count, direct_io, has_refcount),
1351         TP_STRUCT__entry(
1352                 __field(unsigned long long, ino)
1353                 __field(unsigned long long, saved_pos)
1354                 __field(int, appending)
1355                 __field(unsigned long, count)
1356                 __field(int, direct_io)
1357                 __field(int, has_refcount)
1358         ),
1359         TP_fast_assign(
1360                 __entry->ino = ino;
1361                 __entry->saved_pos = saved_pos;
1362                 __entry->appending = appending;
1363                 __entry->count = count;
1364                 __entry->direct_io = direct_io ? *direct_io : -1;
1365                 __entry->has_refcount = has_refcount ? *has_refcount : -1;
1366         ),
1367         TP_printk("%llu %llu %d %lu %d %d", __entry->ino,
1368                   __entry->saved_pos, __entry->appending, __entry->count,
1369                   __entry->direct_io, __entry->has_refcount)
1370 );
1371
1372 DEFINE_OCFS2_INT_EVENT(generic_file_aio_read_ret);
1373
1374 /* End of trace events for fs/ocfs2/file.c. */
1375
1376 /* Trace events for fs/ocfs2/inode.c. */
1377
1378 TRACE_EVENT(ocfs2_iget_begin,
1379         TP_PROTO(unsigned long long ino, unsigned int flags, int sysfile_type),
1380         TP_ARGS(ino, flags, sysfile_type),
1381         TP_STRUCT__entry(
1382                 __field(unsigned long long, ino)
1383                 __field(unsigned int, flags)
1384                 __field(int, sysfile_type)
1385         ),
1386         TP_fast_assign(
1387                 __entry->ino = ino;
1388                 __entry->flags = flags;
1389                 __entry->sysfile_type = sysfile_type;
1390         ),
1391         TP_printk("%llu %u %d", __entry->ino,
1392                   __entry->flags, __entry->sysfile_type)
1393 );
1394
1395 DEFINE_OCFS2_ULL_EVENT(ocfs2_iget5_locked);
1396
1397 TRACE_EVENT(ocfs2_iget_end,
1398         TP_PROTO(void *inode, unsigned long long ino),
1399         TP_ARGS(inode, ino),
1400         TP_STRUCT__entry(
1401                 __field(void *, inode)
1402                 __field(unsigned long long, ino)
1403         ),
1404         TP_fast_assign(
1405                 __entry->inode = inode;
1406                 __entry->ino = ino;
1407         ),
1408         TP_printk("%p %llu", __entry->inode, __entry->ino)
1409 );
1410
1411 TRACE_EVENT(ocfs2_find_actor,
1412         TP_PROTO(void *inode, unsigned long long ino,
1413                  void *args,  unsigned long long fi_blkno),
1414         TP_ARGS(inode, ino, args, fi_blkno),
1415         TP_STRUCT__entry(
1416                 __field(void *, inode)
1417                 __field(unsigned long long, ino)
1418                 __field(void *, args)
1419                 __field(unsigned long long, fi_blkno)
1420         ),
1421         TP_fast_assign(
1422                 __entry->inode = inode;
1423                 __entry->ino = ino;
1424                 __entry->args = args;
1425                 __entry->fi_blkno = fi_blkno;
1426         ),
1427         TP_printk("%p %llu %p %llu", __entry->inode, __entry->ino,
1428                   __entry->args, __entry->fi_blkno)
1429 );
1430
1431 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_populate_inode);
1432
1433 DEFINE_OCFS2_ULL_INT_EVENT(ocfs2_read_locked_inode);
1434
1435 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_check_orphan_recovery_state);
1436
1437 DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_inode_block);
1438
1439 TRACE_EVENT(ocfs2_inode_is_valid_to_delete,
1440         TP_PROTO(void *task, void *dc_task, unsigned long long ino,
1441                  unsigned int flags),
1442         TP_ARGS(task, dc_task, ino, flags),
1443         TP_STRUCT__entry(
1444                 __field(void *, task)
1445                 __field(void *, dc_task)
1446                 __field(unsigned long long, ino)
1447                 __field(unsigned int, flags)
1448         ),
1449         TP_fast_assign(
1450                 __entry->task = task;
1451                 __entry->dc_task = dc_task;
1452                 __entry->ino = ino;
1453                 __entry->flags = flags;
1454         ),
1455         TP_printk("%p %p %llu %u", __entry->task, __entry->dc_task,
1456                   __entry->ino, __entry->flags)
1457 );
1458
1459 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_query_inode_wipe_begin);
1460
1461 DEFINE_OCFS2_UINT_EVENT(ocfs2_query_inode_wipe_succ);
1462
1463 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_query_inode_wipe_end);
1464
1465 DEFINE_OCFS2_ULL_INT_EVENT(ocfs2_cleanup_delete_inode);
1466
1467 DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_delete_inode);
1468
1469 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_clear_inode);
1470
1471 DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_drop_inode);
1472
1473 TRACE_EVENT(ocfs2_inode_revalidate,
1474         TP_PROTO(void *inode, unsigned long long ino,
1475                  unsigned int flags),
1476         TP_ARGS(inode, ino, flags),
1477         TP_STRUCT__entry(
1478                 __field(void *, inode)
1479                 __field(unsigned long long, ino)
1480                 __field(unsigned int, flags)
1481         ),
1482         TP_fast_assign(
1483                 __entry->inode = inode;
1484                 __entry->ino = ino;
1485                 __entry->flags = flags;
1486         ),
1487         TP_printk("%p %llu %u", __entry->inode, __entry->ino, __entry->flags)
1488 );
1489
1490 DEFINE_OCFS2_ULL_EVENT(ocfs2_mark_inode_dirty);
1491
1492 /* End of trace events for fs/ocfs2/inode.c. */
1493
1494 /* Trace events for fs/ocfs2/extent_map.c. */
1495
1496 TRACE_EVENT(ocfs2_read_virt_blocks,
1497         TP_PROTO(void *inode, unsigned long long vblock, int nr,
1498                  void *bhs, unsigned int flags, void *validate),
1499         TP_ARGS(inode, vblock, nr, bhs, flags, validate),
1500         TP_STRUCT__entry(
1501                 __field(void *, inode)
1502                 __field(unsigned long long, vblock)
1503                 __field(int, nr)
1504                 __field(void *, bhs)
1505                 __field(unsigned int, flags)
1506                 __field(void *, validate)
1507         ),
1508         TP_fast_assign(
1509                 __entry->inode = inode;
1510                 __entry->vblock = vblock;
1511                 __entry->nr = nr;
1512                 __entry->bhs = bhs;
1513                 __entry->flags = flags;
1514                 __entry->validate = validate;
1515         ),
1516         TP_printk("%p %llu %d %p %x %p", __entry->inode, __entry->vblock,
1517                   __entry->nr, __entry->bhs, __entry->flags, __entry->validate)
1518 );
1519
1520 /* End of trace events for fs/ocfs2/extent_map.c. */
1521
1522 #endif /* _TRACE_OCFS2_H */
1523
1524 /* This part must be outside protection */
1525 #undef TRACE_INCLUDE_PATH
1526 #define TRACE_INCLUDE_PATH .
1527 #define TRACE_INCLUDE_FILE ocfs2_trace
1528 #include <trace/define_trace.h>