jbd2.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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 %d,%d result %d",
  21. MAJOR(__entry->dev), MINOR(__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 %d,%d transaction %d sync %d",
  37. MAJOR(__entry->dev), MINOR(__entry->dev),
  38. __entry->transaction, __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. DEFINE_EVENT(jbd2_commit, jbd2_drop_transaction,
  57. TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
  58. TP_ARGS(journal, commit_transaction)
  59. );
  60. TRACE_EVENT(jbd2_end_commit,
  61. TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
  62. TP_ARGS(journal, commit_transaction),
  63. TP_STRUCT__entry(
  64. __field( dev_t, dev )
  65. __field( char, sync_commit )
  66. __field( int, transaction )
  67. __field( int, head )
  68. ),
  69. TP_fast_assign(
  70. __entry->dev = journal->j_fs_dev->bd_dev;
  71. __entry->sync_commit = commit_transaction->t_synchronous_commit;
  72. __entry->transaction = commit_transaction->t_tid;
  73. __entry->head = journal->j_tail_sequence;
  74. ),
  75. TP_printk("dev %d,%d transaction %d sync %d head %d",
  76. MAJOR(__entry->dev), MINOR(__entry->dev),
  77. __entry->transaction, __entry->sync_commit, __entry->head)
  78. );
  79. TRACE_EVENT(jbd2_submit_inode_data,
  80. TP_PROTO(struct inode *inode),
  81. TP_ARGS(inode),
  82. TP_STRUCT__entry(
  83. __field( dev_t, dev )
  84. __field( ino_t, ino )
  85. ),
  86. TP_fast_assign(
  87. __entry->dev = inode->i_sb->s_dev;
  88. __entry->ino = inode->i_ino;
  89. ),
  90. TP_printk("dev %d,%d ino %lu",
  91. MAJOR(__entry->dev), MINOR(__entry->dev),
  92. (unsigned long) __entry->ino)
  93. );
  94. TRACE_EVENT(jbd2_handle_start,
  95. TP_PROTO(dev_t dev, unsigned long tid, unsigned int type,
  96. unsigned int line_no, int requested_blocks),
  97. TP_ARGS(dev, tid, type, line_no, requested_blocks),
  98. TP_STRUCT__entry(
  99. __field( dev_t, dev )
  100. __field( unsigned long, tid )
  101. __field( unsigned int, type )
  102. __field( unsigned int, line_no )
  103. __field( int, requested_blocks)
  104. ),
  105. TP_fast_assign(
  106. __entry->dev = dev;
  107. __entry->tid = tid;
  108. __entry->type = type;
  109. __entry->line_no = line_no;
  110. __entry->requested_blocks = requested_blocks;
  111. ),
  112. TP_printk("dev %d,%d tid %lu type %u line_no %u "
  113. "requested_blocks %d",
  114. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
  115. __entry->type, __entry->line_no, __entry->requested_blocks)
  116. );
  117. TRACE_EVENT(jbd2_handle_extend,
  118. TP_PROTO(dev_t dev, unsigned long tid, unsigned int type,
  119. unsigned int line_no, int buffer_credits,
  120. int requested_blocks),
  121. TP_ARGS(dev, tid, type, line_no, buffer_credits, requested_blocks),
  122. TP_STRUCT__entry(
  123. __field( dev_t, dev )
  124. __field( unsigned long, tid )
  125. __field( unsigned int, type )
  126. __field( unsigned int, line_no )
  127. __field( int, buffer_credits )
  128. __field( int, requested_blocks)
  129. ),
  130. TP_fast_assign(
  131. __entry->dev = dev;
  132. __entry->tid = tid;
  133. __entry->type = type;
  134. __entry->line_no = line_no;
  135. __entry->buffer_credits = buffer_credits;
  136. __entry->requested_blocks = requested_blocks;
  137. ),
  138. TP_printk("dev %d,%d tid %lu type %u line_no %u "
  139. "buffer_credits %d requested_blocks %d",
  140. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
  141. __entry->type, __entry->line_no, __entry->buffer_credits,
  142. __entry->requested_blocks)
  143. );
  144. TRACE_EVENT(jbd2_handle_stats,
  145. TP_PROTO(dev_t dev, unsigned long tid, unsigned int type,
  146. unsigned int line_no, int interval, int sync,
  147. int requested_blocks, int dirtied_blocks),
  148. TP_ARGS(dev, tid, type, line_no, interval, sync,
  149. requested_blocks, dirtied_blocks),
  150. TP_STRUCT__entry(
  151. __field( dev_t, dev )
  152. __field( unsigned long, tid )
  153. __field( unsigned int, type )
  154. __field( unsigned int, line_no )
  155. __field( int, interval )
  156. __field( int, sync )
  157. __field( int, requested_blocks)
  158. __field( int, dirtied_blocks )
  159. ),
  160. TP_fast_assign(
  161. __entry->dev = dev;
  162. __entry->tid = tid;
  163. __entry->type = type;
  164. __entry->line_no = line_no;
  165. __entry->interval = interval;
  166. __entry->sync = sync;
  167. __entry->requested_blocks = requested_blocks;
  168. __entry->dirtied_blocks = dirtied_blocks;
  169. ),
  170. TP_printk("dev %d,%d tid %lu type %u line_no %u interval %d "
  171. "sync %d requested_blocks %d dirtied_blocks %d",
  172. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
  173. __entry->type, __entry->line_no, __entry->interval,
  174. __entry->sync, __entry->requested_blocks,
  175. __entry->dirtied_blocks)
  176. );
  177. TRACE_EVENT(jbd2_run_stats,
  178. TP_PROTO(dev_t dev, unsigned long tid,
  179. struct transaction_run_stats_s *stats),
  180. TP_ARGS(dev, tid, stats),
  181. TP_STRUCT__entry(
  182. __field( dev_t, dev )
  183. __field( unsigned long, tid )
  184. __field( unsigned long, wait )
  185. __field( unsigned long, request_delay )
  186. __field( unsigned long, running )
  187. __field( unsigned long, locked )
  188. __field( unsigned long, flushing )
  189. __field( unsigned long, logging )
  190. __field( __u32, handle_count )
  191. __field( __u32, blocks )
  192. __field( __u32, blocks_logged )
  193. ),
  194. TP_fast_assign(
  195. __entry->dev = dev;
  196. __entry->tid = tid;
  197. __entry->wait = stats->rs_wait;
  198. __entry->request_delay = stats->rs_request_delay;
  199. __entry->running = stats->rs_running;
  200. __entry->locked = stats->rs_locked;
  201. __entry->flushing = stats->rs_flushing;
  202. __entry->logging = stats->rs_logging;
  203. __entry->handle_count = stats->rs_handle_count;
  204. __entry->blocks = stats->rs_blocks;
  205. __entry->blocks_logged = stats->rs_blocks_logged;
  206. ),
  207. TP_printk("dev %d,%d tid %lu wait %u request_delay %u running %u "
  208. "locked %u flushing %u logging %u handle_count %u "
  209. "blocks %u blocks_logged %u",
  210. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
  211. jiffies_to_msecs(__entry->wait),
  212. jiffies_to_msecs(__entry->request_delay),
  213. jiffies_to_msecs(__entry->running),
  214. jiffies_to_msecs(__entry->locked),
  215. jiffies_to_msecs(__entry->flushing),
  216. jiffies_to_msecs(__entry->logging),
  217. __entry->handle_count, __entry->blocks,
  218. __entry->blocks_logged)
  219. );
  220. TRACE_EVENT(jbd2_checkpoint_stats,
  221. TP_PROTO(dev_t dev, unsigned long tid,
  222. struct transaction_chp_stats_s *stats),
  223. TP_ARGS(dev, tid, stats),
  224. TP_STRUCT__entry(
  225. __field( dev_t, dev )
  226. __field( unsigned long, tid )
  227. __field( unsigned long, chp_time )
  228. __field( __u32, forced_to_close )
  229. __field( __u32, written )
  230. __field( __u32, dropped )
  231. ),
  232. TP_fast_assign(
  233. __entry->dev = dev;
  234. __entry->tid = tid;
  235. __entry->chp_time = stats->cs_chp_time;
  236. __entry->forced_to_close= stats->cs_forced_to_close;
  237. __entry->written = stats->cs_written;
  238. __entry->dropped = stats->cs_dropped;
  239. ),
  240. TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u "
  241. "written %u dropped %u",
  242. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
  243. jiffies_to_msecs(__entry->chp_time),
  244. __entry->forced_to_close, __entry->written, __entry->dropped)
  245. );
  246. TRACE_EVENT(jbd2_update_log_tail,
  247. TP_PROTO(journal_t *journal, tid_t first_tid,
  248. unsigned long block_nr, unsigned long freed),
  249. TP_ARGS(journal, first_tid, block_nr, freed),
  250. TP_STRUCT__entry(
  251. __field( dev_t, dev )
  252. __field( tid_t, tail_sequence )
  253. __field( tid_t, first_tid )
  254. __field(unsigned long, block_nr )
  255. __field(unsigned long, freed )
  256. ),
  257. TP_fast_assign(
  258. __entry->dev = journal->j_fs_dev->bd_dev;
  259. __entry->tail_sequence = journal->j_tail_sequence;
  260. __entry->first_tid = first_tid;
  261. __entry->block_nr = block_nr;
  262. __entry->freed = freed;
  263. ),
  264. TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
  265. MAJOR(__entry->dev), MINOR(__entry->dev),
  266. __entry->tail_sequence, __entry->first_tid,
  267. __entry->block_nr, __entry->freed)
  268. );
  269. TRACE_EVENT(jbd2_write_superblock,
  270. TP_PROTO(journal_t *journal, int write_op),
  271. TP_ARGS(journal, write_op),
  272. TP_STRUCT__entry(
  273. __field( dev_t, dev )
  274. __field( int, write_op )
  275. ),
  276. TP_fast_assign(
  277. __entry->dev = journal->j_fs_dev->bd_dev;
  278. __entry->write_op = write_op;
  279. ),
  280. TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev),
  281. MINOR(__entry->dev), __entry->write_op)
  282. );
  283. TRACE_EVENT(jbd2_lock_buffer_stall,
  284. TP_PROTO(dev_t dev, unsigned long stall_ms),
  285. TP_ARGS(dev, stall_ms),
  286. TP_STRUCT__entry(
  287. __field( dev_t, dev )
  288. __field(unsigned long, stall_ms )
  289. ),
  290. TP_fast_assign(
  291. __entry->dev = dev;
  292. __entry->stall_ms = stall_ms;
  293. ),
  294. TP_printk("dev %d,%d stall_ms %lu",
  295. MAJOR(__entry->dev), MINOR(__entry->dev),
  296. __entry->stall_ms)
  297. );
  298. #endif /* _TRACE_JBD2_H */
  299. /* This part must be outside protection */
  300. #include <trace/define_trace.h>