aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/jbd2.h27
-rw-r--r--include/trace/events/ext4.h178
-rw-r--r--include/trace/events/jbd2.h78
3 files changed, 259 insertions, 24 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 52695d3dfd0b..f1011f7f3d41 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -464,9 +464,9 @@ struct handle_s
464 */ 464 */
465struct transaction_chp_stats_s { 465struct transaction_chp_stats_s {
466 unsigned long cs_chp_time; 466 unsigned long cs_chp_time;
467 unsigned long cs_forced_to_close; 467 __u32 cs_forced_to_close;
468 unsigned long cs_written; 468 __u32 cs_written;
469 unsigned long cs_dropped; 469 __u32 cs_dropped;
470}; 470};
471 471
472/* The transaction_t type is the guts of the journaling mechanism. It 472/* The transaction_t type is the guts of the journaling mechanism. It
@@ -668,23 +668,16 @@ struct transaction_run_stats_s {
668 unsigned long rs_flushing; 668 unsigned long rs_flushing;
669 unsigned long rs_logging; 669 unsigned long rs_logging;
670 670
671 unsigned long rs_handle_count; 671 __u32 rs_handle_count;
672 unsigned long rs_blocks; 672 __u32 rs_blocks;
673 unsigned long rs_blocks_logged; 673 __u32 rs_blocks_logged;
674}; 674};
675 675
676struct transaction_stats_s { 676struct transaction_stats_s {
677 int ts_type;
678 unsigned long ts_tid; 677 unsigned long ts_tid;
679 union { 678 struct transaction_run_stats_s run;
680 struct transaction_run_stats_s run;
681 struct transaction_chp_stats_s chp;
682 } u;
683}; 679};
684 680
685#define JBD2_STATS_RUN 1
686#define JBD2_STATS_CHECKPOINT 2
687
688static inline unsigned long 681static inline unsigned long
689jbd2_time_diff(unsigned long start, unsigned long end) 682jbd2_time_diff(unsigned long start, unsigned long end)
690{ 683{
@@ -988,12 +981,6 @@ struct journal_s
988 /* 981 /*
989 * Journal statistics 982 * Journal statistics
990 */ 983 */
991 struct transaction_stats_s *j_history;
992 int j_history_max;
993 int j_history_cur;
994 /*
995 * Protect the transactions statistics history
996 */
997 spinlock_t j_history_lock; 984 spinlock_t j_history_lock;
998 struct proc_dir_entry *j_proc_entry; 985 struct proc_dir_entry *j_proc_entry;
999 struct transaction_stats_s j_stats; 986 struct transaction_stats_s j_stats;
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index c1bd8f1e8b94..d09550bf3f95 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -11,6 +11,7 @@ struct ext4_allocation_context;
11struct ext4_allocation_request; 11struct ext4_allocation_request;
12struct ext4_prealloc_space; 12struct ext4_prealloc_space;
13struct ext4_inode_info; 13struct ext4_inode_info;
14struct mpage_da_data;
14 15
15#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) 16#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
16 17
@@ -236,6 +237,7 @@ TRACE_EVENT(ext4_da_writepages,
236 __field( char, for_kupdate ) 237 __field( char, for_kupdate )
237 __field( char, for_reclaim ) 238 __field( char, for_reclaim )
238 __field( char, range_cyclic ) 239 __field( char, range_cyclic )
240 __field( pgoff_t, writeback_index )
239 ), 241 ),
240 242
241 TP_fast_assign( 243 TP_fast_assign(
@@ -249,15 +251,17 @@ TRACE_EVENT(ext4_da_writepages,
249 __entry->for_kupdate = wbc->for_kupdate; 251 __entry->for_kupdate = wbc->for_kupdate;
250 __entry->for_reclaim = wbc->for_reclaim; 252 __entry->for_reclaim = wbc->for_reclaim;
251 __entry->range_cyclic = wbc->range_cyclic; 253 __entry->range_cyclic = wbc->range_cyclic;
254 __entry->writeback_index = inode->i_mapping->writeback_index;
252 ), 255 ),
253 256
254 TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d", 257 TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d writeback_index %lu",
255 jbd2_dev_to_name(__entry->dev), 258 jbd2_dev_to_name(__entry->dev),
256 (unsigned long) __entry->ino, __entry->nr_to_write, 259 (unsigned long) __entry->ino, __entry->nr_to_write,
257 __entry->pages_skipped, __entry->range_start, 260 __entry->pages_skipped, __entry->range_start,
258 __entry->range_end, __entry->nonblocking, 261 __entry->range_end, __entry->nonblocking,
259 __entry->for_kupdate, __entry->for_reclaim, 262 __entry->for_kupdate, __entry->for_reclaim,
260 __entry->range_cyclic) 263 __entry->range_cyclic,
264 (unsigned long) __entry->writeback_index)
261); 265);
262 266
263TRACE_EVENT(ext4_da_write_pages, 267TRACE_EVENT(ext4_da_write_pages,
@@ -309,6 +313,7 @@ TRACE_EVENT(ext4_da_writepages_result,
309 __field( char, encountered_congestion ) 313 __field( char, encountered_congestion )
310 __field( char, more_io ) 314 __field( char, more_io )
311 __field( char, no_nrwrite_index_update ) 315 __field( char, no_nrwrite_index_update )
316 __field( pgoff_t, writeback_index )
312 ), 317 ),
313 318
314 TP_fast_assign( 319 TP_fast_assign(
@@ -320,14 +325,16 @@ TRACE_EVENT(ext4_da_writepages_result,
320 __entry->encountered_congestion = wbc->encountered_congestion; 325 __entry->encountered_congestion = wbc->encountered_congestion;
321 __entry->more_io = wbc->more_io; 326 __entry->more_io = wbc->more_io;
322 __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update; 327 __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update;
328 __entry->writeback_index = inode->i_mapping->writeback_index;
323 ), 329 ),
324 330
325 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d", 331 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d writeback_index %lu",
326 jbd2_dev_to_name(__entry->dev), 332 jbd2_dev_to_name(__entry->dev),
327 (unsigned long) __entry->ino, __entry->ret, 333 (unsigned long) __entry->ino, __entry->ret,
328 __entry->pages_written, __entry->pages_skipped, 334 __entry->pages_written, __entry->pages_skipped,
329 __entry->encountered_congestion, __entry->more_io, 335 __entry->encountered_congestion, __entry->more_io,
330 __entry->no_nrwrite_index_update) 336 __entry->no_nrwrite_index_update,
337 (unsigned long) __entry->writeback_index)
331); 338);
332 339
333TRACE_EVENT(ext4_da_write_begin, 340TRACE_EVENT(ext4_da_write_begin,
@@ -737,6 +744,169 @@ TRACE_EVENT(ext4_alloc_da_blocks,
737 __entry->data_blocks, __entry->meta_blocks) 744 __entry->data_blocks, __entry->meta_blocks)
738); 745);
739 746
747TRACE_EVENT(ext4_mballoc_alloc,
748 TP_PROTO(struct ext4_allocation_context *ac),
749
750 TP_ARGS(ac),
751
752 TP_STRUCT__entry(
753 __field( dev_t, dev )
754 __field( ino_t, ino )
755 __field( __u16, found )
756 __field( __u16, groups )
757 __field( __u16, buddy )
758 __field( __u16, flags )
759 __field( __u16, tail )
760 __field( __u8, cr )
761 __field( __u32, orig_logical )
762 __field( int, orig_start )
763 __field( __u32, orig_group )
764 __field( int, orig_len )
765 __field( __u32, goal_logical )
766 __field( int, goal_start )
767 __field( __u32, goal_group )
768 __field( int, goal_len )
769 __field( __u32, result_logical )
770 __field( int, result_start )
771 __field( __u32, result_group )
772 __field( int, result_len )
773 ),
774
775 TP_fast_assign(
776 __entry->dev = ac->ac_inode->i_sb->s_dev;
777 __entry->ino = ac->ac_inode->i_ino;
778 __entry->found = ac->ac_found;
779 __entry->flags = ac->ac_flags;
780 __entry->groups = ac->ac_groups_scanned;
781 __entry->buddy = ac->ac_buddy;
782 __entry->tail = ac->ac_tail;
783 __entry->cr = ac->ac_criteria;
784 __entry->orig_logical = ac->ac_o_ex.fe_logical;
785 __entry->orig_start = ac->ac_o_ex.fe_start;
786 __entry->orig_group = ac->ac_o_ex.fe_group;
787 __entry->orig_len = ac->ac_o_ex.fe_len;
788 __entry->goal_logical = ac->ac_g_ex.fe_logical;
789 __entry->goal_start = ac->ac_g_ex.fe_start;
790 __entry->goal_group = ac->ac_g_ex.fe_group;
791 __entry->goal_len = ac->ac_g_ex.fe_len;
792 __entry->result_logical = ac->ac_f_ex.fe_logical;
793 __entry->result_start = ac->ac_f_ex.fe_start;
794 __entry->result_group = ac->ac_f_ex.fe_group;
795 __entry->result_len = ac->ac_f_ex.fe_len;
796 ),
797
798 TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
799 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
800 "tail %u broken %u",
801 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
802 __entry->orig_group, __entry->orig_start,
803 __entry->orig_len, __entry->orig_logical,
804 __entry->goal_group, __entry->goal_start,
805 __entry->goal_len, __entry->goal_logical,
806 __entry->result_group, __entry->result_start,
807 __entry->result_len, __entry->result_logical,
808 __entry->found, __entry->groups, __entry->cr,
809 __entry->flags, __entry->tail,
810 __entry->buddy ? 1 << __entry->buddy : 0)
811);
812
813TRACE_EVENT(ext4_mballoc_prealloc,
814 TP_PROTO(struct ext4_allocation_context *ac),
815
816 TP_ARGS(ac),
817
818 TP_STRUCT__entry(
819 __field( dev_t, dev )
820 __field( ino_t, ino )
821 __field( __u32, orig_logical )
822 __field( int, orig_start )
823 __field( __u32, orig_group )
824 __field( int, orig_len )
825 __field( __u32, result_logical )
826 __field( int, result_start )
827 __field( __u32, result_group )
828 __field( int, result_len )
829 ),
830
831 TP_fast_assign(
832 __entry->dev = ac->ac_inode->i_sb->s_dev;
833 __entry->ino = ac->ac_inode->i_ino;
834 __entry->orig_logical = ac->ac_o_ex.fe_logical;
835 __entry->orig_start = ac->ac_o_ex.fe_start;
836 __entry->orig_group = ac->ac_o_ex.fe_group;
837 __entry->orig_len = ac->ac_o_ex.fe_len;
838 __entry->result_logical = ac->ac_b_ex.fe_logical;
839 __entry->result_start = ac->ac_b_ex.fe_start;
840 __entry->result_group = ac->ac_b_ex.fe_group;
841 __entry->result_len = ac->ac_b_ex.fe_len;
842 ),
843
844 TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
845 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
846 __entry->orig_group, __entry->orig_start,
847 __entry->orig_len, __entry->orig_logical,
848 __entry->result_group, __entry->result_start,
849 __entry->result_len, __entry->result_logical)
850);
851
852TRACE_EVENT(ext4_mballoc_discard,
853 TP_PROTO(struct ext4_allocation_context *ac),
854
855 TP_ARGS(ac),
856
857 TP_STRUCT__entry(
858 __field( dev_t, dev )
859 __field( ino_t, ino )
860 __field( __u32, result_logical )
861 __field( int, result_start )
862 __field( __u32, result_group )
863 __field( int, result_len )
864 ),
865
866 TP_fast_assign(
867 __entry->dev = ac->ac_inode->i_sb->s_dev;
868 __entry->ino = ac->ac_inode->i_ino;
869 __entry->result_logical = ac->ac_b_ex.fe_logical;
870 __entry->result_start = ac->ac_b_ex.fe_start;
871 __entry->result_group = ac->ac_b_ex.fe_group;
872 __entry->result_len = ac->ac_b_ex.fe_len;
873 ),
874
875 TP_printk("dev %s inode %lu extent %u/%d/%u@%u ",
876 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
877 __entry->result_group, __entry->result_start,
878 __entry->result_len, __entry->result_logical)
879);
880
881TRACE_EVENT(ext4_mballoc_free,
882 TP_PROTO(struct ext4_allocation_context *ac),
883
884 TP_ARGS(ac),
885
886 TP_STRUCT__entry(
887 __field( dev_t, dev )
888 __field( ino_t, ino )
889 __field( __u32, result_logical )
890 __field( int, result_start )
891 __field( __u32, result_group )
892 __field( int, result_len )
893 ),
894
895 TP_fast_assign(
896 __entry->dev = ac->ac_inode->i_sb->s_dev;
897 __entry->ino = ac->ac_inode->i_ino;
898 __entry->result_logical = ac->ac_b_ex.fe_logical;
899 __entry->result_start = ac->ac_b_ex.fe_start;
900 __entry->result_group = ac->ac_b_ex.fe_group;
901 __entry->result_len = ac->ac_b_ex.fe_len;
902 ),
903
904 TP_printk("dev %s inode %lu extent %u/%d/%u@%u ",
905 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
906 __entry->result_group, __entry->result_start,
907 __entry->result_len, __entry->result_logical)
908);
909
740#endif /* _TRACE_EXT4_H */ 910#endif /* _TRACE_EXT4_H */
741 911
742/* This part must be outside protection */ 912/* This part must be outside protection */
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
10struct transaction_chp_stats_s;
11struct transaction_run_stats_s;
12
10TRACE_EVENT(jbd2_checkpoint, 13TRACE_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
168TRACE_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
212TRACE_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 */