diff options
author | Tao Ma <boyu.mt@taobao.com> | 2011-02-21 18:56:45 -0500 |
---|---|---|
committer | Tao Ma <boyu.mt@taobao.com> | 2011-02-21 18:56:45 -0500 |
commit | a04733d8afad9cd0bfb8269173e30d28fb96088e (patch) | |
tree | 4880e40a4034d2c2c742ae243533bc9b9f9c33bd /fs/ocfs2/ocfs2_trace.h | |
parent | a09d09b8f8d7c8acd46d96e3e9899bd1461fc036 (diff) |
ocfs2: Remove mlog(0) from fs/ocfs2/localalloc.c
This is the 2nd step to remove the debug info of DISK_ALLOC.
So this patch removes all mlog(0,...) from localalloc.c and adds
the corresponding tracepoints. Different mlogs have different
solutions.
1. Some are replaced with trace event directly.
2. Some are replaced while some new parameters are added.
3. Some are combined into one trace events.
4. Some redundant mlogs are removed.
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Diffstat (limited to 'fs/ocfs2/ocfs2_trace.h')
-rw-r--r-- | fs/ocfs2/ocfs2_trace.h | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h index 1793b1f71805..5bba629766ca 100644 --- a/fs/ocfs2/ocfs2_trace.h +++ b/fs/ocfs2/ocfs2_trace.h | |||
@@ -23,6 +23,23 @@ DEFINE_EVENT(ocfs2__int, name, \ | |||
23 | TP_PROTO(int num), \ | 23 | TP_PROTO(int num), \ |
24 | TP_ARGS(num)) | 24 | TP_ARGS(num)) |
25 | 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 | |||
26 | DECLARE_EVENT_CLASS(ocfs2__int_int, | 43 | DECLARE_EVENT_CLASS(ocfs2__int_int, |
27 | TP_PROTO(int value1, int value2), | 44 | TP_PROTO(int value1, int value2), |
28 | TP_ARGS(value1, value2), | 45 | TP_ARGS(value1, value2), |
@@ -61,6 +78,55 @@ DEFINE_EVENT(ocfs2__ull_uint, name, \ | |||
61 | TP_PROTO(unsigned long long val1, unsigned int val2), \ | 78 | TP_PROTO(unsigned long long val1, unsigned int val2), \ |
62 | TP_ARGS(val1, val2)) | 79 | TP_ARGS(val1, val2)) |
63 | 80 | ||
81 | DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint, | ||
82 | TP_PROTO(unsigned int value1, unsigned int value2, | ||
83 | unsigned int value3), | ||
84 | TP_ARGS(value1, value2, value3), | ||
85 | TP_STRUCT__entry( | ||
86 | __field( unsigned int, value1 ) | ||
87 | __field( unsigned int, value2 ) | ||
88 | __field( unsigned int, value3 ) | ||
89 | ), | ||
90 | TP_fast_assign( | ||
91 | __entry->value1 = value1; | ||
92 | __entry->value2 = value2; | ||
93 | __entry->value3 = value3; | ||
94 | ), | ||
95 | TP_printk("%u %u %u", __entry->value1, __entry->value2, __entry->value3) | ||
96 | ); | ||
97 | |||
98 | #define DEFINE_OCFS2_UINT_UINT_UINT_EVENT(name) \ | ||
99 | DEFINE_EVENT(ocfs2__uint_uint_uint, name, \ | ||
100 | TP_PROTO(unsigned int value1, unsigned int value2, \ | ||
101 | unsigned int value3), \ | ||
102 | TP_ARGS(value1, value2, value3)) | ||
103 | |||
104 | DECLARE_EVENT_CLASS(ocfs2__ull_int_int_int, | ||
105 | TP_PROTO(unsigned long long ull, int value1, int value2, int value3), | ||
106 | TP_ARGS(ull, value1, value2, value3), | ||
107 | TP_STRUCT__entry( | ||
108 | __field( unsigned long long, ull ) | ||
109 | __field( int, value1 ) | ||
110 | __field( int, value2 ) | ||
111 | __field( int, value3 ) | ||
112 | ), | ||
113 | TP_fast_assign( | ||
114 | __entry->ull = ull; | ||
115 | __entry->value1 = value1; | ||
116 | __entry->value2 = value2; | ||
117 | __entry->value3 = value3; | ||
118 | ), | ||
119 | TP_printk("%llu %d %d %d", | ||
120 | __entry->ull, __entry->value1, | ||
121 | __entry->value2, __entry->value3) | ||
122 | ); | ||
123 | |||
124 | #define DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(name) \ | ||
125 | DEFINE_EVENT(ocfs2__ull_int_int_int, name, \ | ||
126 | TP_PROTO(unsigned long long ull, int value1, \ | ||
127 | int value2, int value3), \ | ||
128 | TP_ARGS(ull, value1, value2, value3)) | ||
129 | |||
64 | /* Trace events for fs/ocfs2/alloc.c. */ | 130 | /* Trace events for fs/ocfs2/alloc.c. */ |
65 | DECLARE_EVENT_CLASS(ocfs2__btree_ops, | 131 | DECLARE_EVENT_CLASS(ocfs2__btree_ops, |
66 | TP_PROTO(unsigned long long owner,\ | 132 | TP_PROTO(unsigned long long owner,\ |
@@ -371,6 +437,52 @@ TRACE_EVENT(ocfs2_cache_block_dealloc, | |||
371 | 437 | ||
372 | /* End of trace events for fs/ocfs2/alloc.c. */ | 438 | /* End of trace events for fs/ocfs2/alloc.c. */ |
373 | 439 | ||
440 | /* Trace events for fs/ocfs2/localalloc.c. */ | ||
441 | |||
442 | DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_la_set_sizes); | ||
443 | |||
444 | DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_alloc_should_use_local); | ||
445 | |||
446 | DEFINE_OCFS2_INT_EVENT(ocfs2_load_local_alloc); | ||
447 | |||
448 | DEFINE_OCFS2_INT_EVENT(ocfs2_begin_local_alloc_recovery); | ||
449 | |||
450 | DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_reserve_local_alloc_bits); | ||
451 | |||
452 | DEFINE_OCFS2_UINT_EVENT(ocfs2_local_alloc_count_bits); | ||
453 | |||
454 | DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits_search_bitmap); | ||
455 | |||
456 | DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_local_alloc_find_clear_bits); | ||
457 | |||
458 | DEFINE_OCFS2_INT_INT_EVENT(ocfs2_sync_local_to_main); | ||
459 | |||
460 | TRACE_EVENT(ocfs2_sync_local_to_main_free, | ||
461 | TP_PROTO(int count, int bit, unsigned long long start_blk, | ||
462 | unsigned long long blkno), | ||
463 | TP_ARGS(count, bit, start_blk, blkno), | ||
464 | TP_STRUCT__entry( | ||
465 | __field(int, count) | ||
466 | __field(int, bit) | ||
467 | __field(unsigned long long, start_blk) | ||
468 | __field(unsigned long long, blkno) | ||
469 | ), | ||
470 | TP_fast_assign( | ||
471 | __entry->count = count; | ||
472 | __entry->bit = bit; | ||
473 | __entry->start_blk = start_blk; | ||
474 | __entry->blkno = blkno; | ||
475 | ), | ||
476 | TP_printk("%d %d %llu %llu", | ||
477 | __entry->count, __entry->bit, __entry->start_blk, | ||
478 | __entry->blkno) | ||
479 | ); | ||
480 | |||
481 | DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_new_window); | ||
482 | |||
483 | DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result); | ||
484 | |||
485 | /* End of trace events for fs/ocfs2/localalloc.c. */ | ||
374 | #endif /* _TRACE_OCFS2_H */ | 486 | #endif /* _TRACE_OCFS2_H */ |
375 | 487 | ||
376 | /* This part must be outside protection */ | 488 | /* This part must be outside protection */ |