diff options
author | Lukas Czerner <lczerner@redhat.com> | 2011-05-23 12:33:02 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-06-25 11:29:51 -0400 |
commit | 99cb1a318c37bf462c53d43f4dacb7b4896ce0c9 (patch) | |
tree | 32a9046649777e8cc589bbc8e0afb382642ba450 /fs | |
parent | 785c4bcc0d88ff006a0b2120815a71e86ecf21ce (diff) |
jbd: Add fixed tracepoints
This commit adds fixed tracepoint for jbd. It has been based on fixed
tracepoints for jbd2, however there are missing those for collecting
statistics, since I think that it will require more intrusive patch so I
should have its own commit, if someone decide that it is needed. Also
there are new tracepoints in __journal_drop_transaction() and
journal_update_superblock().
The list of jbd tracepoints:
jbd_checkpoint
jbd_start_commit
jbd_commit_locking
jbd_commit_flushing
jbd_commit_logging
jbd_drop_transaction
jbd_end_commit
jbd_do_submit_data
jbd_cleanup_journal_tail
jbd_update_superblock_end
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jbd/checkpoint.c | 4 | ||||
-rw-r--r-- | fs/jbd/commit.c | 11 | ||||
-rw-r--r-- | fs/jbd/journal.c | 4 |
3 files changed, 19 insertions, 0 deletions
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c index e4b87bc1fa56..dea7503b47e8 100644 --- a/fs/jbd/checkpoint.c +++ b/fs/jbd/checkpoint.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/jbd.h> | 22 | #include <linux/jbd.h> |
23 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <trace/events/jbd.h> | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Unlink a buffer from a transaction checkpoint list. | 28 | * Unlink a buffer from a transaction checkpoint list. |
@@ -358,6 +359,7 @@ int log_do_checkpoint(journal_t *journal) | |||
358 | * journal straight away. | 359 | * journal straight away. |
359 | */ | 360 | */ |
360 | result = cleanup_journal_tail(journal); | 361 | result = cleanup_journal_tail(journal); |
362 | trace_jbd_checkpoint(journal, result); | ||
361 | jbd_debug(1, "cleanup_journal_tail returned %d\n", result); | 363 | jbd_debug(1, "cleanup_journal_tail returned %d\n", result); |
362 | if (result <= 0) | 364 | if (result <= 0) |
363 | return result; | 365 | return result; |
@@ -503,6 +505,7 @@ int cleanup_journal_tail(journal_t *journal) | |||
503 | if (blocknr < journal->j_tail) | 505 | if (blocknr < journal->j_tail) |
504 | freed = freed + journal->j_last - journal->j_first; | 506 | freed = freed + journal->j_last - journal->j_first; |
505 | 507 | ||
508 | trace_jbd_cleanup_journal_tail(journal, first_tid, blocknr, freed); | ||
506 | jbd_debug(1, | 509 | jbd_debug(1, |
507 | "Cleaning journal tail from %d to %d (offset %u), " | 510 | "Cleaning journal tail from %d to %d (offset %u), " |
508 | "freeing %u\n", | 511 | "freeing %u\n", |
@@ -752,6 +755,7 @@ void __journal_drop_transaction(journal_t *journal, transaction_t *transaction) | |||
752 | J_ASSERT(journal->j_committing_transaction != transaction); | 755 | J_ASSERT(journal->j_committing_transaction != transaction); |
753 | J_ASSERT(journal->j_running_transaction != transaction); | 756 | J_ASSERT(journal->j_running_transaction != transaction); |
754 | 757 | ||
758 | trace_jbd_drop_transaction(journal, transaction); | ||
755 | jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid); | 759 | jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid); |
756 | kfree(transaction); | 760 | kfree(transaction); |
757 | } | 761 | } |
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index 72ffa974b0b8..eedd201374a8 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/pagemap.h> | 21 | #include <linux/pagemap.h> |
22 | #include <linux/bio.h> | 22 | #include <linux/bio.h> |
23 | #include <linux/blkdev.h> | 23 | #include <linux/blkdev.h> |
24 | #include <trace/events/jbd.h> | ||
24 | 25 | ||
25 | /* | 26 | /* |
26 | * Default IO end handler for temporary BJ_IO buffer_heads. | 27 | * Default IO end handler for temporary BJ_IO buffer_heads. |
@@ -204,6 +205,8 @@ write_out_data: | |||
204 | if (!trylock_buffer(bh)) { | 205 | if (!trylock_buffer(bh)) { |
205 | BUFFER_TRACE(bh, "needs blocking lock"); | 206 | BUFFER_TRACE(bh, "needs blocking lock"); |
206 | spin_unlock(&journal->j_list_lock); | 207 | spin_unlock(&journal->j_list_lock); |
208 | trace_jbd_do_submit_data(journal, | ||
209 | commit_transaction); | ||
207 | /* Write out all data to prevent deadlocks */ | 210 | /* Write out all data to prevent deadlocks */ |
208 | journal_do_submit_data(wbuf, bufs, write_op); | 211 | journal_do_submit_data(wbuf, bufs, write_op); |
209 | bufs = 0; | 212 | bufs = 0; |
@@ -236,6 +239,8 @@ write_out_data: | |||
236 | jbd_unlock_bh_state(bh); | 239 | jbd_unlock_bh_state(bh); |
237 | if (bufs == journal->j_wbufsize) { | 240 | if (bufs == journal->j_wbufsize) { |
238 | spin_unlock(&journal->j_list_lock); | 241 | spin_unlock(&journal->j_list_lock); |
242 | trace_jbd_do_submit_data(journal, | ||
243 | commit_transaction); | ||
239 | journal_do_submit_data(wbuf, bufs, write_op); | 244 | journal_do_submit_data(wbuf, bufs, write_op); |
240 | bufs = 0; | 245 | bufs = 0; |
241 | goto write_out_data; | 246 | goto write_out_data; |
@@ -266,6 +271,7 @@ write_out_data: | |||
266 | } | 271 | } |
267 | } | 272 | } |
268 | spin_unlock(&journal->j_list_lock); | 273 | spin_unlock(&journal->j_list_lock); |
274 | trace_jbd_do_submit_data(journal, commit_transaction); | ||
269 | journal_do_submit_data(wbuf, bufs, write_op); | 275 | journal_do_submit_data(wbuf, bufs, write_op); |
270 | 276 | ||
271 | return err; | 277 | return err; |
@@ -316,12 +322,14 @@ void journal_commit_transaction(journal_t *journal) | |||
316 | commit_transaction = journal->j_running_transaction; | 322 | commit_transaction = journal->j_running_transaction; |
317 | J_ASSERT(commit_transaction->t_state == T_RUNNING); | 323 | J_ASSERT(commit_transaction->t_state == T_RUNNING); |
318 | 324 | ||
325 | trace_jbd_start_commit(journal, commit_transaction); | ||
319 | jbd_debug(1, "JBD: starting commit of transaction %d\n", | 326 | jbd_debug(1, "JBD: starting commit of transaction %d\n", |
320 | commit_transaction->t_tid); | 327 | commit_transaction->t_tid); |
321 | 328 | ||
322 | spin_lock(&journal->j_state_lock); | 329 | spin_lock(&journal->j_state_lock); |
323 | commit_transaction->t_state = T_LOCKED; | 330 | commit_transaction->t_state = T_LOCKED; |
324 | 331 | ||
332 | trace_jbd_commit_locking(journal, commit_transaction); | ||
325 | spin_lock(&commit_transaction->t_handle_lock); | 333 | spin_lock(&commit_transaction->t_handle_lock); |
326 | while (commit_transaction->t_updates) { | 334 | while (commit_transaction->t_updates) { |
327 | DEFINE_WAIT(wait); | 335 | DEFINE_WAIT(wait); |
@@ -392,6 +400,7 @@ void journal_commit_transaction(journal_t *journal) | |||
392 | */ | 400 | */ |
393 | journal_switch_revoke_table(journal); | 401 | journal_switch_revoke_table(journal); |
394 | 402 | ||
403 | trace_jbd_commit_flushing(journal, commit_transaction); | ||
395 | commit_transaction->t_state = T_FLUSH; | 404 | commit_transaction->t_state = T_FLUSH; |
396 | journal->j_committing_transaction = commit_transaction; | 405 | journal->j_committing_transaction = commit_transaction; |
397 | journal->j_running_transaction = NULL; | 406 | journal->j_running_transaction = NULL; |
@@ -493,6 +502,7 @@ void journal_commit_transaction(journal_t *journal) | |||
493 | commit_transaction->t_state = T_COMMIT; | 502 | commit_transaction->t_state = T_COMMIT; |
494 | spin_unlock(&journal->j_state_lock); | 503 | spin_unlock(&journal->j_state_lock); |
495 | 504 | ||
505 | trace_jbd_commit_logging(journal, commit_transaction); | ||
496 | J_ASSERT(commit_transaction->t_nr_buffers <= | 506 | J_ASSERT(commit_transaction->t_nr_buffers <= |
497 | commit_transaction->t_outstanding_credits); | 507 | commit_transaction->t_outstanding_credits); |
498 | 508 | ||
@@ -946,6 +956,7 @@ restart_loop: | |||
946 | } | 956 | } |
947 | spin_unlock(&journal->j_list_lock); | 957 | spin_unlock(&journal->j_list_lock); |
948 | 958 | ||
959 | trace_jbd_end_commit(journal, commit_transaction); | ||
949 | jbd_debug(1, "JBD: commit %d complete, head %d\n", | 960 | jbd_debug(1, "JBD: commit %d complete, head %d\n", |
950 | journal->j_commit_sequence, journal->j_tail_sequence); | 961 | journal->j_commit_sequence, journal->j_tail_sequence); |
951 | 962 | ||
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index e2d4285fbe90..ab019ee77888 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -38,6 +38,9 @@ | |||
38 | #include <linux/debugfs.h> | 38 | #include <linux/debugfs.h> |
39 | #include <linux/ratelimit.h> | 39 | #include <linux/ratelimit.h> |
40 | 40 | ||
41 | #define CREATE_TRACE_POINTS | ||
42 | #include <trace/events/jbd.h> | ||
43 | |||
41 | #include <asm/uaccess.h> | 44 | #include <asm/uaccess.h> |
42 | #include <asm/page.h> | 45 | #include <asm/page.h> |
43 | 46 | ||
@@ -1065,6 +1068,7 @@ void journal_update_superblock(journal_t *journal, int wait) | |||
1065 | } else | 1068 | } else |
1066 | write_dirty_buffer(bh, WRITE); | 1069 | write_dirty_buffer(bh, WRITE); |
1067 | 1070 | ||
1071 | trace_jbd_update_superblock_end(journal, wait); | ||
1068 | out: | 1072 | out: |
1069 | /* If we have just flushed the log (by marking s_start==0), then | 1073 | /* If we have just flushed the log (by marking s_start==0), then |
1070 | * any future commit will have to be careful to update the | 1074 | * any future commit will have to be careful to update the |