jbd2.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM jbd2
  3. #if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_JBD2_H
  5. #include <linux/jbd2.h>
  6. #include <linux/tracepoint.h>
  7. struct transaction_chp_stats_s;
  8. struct transaction_run_stats_s;
  9. TRACE_EVENT(jbd2_checkpoint,
  10. TP_PROTO(journal_t *journal, int result),
  11. TP_ARGS(journal, result),
  12. TP_STRUCT__entry(
  13. __field( dev_t, dev )
  14. __field( int, result )
  15. ),
  16. TP_fast_assign(
  17. __entry->dev = journal->j_fs_dev->bd_dev;
  18. __entry->result = result;
  19. ),
  20. TP_printk("dev %s result %d",
  21. jbd2_dev_to_name(__entry->dev), __entry->result)
  22. );
  23. DECLARE_EVENT_CLASS(jbd2_commit,
  24. TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
  25. TP_ARGS(journal, commit_transaction),
  26. TP_STRUCT__entry(
  27. __field( dev_t, dev )
  28. __field( char, sync_commit )
  29. __field( int, transaction )
  30. ),
  31. TP_fast_assign(
  32. __entry->dev = journal->j_fs_dev->bd_dev;
  33. __entry->sync_commit = commit_transaction->t_synchronous_commit;
  34. __entry->transaction = commit_transaction->t_tid;
  35. ),
  36. TP_printk("dev %s transaction %d sync %d",
  37. jbd2_dev_to_name(__entry->dev), __entry->transaction,
  38. __entry->sync_commit)
  39. );
  40. DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
  41. TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
  42. TP_ARGS(journal, commit_transaction)
  43. );
  44. DEFINE_EVENT(jbd2_commit, jbd2_commit_locking,
  45. TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
  46. TP_ARGS(journal, commit_transaction)
  47. );
  48. DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing,
  49. TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
  50. TP_ARGS(journal, commit_transaction)
  51. );
  52. DEFINE_EVENT(jbd2_commit, jbd2_commit_logging,
  53. TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
  54. TP_ARGS(journal, commit_transaction)
  55. );
  56. TRACE_EVENT(jbd2_end_commit,
  57. TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
  58. TP_ARGS(journal, commit_transaction),
  59. TP_STRUCT__entry(
  60. __field( dev_t, dev )
  61. __field( char, sync_commit )
  62. __field( int, transaction )
  63. __field( int, head )
  64. ),
  65. TP_fast_assign(
  66. __entry->dev = journal->j_fs_dev->bd_dev;
  67. __entry->sync_commit = commit_transaction->t_synchronous_commit;
  68. __entry->transaction = commit_transaction->t_tid;
  69. __entry->head = journal->j_tail_sequence;
  70. ),
  71. TP_printk("dev %s transaction %d sync %d head %d",
  72. jbd2_dev_to_name(__entry->dev), __entry->transaction,
  73. __entry->sync_commit, __entry->head)
  74. );
  75. TRACE_EVENT(jbd2_submit_inode_data,
  76. TP_PROTO(struct inode *inode),
  77. TP_ARGS(inode),
  78. TP_STRUCT__entry(
  79. __field( dev_t, dev )
  80. __field( ino_t, ino )
  81. ),
  82. TP_fast_assign(
  83. __entry->dev = inode->i_sb->s_dev;
  84. __entry->ino = inode->i_ino;
  85. ),
  86. TP_printk("dev %s ino %lu",
  87. jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino)
  88. );
  89. TRACE_EVENT(jbd2_run_stats,
  90. TP_PROTO(dev_t dev, unsigned long tid,
  91. struct transaction_run_stats_s *stats),
  92. TP_ARGS(dev, tid, stats),
  93. TP_STRUCT__entry(
  94. __field( dev_t, dev )
  95. __field( unsigned long, tid )
  96. __field( unsigned long, wait )
  97. __field( unsigned long, running )
  98. __field( unsigned long, locked )
  99. __field( unsigned long, flushing )
  100. __field( unsigned long, logging )
  101. __field( __u32, handle_count )
  102. __field( __u32, blocks )
  103. __field( __u32, blocks_logged )
  104. ),
  105. TP_fast_assign(
  106. __entry->dev = dev;
  107. __entry->tid = tid;
  108. __entry->wait = stats->rs_wait;
  109. __entry->running = stats->rs_running;
  110. __entry->locked = stats->rs_locked;
  111. __entry->flushing = stats->rs_flushing;
  112. __entry->logging = stats->rs_logging;
  113. __entry->handle_count = stats->rs_handle_count;
  114. __entry->blocks = stats->rs_blocks;
  115. __entry->blocks_logged = stats->rs_blocks_logged;
  116. ),
  117. TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u "
  118. "logging %u handle_count %u blocks %u blocks_logged %u",
  119. jbd2_dev_to_name(__entry->dev), __entry->tid,
  120. jiffies_to_msecs(__entry->wait),
  121. jiffies_to_msecs(__entry->running),
  122. jiffies_to_msecs(__entry->locked),
  123. jiffies_to_msecs(__entry->flushing),
  124. jiffies_to_msecs(__entry->logging),
  125. __entry->handle_count, __entry->blocks,
  126. __entry->blocks_logged)
  127. );
  128. TRACE_EVENT(jbd2_checkpoint_stats,
  129. TP_PROTO(dev_t dev, unsigned long tid,
  130. struct transaction_chp_stats_s *stats),
  131. TP_ARGS(dev, tid, stats),
  132. TP_STRUCT__entry(
  133. __field( dev_t, dev )
  134. __field( unsigned long, tid )
  135. __field( unsigned long, chp_time )
  136. __field( __u32, forced_to_close )
  137. __field( __u32, written )
  138. __field( __u32, dropped )
  139. ),
  140. TP_fast_assign(
  141. __entry->dev = dev;
  142. __entry->tid = tid;
  143. __entry->chp_time = stats->cs_chp_time;
  144. __entry->forced_to_close= stats->cs_forced_to_close;
  145. __entry->written = stats->cs_written;
  146. __entry->dropped = stats->cs_dropped;
  147. ),
  148. TP_printk("dev %s tid %lu chp_time %u forced_to_close %u "
  149. "written %u dropped %u",
  150. jbd2_dev_to_name(__entry->dev), __entry->tid,
  151. jiffies_to_msecs(__entry->chp_time),
  152. __entry->forced_to_close, __entry->written, __entry->dropped)
  153. );
  154. TRACE_EVENT(jbd2_cleanup_journal_tail,
  155. TP_PROTO(journal_t *journal, tid_t first_tid,
  156. unsigned long block_nr, unsigned long freed),
  157. TP_ARGS(journal, first_tid, block_nr, freed),
  158. TP_STRUCT__entry(
  159. __field( dev_t, dev )
  160. __field( tid_t, tail_sequence )
  161. __field( tid_t, first_tid )
  162. __field(unsigned long, block_nr )
  163. __field(unsigned long, freed )
  164. ),
  165. TP_fast_assign(
  166. __entry->dev = journal->j_fs_dev->bd_dev;
  167. __entry->tail_sequence = journal->j_tail_sequence;
  168. __entry->first_tid = first_tid;
  169. __entry->block_nr = block_nr;
  170. __entry->freed = freed;
  171. ),
  172. TP_printk("dev %s from %u to %u offset %lu freed %lu",
  173. jbd2_dev_to_name(__entry->dev), __entry->tail_sequence,
  174. __entry->first_tid, __entry->block_nr, __entry->freed)
  175. );
  176. #endif /* _TRACE_JBD2_H */
  177. /* This part must be outside protection */
  178. #include <trace/define_trace.h>