nilfs2.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM nilfs2
  3. #if !defined(_TRACE_NILFS2_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_NILFS2_H
  5. #include <linux/tracepoint.h>
  6. struct nilfs_sc_info;
  7. #define show_collection_stage(type) \
  8. __print_symbolic(type, \
  9. { NILFS_ST_INIT, "ST_INIT" }, \
  10. { NILFS_ST_GC, "ST_GC" }, \
  11. { NILFS_ST_FILE, "ST_FILE" }, \
  12. { NILFS_ST_IFILE, "ST_IFILE" }, \
  13. { NILFS_ST_CPFILE, "ST_CPFILE" }, \
  14. { NILFS_ST_SUFILE, "ST_SUFILE" }, \
  15. { NILFS_ST_DAT, "ST_DAT" }, \
  16. { NILFS_ST_SR, "ST_SR" }, \
  17. { NILFS_ST_DSYNC, "ST_DSYNC" }, \
  18. { NILFS_ST_DONE, "ST_DONE"})
  19. TRACE_EVENT(nilfs2_collection_stage_transition,
  20. TP_PROTO(struct nilfs_sc_info *sci),
  21. TP_ARGS(sci),
  22. TP_STRUCT__entry(
  23. __field(void *, sci)
  24. __field(int, stage)
  25. ),
  26. TP_fast_assign(
  27. __entry->sci = sci;
  28. __entry->stage = sci->sc_stage.scnt;
  29. ),
  30. TP_printk("sci = %p stage = %s",
  31. __entry->sci,
  32. show_collection_stage(__entry->stage))
  33. );
  34. #ifndef TRACE_HEADER_MULTI_READ
  35. enum nilfs2_transaction_transition_state {
  36. TRACE_NILFS2_TRANSACTION_BEGIN,
  37. TRACE_NILFS2_TRANSACTION_COMMIT,
  38. TRACE_NILFS2_TRANSACTION_ABORT,
  39. TRACE_NILFS2_TRANSACTION_TRYLOCK,
  40. TRACE_NILFS2_TRANSACTION_LOCK,
  41. TRACE_NILFS2_TRANSACTION_UNLOCK,
  42. };
  43. #endif
  44. #define show_transaction_state(type) \
  45. __print_symbolic(type, \
  46. { TRACE_NILFS2_TRANSACTION_BEGIN, "BEGIN" }, \
  47. { TRACE_NILFS2_TRANSACTION_COMMIT, "COMMIT" }, \
  48. { TRACE_NILFS2_TRANSACTION_ABORT, "ABORT" }, \
  49. { TRACE_NILFS2_TRANSACTION_TRYLOCK, "TRYLOCK" }, \
  50. { TRACE_NILFS2_TRANSACTION_LOCK, "LOCK" }, \
  51. { TRACE_NILFS2_TRANSACTION_UNLOCK, "UNLOCK" })
  52. TRACE_EVENT(nilfs2_transaction_transition,
  53. TP_PROTO(struct super_block *sb,
  54. struct nilfs_transaction_info *ti,
  55. int count,
  56. unsigned int flags,
  57. enum nilfs2_transaction_transition_state state),
  58. TP_ARGS(sb, ti, count, flags, state),
  59. TP_STRUCT__entry(
  60. __field(void *, sb)
  61. __field(void *, ti)
  62. __field(int, count)
  63. __field(unsigned int, flags)
  64. __field(int, state)
  65. ),
  66. TP_fast_assign(
  67. __entry->sb = sb;
  68. __entry->ti = ti;
  69. __entry->count = count;
  70. __entry->flags = flags;
  71. __entry->state = state;
  72. ),
  73. TP_printk("sb = %p ti = %p count = %d flags = %x state = %s",
  74. __entry->sb,
  75. __entry->ti,
  76. __entry->count,
  77. __entry->flags,
  78. show_transaction_state(__entry->state))
  79. );
  80. TRACE_EVENT(nilfs2_segment_usage_check,
  81. TP_PROTO(struct inode *sufile,
  82. __u64 segnum,
  83. unsigned long cnt),
  84. TP_ARGS(sufile, segnum, cnt),
  85. TP_STRUCT__entry(
  86. __field(struct inode *, sufile)
  87. __field(__u64, segnum)
  88. __field(unsigned long, cnt)
  89. ),
  90. TP_fast_assign(
  91. __entry->sufile = sufile;
  92. __entry->segnum = segnum;
  93. __entry->cnt = cnt;
  94. ),
  95. TP_printk("sufile = %p segnum = %llu cnt = %lu",
  96. __entry->sufile,
  97. __entry->segnum,
  98. __entry->cnt)
  99. );
  100. TRACE_EVENT(nilfs2_segment_usage_allocated,
  101. TP_PROTO(struct inode *sufile,
  102. __u64 segnum),
  103. TP_ARGS(sufile, segnum),
  104. TP_STRUCT__entry(
  105. __field(struct inode *, sufile)
  106. __field(__u64, segnum)
  107. ),
  108. TP_fast_assign(
  109. __entry->sufile = sufile;
  110. __entry->segnum = segnum;
  111. ),
  112. TP_printk("sufile = %p segnum = %llu",
  113. __entry->sufile,
  114. __entry->segnum)
  115. );
  116. TRACE_EVENT(nilfs2_segment_usage_freed,
  117. TP_PROTO(struct inode *sufile,
  118. __u64 segnum),
  119. TP_ARGS(sufile, segnum),
  120. TP_STRUCT__entry(
  121. __field(struct inode *, sufile)
  122. __field(__u64, segnum)
  123. ),
  124. TP_fast_assign(
  125. __entry->sufile = sufile;
  126. __entry->segnum = segnum;
  127. ),
  128. TP_printk("sufile = %p segnum = %llu",
  129. __entry->sufile,
  130. __entry->segnum)
  131. );
  132. TRACE_EVENT(nilfs2_mdt_insert_new_block,
  133. TP_PROTO(struct inode *inode,
  134. unsigned long ino,
  135. unsigned long block),
  136. TP_ARGS(inode, ino, block),
  137. TP_STRUCT__entry(
  138. __field(struct inode *, inode)
  139. __field(unsigned long, ino)
  140. __field(unsigned long, block)
  141. ),
  142. TP_fast_assign(
  143. __entry->inode = inode;
  144. __entry->ino = ino;
  145. __entry->block = block;
  146. ),
  147. TP_printk("inode = %p ino = %lu block = %lu",
  148. __entry->inode,
  149. __entry->ino,
  150. __entry->block)
  151. );
  152. TRACE_EVENT(nilfs2_mdt_submit_block,
  153. TP_PROTO(struct inode *inode,
  154. unsigned long ino,
  155. unsigned long blkoff,
  156. int mode),
  157. TP_ARGS(inode, ino, blkoff, mode),
  158. TP_STRUCT__entry(
  159. __field(struct inode *, inode)
  160. __field(unsigned long, ino)
  161. __field(unsigned long, blkoff)
  162. __field(int, mode)
  163. ),
  164. TP_fast_assign(
  165. __entry->inode = inode;
  166. __entry->ino = ino;
  167. __entry->blkoff = blkoff;
  168. __entry->mode = mode;
  169. ),
  170. TP_printk("inode = %p ino = %lu blkoff = %lu mode = %x",
  171. __entry->inode,
  172. __entry->ino,
  173. __entry->blkoff,
  174. __entry->mode)
  175. );
  176. #endif /* _TRACE_NILFS2_H */
  177. /* This part must be outside protection */
  178. #undef TRACE_INCLUDE_FILE
  179. #define TRACE_INCLUDE_FILE nilfs2
  180. #include <trace/define_trace.h>