aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd/commit.c
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2011-05-23 12:33:02 -0400
committerJan Kara <jack@suse.cz>2011-06-25 11:29:51 -0400
commit99cb1a318c37bf462c53d43f4dacb7b4896ce0c9 (patch)
tree32a9046649777e8cc589bbc8e0afb382642ba450 /fs/jbd/commit.c
parent785c4bcc0d88ff006a0b2120815a71e86ecf21ce (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/jbd/commit.c')
-rw-r--r--fs/jbd/commit.c11
1 files changed, 11 insertions, 0 deletions
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