diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-02-06 22:30:23 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-02-06 22:30:23 -0500 |
commit | 9fff24aa2c5c504aadead1ff9599e813604c2e53 (patch) | |
tree | 24bbb1691ec816aed648a895882526ce361ec92f /include | |
parent | 40ae3487628235e5f1eb27542cca0cdb6e5dbe16 (diff) |
jbd2: track request delay statistics
Track the delay between when we first request that the commit begin
and when it actually begins, so we can see how much of a gap exists.
In theory, this should just be the remaining scheduling quantuum of
the thread which requested the commit (assuming it was not a
synchronous operation which triggered the commit request) plus
scheduling overhead; however, it's possible that real time processes
might get in the way of letting the kjournald thread from executing.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/jbd2.h | 7 | ||||
-rw-r--r-- | include/trace/events/jbd2.h | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index e30b66346942..e0aafc46064f 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -581,6 +581,11 @@ struct transaction_s | |||
581 | unsigned long t_start; | 581 | unsigned long t_start; |
582 | 582 | ||
583 | /* | 583 | /* |
584 | * When commit was requested | ||
585 | */ | ||
586 | unsigned long t_requested; | ||
587 | |||
588 | /* | ||
584 | * Checkpointing stats [j_checkpoint_sem] | 589 | * Checkpointing stats [j_checkpoint_sem] |
585 | */ | 590 | */ |
586 | struct transaction_chp_stats_s t_chp_stats; | 591 | struct transaction_chp_stats_s t_chp_stats; |
@@ -637,6 +642,7 @@ struct transaction_s | |||
637 | 642 | ||
638 | struct transaction_run_stats_s { | 643 | struct transaction_run_stats_s { |
639 | unsigned long rs_wait; | 644 | unsigned long rs_wait; |
645 | unsigned long rs_request_delay; | ||
640 | unsigned long rs_running; | 646 | unsigned long rs_running; |
641 | unsigned long rs_locked; | 647 | unsigned long rs_locked; |
642 | unsigned long rs_flushing; | 648 | unsigned long rs_flushing; |
@@ -649,6 +655,7 @@ struct transaction_run_stats_s { | |||
649 | 655 | ||
650 | struct transaction_stats_s { | 656 | struct transaction_stats_s { |
651 | unsigned long ts_tid; | 657 | unsigned long ts_tid; |
658 | unsigned long ts_requested; | ||
652 | struct transaction_run_stats_s run; | 659 | struct transaction_run_stats_s run; |
653 | }; | 660 | }; |
654 | 661 | ||
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h index 127993dbf322..5419f57beb1f 100644 --- a/include/trace/events/jbd2.h +++ b/include/trace/events/jbd2.h | |||
@@ -142,6 +142,7 @@ TRACE_EVENT(jbd2_run_stats, | |||
142 | __field( dev_t, dev ) | 142 | __field( dev_t, dev ) |
143 | __field( unsigned long, tid ) | 143 | __field( unsigned long, tid ) |
144 | __field( unsigned long, wait ) | 144 | __field( unsigned long, wait ) |
145 | __field( unsigned long, request_delay ) | ||
145 | __field( unsigned long, running ) | 146 | __field( unsigned long, running ) |
146 | __field( unsigned long, locked ) | 147 | __field( unsigned long, locked ) |
147 | __field( unsigned long, flushing ) | 148 | __field( unsigned long, flushing ) |
@@ -155,6 +156,7 @@ TRACE_EVENT(jbd2_run_stats, | |||
155 | __entry->dev = dev; | 156 | __entry->dev = dev; |
156 | __entry->tid = tid; | 157 | __entry->tid = tid; |
157 | __entry->wait = stats->rs_wait; | 158 | __entry->wait = stats->rs_wait; |
159 | __entry->request_delay = stats->rs_request_delay; | ||
158 | __entry->running = stats->rs_running; | 160 | __entry->running = stats->rs_running; |
159 | __entry->locked = stats->rs_locked; | 161 | __entry->locked = stats->rs_locked; |
160 | __entry->flushing = stats->rs_flushing; | 162 | __entry->flushing = stats->rs_flushing; |
@@ -164,10 +166,12 @@ TRACE_EVENT(jbd2_run_stats, | |||
164 | __entry->blocks_logged = stats->rs_blocks_logged; | 166 | __entry->blocks_logged = stats->rs_blocks_logged; |
165 | ), | 167 | ), |
166 | 168 | ||
167 | TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u " | 169 | TP_printk("dev %d,%d tid %lu wait %u request_delay %u running %u " |
168 | "logging %u handle_count %u blocks %u blocks_logged %u", | 170 | "locked %u flushing %u logging %u handle_count %u " |
171 | "blocks %u blocks_logged %u", | ||
169 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | 172 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
170 | jiffies_to_msecs(__entry->wait), | 173 | jiffies_to_msecs(__entry->wait), |
174 | jiffies_to_msecs(__entry->request_delay), | ||
171 | jiffies_to_msecs(__entry->running), | 175 | jiffies_to_msecs(__entry->running), |
172 | jiffies_to_msecs(__entry->locked), | 176 | jiffies_to_msecs(__entry->locked), |
173 | jiffies_to_msecs(__entry->flushing), | 177 | jiffies_to_msecs(__entry->flushing), |