diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-09-30 00:32:06 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-09-30 00:32:06 -0400 |
commit | bf6993276f74d46776f35c45ddef29b981b1d1c6 (patch) | |
tree | 5c9cb128fed29a83add1932b12443edaa6fd06cc /include/trace | |
parent | 296c355cd6443d89fa251885a8d78778fe111dc4 (diff) |
jbd2: Use tracepoints for history file
The /proc/fs/jbd2/<dev>/history was maintained manually; by using
tracepoints, we can get all of the existing functionality of the /proc
file plus extra capabilities thanks to the ftrace infrastructure. We
save memory as a bonus.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/jbd2.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h index b851f0b4701c..3c60b75adb9e 100644 --- a/include/trace/events/jbd2.h +++ b/include/trace/events/jbd2.h | |||
@@ -7,6 +7,9 @@ | |||
7 | #include <linux/jbd2.h> | 7 | #include <linux/jbd2.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | 9 | ||
10 | struct transaction_chp_stats_s; | ||
11 | struct transaction_run_stats_s; | ||
12 | |||
10 | TRACE_EVENT(jbd2_checkpoint, | 13 | TRACE_EVENT(jbd2_checkpoint, |
11 | 14 | ||
12 | TP_PROTO(journal_t *journal, int result), | 15 | TP_PROTO(journal_t *journal, int result), |
@@ -162,6 +165,81 @@ TRACE_EVENT(jbd2_submit_inode_data, | |||
162 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) | 165 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) |
163 | ); | 166 | ); |
164 | 167 | ||
168 | TRACE_EVENT(jbd2_run_stats, | ||
169 | TP_PROTO(dev_t dev, unsigned long tid, | ||
170 | struct transaction_run_stats_s *stats), | ||
171 | |||
172 | TP_ARGS(dev, tid, stats), | ||
173 | |||
174 | TP_STRUCT__entry( | ||
175 | __field( dev_t, dev ) | ||
176 | __field( unsigned long, tid ) | ||
177 | __field( unsigned long, wait ) | ||
178 | __field( unsigned long, running ) | ||
179 | __field( unsigned long, locked ) | ||
180 | __field( unsigned long, flushing ) | ||
181 | __field( unsigned long, logging ) | ||
182 | __field( __u32, handle_count ) | ||
183 | __field( __u32, blocks ) | ||
184 | __field( __u32, blocks_logged ) | ||
185 | ), | ||
186 | |||
187 | TP_fast_assign( | ||
188 | __entry->dev = dev; | ||
189 | __entry->tid = tid; | ||
190 | __entry->wait = stats->rs_wait; | ||
191 | __entry->running = stats->rs_running; | ||
192 | __entry->locked = stats->rs_locked; | ||
193 | __entry->flushing = stats->rs_flushing; | ||
194 | __entry->logging = stats->rs_logging; | ||
195 | __entry->handle_count = stats->rs_handle_count; | ||
196 | __entry->blocks = stats->rs_blocks; | ||
197 | __entry->blocks_logged = stats->rs_blocks_logged; | ||
198 | ), | ||
199 | |||
200 | TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u " | ||
201 | "logging %u handle_count %u blocks %u blocks_logged %u", | ||
202 | jbd2_dev_to_name(__entry->dev), __entry->tid, | ||
203 | jiffies_to_msecs(__entry->wait), | ||
204 | jiffies_to_msecs(__entry->running), | ||
205 | jiffies_to_msecs(__entry->locked), | ||
206 | jiffies_to_msecs(__entry->flushing), | ||
207 | jiffies_to_msecs(__entry->logging), | ||
208 | __entry->handle_count, __entry->blocks, | ||
209 | __entry->blocks_logged) | ||
210 | ); | ||
211 | |||
212 | TRACE_EVENT(jbd2_checkpoint_stats, | ||
213 | TP_PROTO(dev_t dev, unsigned long tid, | ||
214 | struct transaction_chp_stats_s *stats), | ||
215 | |||
216 | TP_ARGS(dev, tid, stats), | ||
217 | |||
218 | TP_STRUCT__entry( | ||
219 | __field( dev_t, dev ) | ||
220 | __field( unsigned long, tid ) | ||
221 | __field( unsigned long, chp_time ) | ||
222 | __field( __u32, forced_to_close ) | ||
223 | __field( __u32, written ) | ||
224 | __field( __u32, dropped ) | ||
225 | ), | ||
226 | |||
227 | TP_fast_assign( | ||
228 | __entry->dev = dev; | ||
229 | __entry->tid = tid; | ||
230 | __entry->chp_time = stats->cs_chp_time; | ||
231 | __entry->forced_to_close= stats->cs_forced_to_close; | ||
232 | __entry->written = stats->cs_written; | ||
233 | __entry->dropped = stats->cs_dropped; | ||
234 | ), | ||
235 | |||
236 | TP_printk("dev %s tid %lu chp_time %u forced_to_close %u " | ||
237 | "written %u dropped %u", | ||
238 | jbd2_dev_to_name(__entry->dev), __entry->tid, | ||
239 | jiffies_to_msecs(__entry->chp_time), | ||
240 | __entry->forced_to_close, __entry->written, __entry->dropped) | ||
241 | ); | ||
242 | |||
165 | #endif /* _TRACE_JBD2_H */ | 243 | #endif /* _TRACE_JBD2_H */ |
166 | 244 | ||
167 | /* This part must be outside protection */ | 245 | /* This part must be outside protection */ |