diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-11-26 02:06:55 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-26 03:14:04 -0500 |
commit | 071688f36e7eba3e37b2fc48e35bfdab99b80b4d (patch) | |
tree | 938eeb106c1adcdccfdf55200e1564b28a39240c /include/trace | |
parent | 77ca1e0294f25fc26053ba14353e703158acef26 (diff) |
tracing: Convert some jbd2 events to DEFINE_EVENT
Use DECLARE_EVENT_CLASS to remove duplicate code:
text data bss dec hex filename
34903 1693 448 37044 90b4 fs/jbd2/journal.o.old
31931 1693 416 34040 84f8 fs/jbd2/journal.o
Four events are converted:
jbd2_commit: jbd2_start_commit,
jbd2_commit_{locking, flushing, logging}
No change in functionality.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4B0E290F.7030909@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/jbd2.h | 63 |
1 files changed, 11 insertions, 52 deletions
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h index 3c60b75adb9e..96b370a050de 100644 --- a/include/trace/events/jbd2.h +++ b/include/trace/events/jbd2.h | |||
@@ -30,7 +30,7 @@ TRACE_EVENT(jbd2_checkpoint, | |||
30 | jbd2_dev_to_name(__entry->dev), __entry->result) | 30 | jbd2_dev_to_name(__entry->dev), __entry->result) |
31 | ); | 31 | ); |
32 | 32 | ||
33 | TRACE_EVENT(jbd2_start_commit, | 33 | DECLARE_EVENT_CLASS(jbd2_commit, |
34 | 34 | ||
35 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | 35 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
36 | 36 | ||
@@ -53,73 +53,32 @@ TRACE_EVENT(jbd2_start_commit, | |||
53 | __entry->sync_commit) | 53 | __entry->sync_commit) |
54 | ); | 54 | ); |
55 | 55 | ||
56 | TRACE_EVENT(jbd2_commit_locking, | 56 | DEFINE_EVENT(jbd2_commit, jbd2_start_commit, |
57 | 57 | ||
58 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | 58 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
59 | 59 | ||
60 | TP_ARGS(journal, commit_transaction), | 60 | TP_ARGS(journal, commit_transaction) |
61 | |||
62 | TP_STRUCT__entry( | ||
63 | __field( dev_t, dev ) | ||
64 | __field( char, sync_commit ) | ||
65 | __field( int, transaction ) | ||
66 | ), | ||
67 | |||
68 | TP_fast_assign( | ||
69 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
70 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
71 | __entry->transaction = commit_transaction->t_tid; | ||
72 | ), | ||
73 | |||
74 | TP_printk("dev %s transaction %d sync %d", | ||
75 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
76 | __entry->sync_commit) | ||
77 | ); | 61 | ); |
78 | 62 | ||
79 | TRACE_EVENT(jbd2_commit_flushing, | 63 | DEFINE_EVENT(jbd2_commit, jbd2_commit_locking, |
80 | 64 | ||
81 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | 65 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
82 | 66 | ||
83 | TP_ARGS(journal, commit_transaction), | 67 | TP_ARGS(journal, commit_transaction) |
84 | |||
85 | TP_STRUCT__entry( | ||
86 | __field( dev_t, dev ) | ||
87 | __field( char, sync_commit ) | ||
88 | __field( int, transaction ) | ||
89 | ), | ||
90 | |||
91 | TP_fast_assign( | ||
92 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
93 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
94 | __entry->transaction = commit_transaction->t_tid; | ||
95 | ), | ||
96 | |||
97 | TP_printk("dev %s transaction %d sync %d", | ||
98 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
99 | __entry->sync_commit) | ||
100 | ); | 68 | ); |
101 | 69 | ||
102 | TRACE_EVENT(jbd2_commit_logging, | 70 | DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing, |
103 | 71 | ||
104 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | 72 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
105 | 73 | ||
106 | TP_ARGS(journal, commit_transaction), | 74 | TP_ARGS(journal, commit_transaction) |
75 | ); | ||
107 | 76 | ||
108 | TP_STRUCT__entry( | 77 | DEFINE_EVENT(jbd2_commit, jbd2_commit_logging, |
109 | __field( dev_t, dev ) | ||
110 | __field( char, sync_commit ) | ||
111 | __field( int, transaction ) | ||
112 | ), | ||
113 | 78 | ||
114 | TP_fast_assign( | 79 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
115 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
116 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
117 | __entry->transaction = commit_transaction->t_tid; | ||
118 | ), | ||
119 | 80 | ||
120 | TP_printk("dev %s transaction %d sync %d", | 81 | TP_ARGS(journal, commit_transaction) |
121 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
122 | __entry->sync_commit) | ||
123 | ); | 82 | ); |
124 | 83 | ||
125 | TRACE_EVENT(jbd2_end_commit, | 84 | TRACE_EVENT(jbd2_end_commit, |