ext4.h 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM ext4
  3. #if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_EXT4_H
  5. #include <linux/writeback.h>
  6. #include <linux/tracepoint.h>
  7. struct ext4_allocation_context;
  8. struct ext4_allocation_request;
  9. struct ext4_extent;
  10. struct ext4_prealloc_space;
  11. struct ext4_inode_info;
  12. struct mpage_da_data;
  13. struct ext4_map_blocks;
  14. struct extent_status;
  15. #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
  16. #define show_mballoc_flags(flags) __print_flags(flags, "|", \
  17. { EXT4_MB_HINT_MERGE, "HINT_MERGE" }, \
  18. { EXT4_MB_HINT_RESERVED, "HINT_RESV" }, \
  19. { EXT4_MB_HINT_METADATA, "HINT_MDATA" }, \
  20. { EXT4_MB_HINT_FIRST, "HINT_FIRST" }, \
  21. { EXT4_MB_HINT_BEST, "HINT_BEST" }, \
  22. { EXT4_MB_HINT_DATA, "HINT_DATA" }, \
  23. { EXT4_MB_HINT_NOPREALLOC, "HINT_NOPREALLOC" }, \
  24. { EXT4_MB_HINT_GROUP_ALLOC, "HINT_GRP_ALLOC" }, \
  25. { EXT4_MB_HINT_GOAL_ONLY, "HINT_GOAL_ONLY" }, \
  26. { EXT4_MB_HINT_TRY_GOAL, "HINT_TRY_GOAL" }, \
  27. { EXT4_MB_DELALLOC_RESERVED, "DELALLOC_RESV" }, \
  28. { EXT4_MB_STREAM_ALLOC, "STREAM_ALLOC" }, \
  29. { EXT4_MB_USE_ROOT_BLOCKS, "USE_ROOT_BLKS" }, \
  30. { EXT4_MB_USE_RESERVED, "USE_RESV" })
  31. #define show_map_flags(flags) __print_flags(flags, "|", \
  32. { EXT4_GET_BLOCKS_CREATE, "CREATE" }, \
  33. { EXT4_GET_BLOCKS_UNINIT_EXT, "UNINIT" }, \
  34. { EXT4_GET_BLOCKS_DELALLOC_RESERVE, "DELALLOC" }, \
  35. { EXT4_GET_BLOCKS_PRE_IO, "PRE_IO" }, \
  36. { EXT4_GET_BLOCKS_CONVERT, "CONVERT" }, \
  37. { EXT4_GET_BLOCKS_METADATA_NOFAIL, "METADATA_NOFAIL" }, \
  38. { EXT4_GET_BLOCKS_NO_NORMALIZE, "NO_NORMALIZE" }, \
  39. { EXT4_GET_BLOCKS_KEEP_SIZE, "KEEP_SIZE" }, \
  40. { EXT4_GET_BLOCKS_NO_LOCK, "NO_LOCK" }, \
  41. { EXT4_GET_BLOCKS_NO_PUT_HOLE, "NO_PUT_HOLE" })
  42. #define show_mflags(flags) __print_flags(flags, "", \
  43. { EXT4_MAP_NEW, "N" }, \
  44. { EXT4_MAP_MAPPED, "M" }, \
  45. { EXT4_MAP_UNWRITTEN, "U" }, \
  46. { EXT4_MAP_BOUNDARY, "B" }, \
  47. { EXT4_MAP_UNINIT, "u" }, \
  48. { EXT4_MAP_FROM_CLUSTER, "C" })
  49. #define show_free_flags(flags) __print_flags(flags, "|", \
  50. { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \
  51. { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \
  52. { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \
  53. { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \
  54. { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
  55. { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
  56. #define show_extent_status(status) __print_flags(status, "", \
  57. { EXTENT_STATUS_WRITTEN, "W" }, \
  58. { EXTENT_STATUS_UNWRITTEN, "U" }, \
  59. { EXTENT_STATUS_DELAYED, "D" }, \
  60. { EXTENT_STATUS_HOLE, "H" })
  61. #define show_falloc_mode(mode) __print_flags(mode, "|", \
  62. { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
  63. { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
  64. { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \
  65. { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \
  66. { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"})
  67. TRACE_EVENT(ext4_free_inode,
  68. TP_PROTO(struct inode *inode),
  69. TP_ARGS(inode),
  70. TP_STRUCT__entry(
  71. __field( dev_t, dev )
  72. __field( ino_t, ino )
  73. __field( uid_t, uid )
  74. __field( gid_t, gid )
  75. __field( __u64, blocks )
  76. __field( __u16, mode )
  77. ),
  78. TP_fast_assign(
  79. __entry->dev = inode->i_sb->s_dev;
  80. __entry->ino = inode->i_ino;
  81. __entry->uid = i_uid_read(inode);
  82. __entry->gid = i_gid_read(inode);
  83. __entry->blocks = inode->i_blocks;
  84. __entry->mode = inode->i_mode;
  85. ),
  86. TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
  87. MAJOR(__entry->dev), MINOR(__entry->dev),
  88. (unsigned long) __entry->ino, __entry->mode,
  89. __entry->uid, __entry->gid, __entry->blocks)
  90. );
  91. TRACE_EVENT(ext4_request_inode,
  92. TP_PROTO(struct inode *dir, int mode),
  93. TP_ARGS(dir, mode),
  94. TP_STRUCT__entry(
  95. __field( dev_t, dev )
  96. __field( ino_t, dir )
  97. __field( __u16, mode )
  98. ),
  99. TP_fast_assign(
  100. __entry->dev = dir->i_sb->s_dev;
  101. __entry->dir = dir->i_ino;
  102. __entry->mode = mode;
  103. ),
  104. TP_printk("dev %d,%d dir %lu mode 0%o",
  105. MAJOR(__entry->dev), MINOR(__entry->dev),
  106. (unsigned long) __entry->dir, __entry->mode)
  107. );
  108. TRACE_EVENT(ext4_allocate_inode,
  109. TP_PROTO(struct inode *inode, struct inode *dir, int mode),
  110. TP_ARGS(inode, dir, mode),
  111. TP_STRUCT__entry(
  112. __field( dev_t, dev )
  113. __field( ino_t, ino )
  114. __field( ino_t, dir )
  115. __field( __u16, mode )
  116. ),
  117. TP_fast_assign(
  118. __entry->dev = inode->i_sb->s_dev;
  119. __entry->ino = inode->i_ino;
  120. __entry->dir = dir->i_ino;
  121. __entry->mode = mode;
  122. ),
  123. TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
  124. MAJOR(__entry->dev), MINOR(__entry->dev),
  125. (unsigned long) __entry->ino,
  126. (unsigned long) __entry->dir, __entry->mode)
  127. );
  128. TRACE_EVENT(ext4_evict_inode,
  129. TP_PROTO(struct inode *inode),
  130. TP_ARGS(inode),
  131. TP_STRUCT__entry(
  132. __field( dev_t, dev )
  133. __field( ino_t, ino )
  134. __field( int, nlink )
  135. ),
  136. TP_fast_assign(
  137. __entry->dev = inode->i_sb->s_dev;
  138. __entry->ino = inode->i_ino;
  139. __entry->nlink = inode->i_nlink;
  140. ),
  141. TP_printk("dev %d,%d ino %lu nlink %d",
  142. MAJOR(__entry->dev), MINOR(__entry->dev),
  143. (unsigned long) __entry->ino, __entry->nlink)
  144. );
  145. TRACE_EVENT(ext4_drop_inode,
  146. TP_PROTO(struct inode *inode, int drop),
  147. TP_ARGS(inode, drop),
  148. TP_STRUCT__entry(
  149. __field( dev_t, dev )
  150. __field( ino_t, ino )
  151. __field( int, drop )
  152. ),
  153. TP_fast_assign(
  154. __entry->dev = inode->i_sb->s_dev;
  155. __entry->ino = inode->i_ino;
  156. __entry->drop = drop;
  157. ),
  158. TP_printk("dev %d,%d ino %lu drop %d",
  159. MAJOR(__entry->dev), MINOR(__entry->dev),
  160. (unsigned long) __entry->ino, __entry->drop)
  161. );
  162. TRACE_EVENT(ext4_mark_inode_dirty,
  163. TP_PROTO(struct inode *inode, unsigned long IP),
  164. TP_ARGS(inode, IP),
  165. TP_STRUCT__entry(
  166. __field( dev_t, dev )
  167. __field( ino_t, ino )
  168. __field(unsigned long, ip )
  169. ),
  170. TP_fast_assign(
  171. __entry->dev = inode->i_sb->s_dev;
  172. __entry->ino = inode->i_ino;
  173. __entry->ip = IP;
  174. ),
  175. TP_printk("dev %d,%d ino %lu caller %pF",
  176. MAJOR(__entry->dev), MINOR(__entry->dev),
  177. (unsigned long) __entry->ino, (void *)__entry->ip)
  178. );
  179. TRACE_EVENT(ext4_begin_ordered_truncate,
  180. TP_PROTO(struct inode *inode, loff_t new_size),
  181. TP_ARGS(inode, new_size),
  182. TP_STRUCT__entry(
  183. __field( dev_t, dev )
  184. __field( ino_t, ino )
  185. __field( loff_t, new_size )
  186. ),
  187. TP_fast_assign(
  188. __entry->dev = inode->i_sb->s_dev;
  189. __entry->ino = inode->i_ino;
  190. __entry->new_size = new_size;
  191. ),
  192. TP_printk("dev %d,%d ino %lu new_size %lld",
  193. MAJOR(__entry->dev), MINOR(__entry->dev),
  194. (unsigned long) __entry->ino,
  195. __entry->new_size)
  196. );
  197. DECLARE_EVENT_CLASS(ext4__write_begin,
  198. TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
  199. unsigned int flags),
  200. TP_ARGS(inode, pos, len, flags),
  201. TP_STRUCT__entry(
  202. __field( dev_t, dev )
  203. __field( ino_t, ino )
  204. __field( loff_t, pos )
  205. __field( unsigned int, len )
  206. __field( unsigned int, flags )
  207. ),
  208. TP_fast_assign(
  209. __entry->dev = inode->i_sb->s_dev;
  210. __entry->ino = inode->i_ino;
  211. __entry->pos = pos;
  212. __entry->len = len;
  213. __entry->flags = flags;
  214. ),
  215. TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
  216. MAJOR(__entry->dev), MINOR(__entry->dev),
  217. (unsigned long) __entry->ino,
  218. __entry->pos, __entry->len, __entry->flags)
  219. );
  220. DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
  221. TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
  222. unsigned int flags),
  223. TP_ARGS(inode, pos, len, flags)
  224. );
  225. DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
  226. TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
  227. unsigned int flags),
  228. TP_ARGS(inode, pos, len, flags)
  229. );
  230. DECLARE_EVENT_CLASS(ext4__write_end,
  231. TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
  232. unsigned int copied),
  233. TP_ARGS(inode, pos, len, copied),
  234. TP_STRUCT__entry(
  235. __field( dev_t, dev )
  236. __field( ino_t, ino )
  237. __field( loff_t, pos )
  238. __field( unsigned int, len )
  239. __field( unsigned int, copied )
  240. ),
  241. TP_fast_assign(
  242. __entry->dev = inode->i_sb->s_dev;
  243. __entry->ino = inode->i_ino;
  244. __entry->pos = pos;
  245. __entry->len = len;
  246. __entry->copied = copied;
  247. ),
  248. TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
  249. MAJOR(__entry->dev), MINOR(__entry->dev),
  250. (unsigned long) __entry->ino,
  251. __entry->pos, __entry->len, __entry->copied)
  252. );
  253. DEFINE_EVENT(ext4__write_end, ext4_write_end,
  254. TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
  255. unsigned int copied),
  256. TP_ARGS(inode, pos, len, copied)
  257. );
  258. DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
  259. TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
  260. unsigned int copied),
  261. TP_ARGS(inode, pos, len, copied)
  262. );
  263. DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
  264. TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
  265. unsigned int copied),
  266. TP_ARGS(inode, pos, len, copied)
  267. );
  268. TRACE_EVENT(ext4_writepages,
  269. TP_PROTO(struct inode *inode, struct writeback_control *wbc),
  270. TP_ARGS(inode, wbc),
  271. TP_STRUCT__entry(
  272. __field( dev_t, dev )
  273. __field( ino_t, ino )
  274. __field( long, nr_to_write )
  275. __field( long, pages_skipped )
  276. __field( loff_t, range_start )
  277. __field( loff_t, range_end )
  278. __field( pgoff_t, writeback_index )
  279. __field( int, sync_mode )
  280. __field( char, for_kupdate )
  281. __field( char, range_cyclic )
  282. ),
  283. TP_fast_assign(
  284. __entry->dev = inode->i_sb->s_dev;
  285. __entry->ino = inode->i_ino;
  286. __entry->nr_to_write = wbc->nr_to_write;
  287. __entry->pages_skipped = wbc->pages_skipped;
  288. __entry->range_start = wbc->range_start;
  289. __entry->range_end = wbc->range_end;
  290. __entry->writeback_index = inode->i_mapping->writeback_index;
  291. __entry->sync_mode = wbc->sync_mode;
  292. __entry->for_kupdate = wbc->for_kupdate;
  293. __entry->range_cyclic = wbc->range_cyclic;
  294. ),
  295. TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
  296. "range_start %lld range_end %lld sync_mode %d "
  297. "for_kupdate %d range_cyclic %d writeback_index %lu",
  298. MAJOR(__entry->dev), MINOR(__entry->dev),
  299. (unsigned long) __entry->ino, __entry->nr_to_write,
  300. __entry->pages_skipped, __entry->range_start,
  301. __entry->range_end, __entry->sync_mode,
  302. __entry->for_kupdate, __entry->range_cyclic,
  303. (unsigned long) __entry->writeback_index)
  304. );
  305. TRACE_EVENT(ext4_da_write_pages,
  306. TP_PROTO(struct inode *inode, pgoff_t first_page,
  307. struct writeback_control *wbc),
  308. TP_ARGS(inode, first_page, wbc),
  309. TP_STRUCT__entry(
  310. __field( dev_t, dev )
  311. __field( ino_t, ino )
  312. __field( pgoff_t, first_page )
  313. __field( long, nr_to_write )
  314. __field( int, sync_mode )
  315. ),
  316. TP_fast_assign(
  317. __entry->dev = inode->i_sb->s_dev;
  318. __entry->ino = inode->i_ino;
  319. __entry->first_page = first_page;
  320. __entry->nr_to_write = wbc->nr_to_write;
  321. __entry->sync_mode = wbc->sync_mode;
  322. ),
  323. TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
  324. "sync_mode %d",
  325. MAJOR(__entry->dev), MINOR(__entry->dev),
  326. (unsigned long) __entry->ino, __entry->first_page,
  327. __entry->nr_to_write, __entry->sync_mode)
  328. );
  329. TRACE_EVENT(ext4_da_write_pages_extent,
  330. TP_PROTO(struct inode *inode, struct ext4_map_blocks *map),
  331. TP_ARGS(inode, map),
  332. TP_STRUCT__entry(
  333. __field( dev_t, dev )
  334. __field( ino_t, ino )
  335. __field( __u64, lblk )
  336. __field( __u32, len )
  337. __field( __u32, flags )
  338. ),
  339. TP_fast_assign(
  340. __entry->dev = inode->i_sb->s_dev;
  341. __entry->ino = inode->i_ino;
  342. __entry->lblk = map->m_lblk;
  343. __entry->len = map->m_len;
  344. __entry->flags = map->m_flags;
  345. ),
  346. TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
  347. MAJOR(__entry->dev), MINOR(__entry->dev),
  348. (unsigned long) __entry->ino, __entry->lblk, __entry->len,
  349. show_mflags(__entry->flags))
  350. );
  351. TRACE_EVENT(ext4_writepages_result,
  352. TP_PROTO(struct inode *inode, struct writeback_control *wbc,
  353. int ret, int pages_written),
  354. TP_ARGS(inode, wbc, ret, pages_written),
  355. TP_STRUCT__entry(
  356. __field( dev_t, dev )
  357. __field( ino_t, ino )
  358. __field( int, ret )
  359. __field( int, pages_written )
  360. __field( long, pages_skipped )
  361. __field( pgoff_t, writeback_index )
  362. __field( int, sync_mode )
  363. ),
  364. TP_fast_assign(
  365. __entry->dev = inode->i_sb->s_dev;
  366. __entry->ino = inode->i_ino;
  367. __entry->ret = ret;
  368. __entry->pages_written = pages_written;
  369. __entry->pages_skipped = wbc->pages_skipped;
  370. __entry->writeback_index = inode->i_mapping->writeback_index;
  371. __entry->sync_mode = wbc->sync_mode;
  372. ),
  373. TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
  374. "sync_mode %d writeback_index %lu",
  375. MAJOR(__entry->dev), MINOR(__entry->dev),
  376. (unsigned long) __entry->ino, __entry->ret,
  377. __entry->pages_written, __entry->pages_skipped,
  378. __entry->sync_mode,
  379. (unsigned long) __entry->writeback_index)
  380. );
  381. DECLARE_EVENT_CLASS(ext4__page_op,
  382. TP_PROTO(struct page *page),
  383. TP_ARGS(page),
  384. TP_STRUCT__entry(
  385. __field( dev_t, dev )
  386. __field( ino_t, ino )
  387. __field( pgoff_t, index )
  388. ),
  389. TP_fast_assign(
  390. __entry->dev = page->mapping->host->i_sb->s_dev;
  391. __entry->ino = page->mapping->host->i_ino;
  392. __entry->index = page->index;
  393. ),
  394. TP_printk("dev %d,%d ino %lu page_index %lu",
  395. MAJOR(__entry->dev), MINOR(__entry->dev),
  396. (unsigned long) __entry->ino,
  397. (unsigned long) __entry->index)
  398. );
  399. DEFINE_EVENT(ext4__page_op, ext4_writepage,
  400. TP_PROTO(struct page *page),
  401. TP_ARGS(page)
  402. );
  403. DEFINE_EVENT(ext4__page_op, ext4_readpage,
  404. TP_PROTO(struct page *page),
  405. TP_ARGS(page)
  406. );
  407. DEFINE_EVENT(ext4__page_op, ext4_releasepage,
  408. TP_PROTO(struct page *page),
  409. TP_ARGS(page)
  410. );
  411. DECLARE_EVENT_CLASS(ext4_invalidatepage_op,
  412. TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
  413. TP_ARGS(page, offset, length),
  414. TP_STRUCT__entry(
  415. __field( dev_t, dev )
  416. __field( ino_t, ino )
  417. __field( pgoff_t, index )
  418. __field( unsigned int, offset )
  419. __field( unsigned int, length )
  420. ),
  421. TP_fast_assign(
  422. __entry->dev = page->mapping->host->i_sb->s_dev;
  423. __entry->ino = page->mapping->host->i_ino;
  424. __entry->index = page->index;
  425. __entry->offset = offset;
  426. __entry->length = length;
  427. ),
  428. TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
  429. MAJOR(__entry->dev), MINOR(__entry->dev),
  430. (unsigned long) __entry->ino,
  431. (unsigned long) __entry->index,
  432. __entry->offset, __entry->length)
  433. );
  434. DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage,
  435. TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
  436. TP_ARGS(page, offset, length)
  437. );
  438. DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage,
  439. TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
  440. TP_ARGS(page, offset, length)
  441. );
  442. TRACE_EVENT(ext4_discard_blocks,
  443. TP_PROTO(struct super_block *sb, unsigned long long blk,
  444. unsigned long long count),
  445. TP_ARGS(sb, blk, count),
  446. TP_STRUCT__entry(
  447. __field( dev_t, dev )
  448. __field( __u64, blk )
  449. __field( __u64, count )
  450. ),
  451. TP_fast_assign(
  452. __entry->dev = sb->s_dev;
  453. __entry->blk = blk;
  454. __entry->count = count;
  455. ),
  456. TP_printk("dev %d,%d blk %llu count %llu",
  457. MAJOR(__entry->dev), MINOR(__entry->dev),
  458. __entry->blk, __entry->count)
  459. );
  460. DECLARE_EVENT_CLASS(ext4__mb_new_pa,
  461. TP_PROTO(struct ext4_allocation_context *ac,
  462. struct ext4_prealloc_space *pa),
  463. TP_ARGS(ac, pa),
  464. TP_STRUCT__entry(
  465. __field( dev_t, dev )
  466. __field( ino_t, ino )
  467. __field( __u64, pa_pstart )
  468. __field( __u64, pa_lstart )
  469. __field( __u32, pa_len )
  470. ),
  471. TP_fast_assign(
  472. __entry->dev = ac->ac_sb->s_dev;
  473. __entry->ino = ac->ac_inode->i_ino;
  474. __entry->pa_pstart = pa->pa_pstart;
  475. __entry->pa_lstart = pa->pa_lstart;
  476. __entry->pa_len = pa->pa_len;
  477. ),
  478. TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
  479. MAJOR(__entry->dev), MINOR(__entry->dev),
  480. (unsigned long) __entry->ino,
  481. __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
  482. );
  483. DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
  484. TP_PROTO(struct ext4_allocation_context *ac,
  485. struct ext4_prealloc_space *pa),
  486. TP_ARGS(ac, pa)
  487. );
  488. DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
  489. TP_PROTO(struct ext4_allocation_context *ac,
  490. struct ext4_prealloc_space *pa),
  491. TP_ARGS(ac, pa)
  492. );
  493. TRACE_EVENT(ext4_mb_release_inode_pa,
  494. TP_PROTO(struct ext4_prealloc_space *pa,
  495. unsigned long long block, unsigned int count),
  496. TP_ARGS(pa, block, count),
  497. TP_STRUCT__entry(
  498. __field( dev_t, dev )
  499. __field( ino_t, ino )
  500. __field( __u64, block )
  501. __field( __u32, count )
  502. ),
  503. TP_fast_assign(
  504. __entry->dev = pa->pa_inode->i_sb->s_dev;
  505. __entry->ino = pa->pa_inode->i_ino;
  506. __entry->block = block;
  507. __entry->count = count;
  508. ),
  509. TP_printk("dev %d,%d ino %lu block %llu count %u",
  510. MAJOR(__entry->dev), MINOR(__entry->dev),
  511. (unsigned long) __entry->ino,
  512. __entry->block, __entry->count)
  513. );
  514. TRACE_EVENT(ext4_mb_release_group_pa,
  515. TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa),
  516. TP_ARGS(sb, pa),
  517. TP_STRUCT__entry(
  518. __field( dev_t, dev )
  519. __field( __u64, pa_pstart )
  520. __field( __u32, pa_len )
  521. ),
  522. TP_fast_assign(
  523. __entry->dev = sb->s_dev;
  524. __entry->pa_pstart = pa->pa_pstart;
  525. __entry->pa_len = pa->pa_len;
  526. ),
  527. TP_printk("dev %d,%d pstart %llu len %u",
  528. MAJOR(__entry->dev), MINOR(__entry->dev),
  529. __entry->pa_pstart, __entry->pa_len)
  530. );
  531. TRACE_EVENT(ext4_discard_preallocations,
  532. TP_PROTO(struct inode *inode),
  533. TP_ARGS(inode),
  534. TP_STRUCT__entry(
  535. __field( dev_t, dev )
  536. __field( ino_t, ino )
  537. ),
  538. TP_fast_assign(
  539. __entry->dev = inode->i_sb->s_dev;
  540. __entry->ino = inode->i_ino;
  541. ),
  542. TP_printk("dev %d,%d ino %lu",
  543. MAJOR(__entry->dev), MINOR(__entry->dev),
  544. (unsigned long) __entry->ino)
  545. );
  546. TRACE_EVENT(ext4_mb_discard_preallocations,
  547. TP_PROTO(struct super_block *sb, int needed),
  548. TP_ARGS(sb, needed),
  549. TP_STRUCT__entry(
  550. __field( dev_t, dev )
  551. __field( int, needed )
  552. ),
  553. TP_fast_assign(
  554. __entry->dev = sb->s_dev;
  555. __entry->needed = needed;
  556. ),
  557. TP_printk("dev %d,%d needed %d",
  558. MAJOR(__entry->dev), MINOR(__entry->dev),
  559. __entry->needed)
  560. );
  561. TRACE_EVENT(ext4_request_blocks,
  562. TP_PROTO(struct ext4_allocation_request *ar),
  563. TP_ARGS(ar),
  564. TP_STRUCT__entry(
  565. __field( dev_t, dev )
  566. __field( ino_t, ino )
  567. __field( unsigned int, len )
  568. __field( __u32, logical )
  569. __field( __u32, lleft )
  570. __field( __u32, lright )
  571. __field( __u64, goal )
  572. __field( __u64, pleft )
  573. __field( __u64, pright )
  574. __field( unsigned int, flags )
  575. ),
  576. TP_fast_assign(
  577. __entry->dev = ar->inode->i_sb->s_dev;
  578. __entry->ino = ar->inode->i_ino;
  579. __entry->len = ar->len;
  580. __entry->logical = ar->logical;
  581. __entry->goal = ar->goal;
  582. __entry->lleft = ar->lleft;
  583. __entry->lright = ar->lright;
  584. __entry->pleft = ar->pleft;
  585. __entry->pright = ar->pright;
  586. __entry->flags = ar->flags;
  587. ),
  588. TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
  589. "lleft %u lright %u pleft %llu pright %llu ",
  590. MAJOR(__entry->dev), MINOR(__entry->dev),
  591. (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
  592. __entry->len, __entry->logical, __entry->goal,
  593. __entry->lleft, __entry->lright, __entry->pleft,
  594. __entry->pright)
  595. );
  596. TRACE_EVENT(ext4_allocate_blocks,
  597. TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
  598. TP_ARGS(ar, block),
  599. TP_STRUCT__entry(
  600. __field( dev_t, dev )
  601. __field( ino_t, ino )
  602. __field( __u64, block )
  603. __field( unsigned int, len )
  604. __field( __u32, logical )
  605. __field( __u32, lleft )
  606. __field( __u32, lright )
  607. __field( __u64, goal )
  608. __field( __u64, pleft )
  609. __field( __u64, pright )
  610. __field( unsigned int, flags )
  611. ),
  612. TP_fast_assign(
  613. __entry->dev = ar->inode->i_sb->s_dev;
  614. __entry->ino = ar->inode->i_ino;
  615. __entry->block = block;
  616. __entry->len = ar->len;
  617. __entry->logical = ar->logical;
  618. __entry->goal = ar->goal;
  619. __entry->lleft = ar->lleft;
  620. __entry->lright = ar->lright;
  621. __entry->pleft = ar->pleft;
  622. __entry->pright = ar->pright;
  623. __entry->flags = ar->flags;
  624. ),
  625. TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
  626. "goal %llu lleft %u lright %u pleft %llu pright %llu",
  627. MAJOR(__entry->dev), MINOR(__entry->dev),
  628. (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
  629. __entry->len, __entry->block, __entry->logical,
  630. __entry->goal, __entry->lleft, __entry->lright,
  631. __entry->pleft, __entry->pright)
  632. );
  633. TRACE_EVENT(ext4_free_blocks,
  634. TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
  635. int flags),
  636. TP_ARGS(inode, block, count, flags),
  637. TP_STRUCT__entry(
  638. __field( dev_t, dev )
  639. __field( ino_t, ino )
  640. __field( __u64, block )
  641. __field( unsigned long, count )
  642. __field( int, flags )
  643. __field( __u16, mode )
  644. ),
  645. TP_fast_assign(
  646. __entry->dev = inode->i_sb->s_dev;
  647. __entry->ino = inode->i_ino;
  648. __entry->block = block;
  649. __entry->count = count;
  650. __entry->flags = flags;
  651. __entry->mode = inode->i_mode;
  652. ),
  653. TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
  654. MAJOR(__entry->dev), MINOR(__entry->dev),
  655. (unsigned long) __entry->ino,
  656. __entry->mode, __entry->block, __entry->count,
  657. show_free_flags(__entry->flags))
  658. );
  659. TRACE_EVENT(ext4_sync_file_enter,
  660. TP_PROTO(struct file *file, int datasync),
  661. TP_ARGS(file, datasync),
  662. TP_STRUCT__entry(
  663. __field( dev_t, dev )
  664. __field( ino_t, ino )
  665. __field( ino_t, parent )
  666. __field( int, datasync )
  667. ),
  668. TP_fast_assign(
  669. struct dentry *dentry = file->f_path.dentry;
  670. __entry->dev = dentry->d_inode->i_sb->s_dev;
  671. __entry->ino = dentry->d_inode->i_ino;
  672. __entry->datasync = datasync;
  673. __entry->parent = dentry->d_parent->d_inode->i_ino;
  674. ),
  675. TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
  676. MAJOR(__entry->dev), MINOR(__entry->dev),
  677. (unsigned long) __entry->ino,
  678. (unsigned long) __entry->parent, __entry->datasync)
  679. );
  680. TRACE_EVENT(ext4_sync_file_exit,
  681. TP_PROTO(struct inode *inode, int ret),
  682. TP_ARGS(inode, ret),
  683. TP_STRUCT__entry(
  684. __field( dev_t, dev )
  685. __field( ino_t, ino )
  686. __field( int, ret )
  687. ),
  688. TP_fast_assign(
  689. __entry->dev = inode->i_sb->s_dev;
  690. __entry->ino = inode->i_ino;
  691. __entry->ret = ret;
  692. ),
  693. TP_printk("dev %d,%d ino %lu ret %d",
  694. MAJOR(__entry->dev), MINOR(__entry->dev),
  695. (unsigned long) __entry->ino,
  696. __entry->ret)
  697. );
  698. TRACE_EVENT(ext4_sync_fs,
  699. TP_PROTO(struct super_block *sb, int wait),
  700. TP_ARGS(sb, wait),
  701. TP_STRUCT__entry(
  702. __field( dev_t, dev )
  703. __field( int, wait )
  704. ),
  705. TP_fast_assign(
  706. __entry->dev = sb->s_dev;
  707. __entry->wait = wait;
  708. ),
  709. TP_printk("dev %d,%d wait %d",
  710. MAJOR(__entry->dev), MINOR(__entry->dev),
  711. __entry->wait)
  712. );
  713. TRACE_EVENT(ext4_alloc_da_blocks,
  714. TP_PROTO(struct inode *inode),
  715. TP_ARGS(inode),
  716. TP_STRUCT__entry(
  717. __field( dev_t, dev )
  718. __field( ino_t, ino )
  719. __field( unsigned int, data_blocks )
  720. __field( unsigned int, meta_blocks )
  721. ),
  722. TP_fast_assign(
  723. __entry->dev = inode->i_sb->s_dev;
  724. __entry->ino = inode->i_ino;
  725. __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
  726. __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
  727. ),
  728. TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
  729. MAJOR(__entry->dev), MINOR(__entry->dev),
  730. (unsigned long) __entry->ino,
  731. __entry->data_blocks, __entry->meta_blocks)
  732. );
  733. TRACE_EVENT(ext4_mballoc_alloc,
  734. TP_PROTO(struct ext4_allocation_context *ac),
  735. TP_ARGS(ac),
  736. TP_STRUCT__entry(
  737. __field( dev_t, dev )
  738. __field( ino_t, ino )
  739. __field( __u32, orig_logical )
  740. __field( int, orig_start )
  741. __field( __u32, orig_group )
  742. __field( int, orig_len )
  743. __field( __u32, goal_logical )
  744. __field( int, goal_start )
  745. __field( __u32, goal_group )
  746. __field( int, goal_len )
  747. __field( __u32, result_logical )
  748. __field( int, result_start )
  749. __field( __u32, result_group )
  750. __field( int, result_len )
  751. __field( __u16, found )
  752. __field( __u16, groups )
  753. __field( __u16, buddy )
  754. __field( __u16, flags )
  755. __field( __u16, tail )
  756. __field( __u8, cr )
  757. ),
  758. TP_fast_assign(
  759. __entry->dev = ac->ac_inode->i_sb->s_dev;
  760. __entry->ino = ac->ac_inode->i_ino;
  761. __entry->orig_logical = ac->ac_o_ex.fe_logical;
  762. __entry->orig_start = ac->ac_o_ex.fe_start;
  763. __entry->orig_group = ac->ac_o_ex.fe_group;
  764. __entry->orig_len = ac->ac_o_ex.fe_len;
  765. __entry->goal_logical = ac->ac_g_ex.fe_logical;
  766. __entry->goal_start = ac->ac_g_ex.fe_start;
  767. __entry->goal_group = ac->ac_g_ex.fe_group;
  768. __entry->goal_len = ac->ac_g_ex.fe_len;
  769. __entry->result_logical = ac->ac_f_ex.fe_logical;
  770. __entry->result_start = ac->ac_f_ex.fe_start;
  771. __entry->result_group = ac->ac_f_ex.fe_group;
  772. __entry->result_len = ac->ac_f_ex.fe_len;
  773. __entry->found = ac->ac_found;
  774. __entry->flags = ac->ac_flags;
  775. __entry->groups = ac->ac_groups_scanned;
  776. __entry->buddy = ac->ac_buddy;
  777. __entry->tail = ac->ac_tail;
  778. __entry->cr = ac->ac_criteria;
  779. ),
  780. TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
  781. "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
  782. "tail %u broken %u",
  783. MAJOR(__entry->dev), MINOR(__entry->dev),
  784. (unsigned long) __entry->ino,
  785. __entry->orig_group, __entry->orig_start,
  786. __entry->orig_len, __entry->orig_logical,
  787. __entry->goal_group, __entry->goal_start,
  788. __entry->goal_len, __entry->goal_logical,
  789. __entry->result_group, __entry->result_start,
  790. __entry->result_len, __entry->result_logical,
  791. __entry->found, __entry->groups, __entry->cr,
  792. show_mballoc_flags(__entry->flags), __entry->tail,
  793. __entry->buddy ? 1 << __entry->buddy : 0)
  794. );
  795. TRACE_EVENT(ext4_mballoc_prealloc,
  796. TP_PROTO(struct ext4_allocation_context *ac),
  797. TP_ARGS(ac),
  798. TP_STRUCT__entry(
  799. __field( dev_t, dev )
  800. __field( ino_t, ino )
  801. __field( __u32, orig_logical )
  802. __field( int, orig_start )
  803. __field( __u32, orig_group )
  804. __field( int, orig_len )
  805. __field( __u32, result_logical )
  806. __field( int, result_start )
  807. __field( __u32, result_group )
  808. __field( int, result_len )
  809. ),
  810. TP_fast_assign(
  811. __entry->dev = ac->ac_inode->i_sb->s_dev;
  812. __entry->ino = ac->ac_inode->i_ino;
  813. __entry->orig_logical = ac->ac_o_ex.fe_logical;
  814. __entry->orig_start = ac->ac_o_ex.fe_start;
  815. __entry->orig_group = ac->ac_o_ex.fe_group;
  816. __entry->orig_len = ac->ac_o_ex.fe_len;
  817. __entry->result_logical = ac->ac_b_ex.fe_logical;
  818. __entry->result_start = ac->ac_b_ex.fe_start;
  819. __entry->result_group = ac->ac_b_ex.fe_group;
  820. __entry->result_len = ac->ac_b_ex.fe_len;
  821. ),
  822. TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
  823. MAJOR(__entry->dev), MINOR(__entry->dev),
  824. (unsigned long) __entry->ino,
  825. __entry->orig_group, __entry->orig_start,
  826. __entry->orig_len, __entry->orig_logical,
  827. __entry->result_group, __entry->result_start,
  828. __entry->result_len, __entry->result_logical)
  829. );
  830. DECLARE_EVENT_CLASS(ext4__mballoc,
  831. TP_PROTO(struct super_block *sb,
  832. struct inode *inode,
  833. ext4_group_t group,
  834. ext4_grpblk_t start,
  835. ext4_grpblk_t len),
  836. TP_ARGS(sb, inode, group, start, len),
  837. TP_STRUCT__entry(
  838. __field( dev_t, dev )
  839. __field( ino_t, ino )
  840. __field( int, result_start )
  841. __field( __u32, result_group )
  842. __field( int, result_len )
  843. ),
  844. TP_fast_assign(
  845. __entry->dev = sb->s_dev;
  846. __entry->ino = inode ? inode->i_ino : 0;
  847. __entry->result_start = start;
  848. __entry->result_group = group;
  849. __entry->result_len = len;
  850. ),
  851. TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
  852. MAJOR(__entry->dev), MINOR(__entry->dev),
  853. (unsigned long) __entry->ino,
  854. __entry->result_group, __entry->result_start,
  855. __entry->result_len)
  856. );
  857. DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
  858. TP_PROTO(struct super_block *sb,
  859. struct inode *inode,
  860. ext4_group_t group,
  861. ext4_grpblk_t start,
  862. ext4_grpblk_t len),
  863. TP_ARGS(sb, inode, group, start, len)
  864. );
  865. DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
  866. TP_PROTO(struct super_block *sb,
  867. struct inode *inode,
  868. ext4_group_t group,
  869. ext4_grpblk_t start,
  870. ext4_grpblk_t len),
  871. TP_ARGS(sb, inode, group, start, len)
  872. );
  873. TRACE_EVENT(ext4_forget,
  874. TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
  875. TP_ARGS(inode, is_metadata, block),
  876. TP_STRUCT__entry(
  877. __field( dev_t, dev )
  878. __field( ino_t, ino )
  879. __field( __u64, block )
  880. __field( int, is_metadata )
  881. __field( __u16, mode )
  882. ),
  883. TP_fast_assign(
  884. __entry->dev = inode->i_sb->s_dev;
  885. __entry->ino = inode->i_ino;
  886. __entry->block = block;
  887. __entry->is_metadata = is_metadata;
  888. __entry->mode = inode->i_mode;
  889. ),
  890. TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
  891. MAJOR(__entry->dev), MINOR(__entry->dev),
  892. (unsigned long) __entry->ino,
  893. __entry->mode, __entry->is_metadata, __entry->block)
  894. );
  895. TRACE_EVENT(ext4_da_update_reserve_space,
  896. TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
  897. TP_ARGS(inode, used_blocks, quota_claim),
  898. TP_STRUCT__entry(
  899. __field( dev_t, dev )
  900. __field( ino_t, ino )
  901. __field( __u64, i_blocks )
  902. __field( int, used_blocks )
  903. __field( int, reserved_data_blocks )
  904. __field( int, reserved_meta_blocks )
  905. __field( int, allocated_meta_blocks )
  906. __field( int, quota_claim )
  907. __field( __u16, mode )
  908. ),
  909. TP_fast_assign(
  910. __entry->dev = inode->i_sb->s_dev;
  911. __entry->ino = inode->i_ino;
  912. __entry->i_blocks = inode->i_blocks;
  913. __entry->used_blocks = used_blocks;
  914. __entry->reserved_data_blocks =
  915. EXT4_I(inode)->i_reserved_data_blocks;
  916. __entry->reserved_meta_blocks =
  917. EXT4_I(inode)->i_reserved_meta_blocks;
  918. __entry->allocated_meta_blocks =
  919. EXT4_I(inode)->i_allocated_meta_blocks;
  920. __entry->quota_claim = quota_claim;
  921. __entry->mode = inode->i_mode;
  922. ),
  923. TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
  924. "reserved_data_blocks %d reserved_meta_blocks %d "
  925. "allocated_meta_blocks %d quota_claim %d",
  926. MAJOR(__entry->dev), MINOR(__entry->dev),
  927. (unsigned long) __entry->ino,
  928. __entry->mode, __entry->i_blocks,
  929. __entry->used_blocks, __entry->reserved_data_blocks,
  930. __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
  931. __entry->quota_claim)
  932. );
  933. TRACE_EVENT(ext4_da_reserve_space,
  934. TP_PROTO(struct inode *inode, int md_needed),
  935. TP_ARGS(inode, md_needed),
  936. TP_STRUCT__entry(
  937. __field( dev_t, dev )
  938. __field( ino_t, ino )
  939. __field( __u64, i_blocks )
  940. __field( int, md_needed )
  941. __field( int, reserved_data_blocks )
  942. __field( int, reserved_meta_blocks )
  943. __field( __u16, mode )
  944. ),
  945. TP_fast_assign(
  946. __entry->dev = inode->i_sb->s_dev;
  947. __entry->ino = inode->i_ino;
  948. __entry->i_blocks = inode->i_blocks;
  949. __entry->md_needed = md_needed;
  950. __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
  951. __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
  952. __entry->mode = inode->i_mode;
  953. ),
  954. TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d "
  955. "reserved_data_blocks %d reserved_meta_blocks %d",
  956. MAJOR(__entry->dev), MINOR(__entry->dev),
  957. (unsigned long) __entry->ino,
  958. __entry->mode, __entry->i_blocks,
  959. __entry->md_needed, __entry->reserved_data_blocks,
  960. __entry->reserved_meta_blocks)
  961. );
  962. TRACE_EVENT(ext4_da_release_space,
  963. TP_PROTO(struct inode *inode, int freed_blocks),
  964. TP_ARGS(inode, freed_blocks),
  965. TP_STRUCT__entry(
  966. __field( dev_t, dev )
  967. __field( ino_t, ino )
  968. __field( __u64, i_blocks )
  969. __field( int, freed_blocks )
  970. __field( int, reserved_data_blocks )
  971. __field( int, reserved_meta_blocks )
  972. __field( int, allocated_meta_blocks )
  973. __field( __u16, mode )
  974. ),
  975. TP_fast_assign(
  976. __entry->dev = inode->i_sb->s_dev;
  977. __entry->ino = inode->i_ino;
  978. __entry->i_blocks = inode->i_blocks;
  979. __entry->freed_blocks = freed_blocks;
  980. __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
  981. __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
  982. __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
  983. __entry->mode = inode->i_mode;
  984. ),
  985. TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
  986. "reserved_data_blocks %d reserved_meta_blocks %d "
  987. "allocated_meta_blocks %d",
  988. MAJOR(__entry->dev), MINOR(__entry->dev),
  989. (unsigned long) __entry->ino,
  990. __entry->mode, __entry->i_blocks,
  991. __entry->freed_blocks, __entry->reserved_data_blocks,
  992. __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
  993. );
  994. DECLARE_EVENT_CLASS(ext4__bitmap_load,
  995. TP_PROTO(struct super_block *sb, unsigned long group),
  996. TP_ARGS(sb, group),
  997. TP_STRUCT__entry(
  998. __field( dev_t, dev )
  999. __field( __u32, group )
  1000. ),
  1001. TP_fast_assign(
  1002. __entry->dev = sb->s_dev;
  1003. __entry->group = group;
  1004. ),
  1005. TP_printk("dev %d,%d group %u",
  1006. MAJOR(__entry->dev), MINOR(__entry->dev),
  1007. __entry->group)
  1008. );
  1009. DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
  1010. TP_PROTO(struct super_block *sb, unsigned long group),
  1011. TP_ARGS(sb, group)
  1012. );
  1013. DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
  1014. TP_PROTO(struct super_block *sb, unsigned long group),
  1015. TP_ARGS(sb, group)
  1016. );
  1017. DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
  1018. TP_PROTO(struct super_block *sb, unsigned long group),
  1019. TP_ARGS(sb, group)
  1020. );
  1021. DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
  1022. TP_PROTO(struct super_block *sb, unsigned long group),
  1023. TP_ARGS(sb, group)
  1024. );
  1025. TRACE_EVENT(ext4_direct_IO_enter,
  1026. TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
  1027. TP_ARGS(inode, offset, len, rw),
  1028. TP_STRUCT__entry(
  1029. __field( dev_t, dev )
  1030. __field( ino_t, ino )
  1031. __field( loff_t, pos )
  1032. __field( unsigned long, len )
  1033. __field( int, rw )
  1034. ),
  1035. TP_fast_assign(
  1036. __entry->dev = inode->i_sb->s_dev;
  1037. __entry->ino = inode->i_ino;
  1038. __entry->pos = offset;
  1039. __entry->len = len;
  1040. __entry->rw = rw;
  1041. ),
  1042. TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
  1043. MAJOR(__entry->dev), MINOR(__entry->dev),
  1044. (unsigned long) __entry->ino,
  1045. __entry->pos, __entry->len, __entry->rw)
  1046. );
  1047. TRACE_EVENT(ext4_direct_IO_exit,
  1048. TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
  1049. int rw, int ret),
  1050. TP_ARGS(inode, offset, len, rw, ret),
  1051. TP_STRUCT__entry(
  1052. __field( dev_t, dev )
  1053. __field( ino_t, ino )
  1054. __field( loff_t, pos )
  1055. __field( unsigned long, len )
  1056. __field( int, rw )
  1057. __field( int, ret )
  1058. ),
  1059. TP_fast_assign(
  1060. __entry->dev = inode->i_sb->s_dev;
  1061. __entry->ino = inode->i_ino;
  1062. __entry->pos = offset;
  1063. __entry->len = len;
  1064. __entry->rw = rw;
  1065. __entry->ret = ret;
  1066. ),
  1067. TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
  1068. MAJOR(__entry->dev), MINOR(__entry->dev),
  1069. (unsigned long) __entry->ino,
  1070. __entry->pos, __entry->len,
  1071. __entry->rw, __entry->ret)
  1072. );
  1073. DECLARE_EVENT_CLASS(ext4__fallocate_mode,
  1074. TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
  1075. TP_ARGS(inode, offset, len, mode),
  1076. TP_STRUCT__entry(
  1077. __field( dev_t, dev )
  1078. __field( ino_t, ino )
  1079. __field( loff_t, offset )
  1080. __field( loff_t, len )
  1081. __field( int, mode )
  1082. ),
  1083. TP_fast_assign(
  1084. __entry->dev = inode->i_sb->s_dev;
  1085. __entry->ino = inode->i_ino;
  1086. __entry->offset = offset;
  1087. __entry->len = len;
  1088. __entry->mode = mode;
  1089. ),
  1090. TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
  1091. MAJOR(__entry->dev), MINOR(__entry->dev),
  1092. (unsigned long) __entry->ino,
  1093. __entry->offset, __entry->len,
  1094. show_falloc_mode(__entry->mode))
  1095. );
  1096. DEFINE_EVENT(ext4__fallocate_mode, ext4_fallocate_enter,
  1097. TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
  1098. TP_ARGS(inode, offset, len, mode)
  1099. );
  1100. DEFINE_EVENT(ext4__fallocate_mode, ext4_punch_hole,
  1101. TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
  1102. TP_ARGS(inode, offset, len, mode)
  1103. );
  1104. DEFINE_EVENT(ext4__fallocate_mode, ext4_zero_range,
  1105. TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
  1106. TP_ARGS(inode, offset, len, mode)
  1107. );
  1108. TRACE_EVENT(ext4_fallocate_exit,
  1109. TP_PROTO(struct inode *inode, loff_t offset,
  1110. unsigned int max_blocks, int ret),
  1111. TP_ARGS(inode, offset, max_blocks, ret),
  1112. TP_STRUCT__entry(
  1113. __field( dev_t, dev )
  1114. __field( ino_t, ino )
  1115. __field( loff_t, pos )
  1116. __field( unsigned int, blocks )
  1117. __field( int, ret )
  1118. ),
  1119. TP_fast_assign(
  1120. __entry->dev = inode->i_sb->s_dev;
  1121. __entry->ino = inode->i_ino;
  1122. __entry->pos = offset;
  1123. __entry->blocks = max_blocks;
  1124. __entry->ret = ret;
  1125. ),
  1126. TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
  1127. MAJOR(__entry->dev), MINOR(__entry->dev),
  1128. (unsigned long) __entry->ino,
  1129. __entry->pos, __entry->blocks,
  1130. __entry->ret)
  1131. );
  1132. TRACE_EVENT(ext4_unlink_enter,
  1133. TP_PROTO(struct inode *parent, struct dentry *dentry),
  1134. TP_ARGS(parent, dentry),
  1135. TP_STRUCT__entry(
  1136. __field( dev_t, dev )
  1137. __field( ino_t, ino )
  1138. __field( ino_t, parent )
  1139. __field( loff_t, size )
  1140. ),
  1141. TP_fast_assign(
  1142. __entry->dev = dentry->d_inode->i_sb->s_dev;
  1143. __entry->ino = dentry->d_inode->i_ino;
  1144. __entry->parent = parent->i_ino;
  1145. __entry->size = dentry->d_inode->i_size;
  1146. ),
  1147. TP_printk("dev %d,%d ino %lu size %lld parent %lu",
  1148. MAJOR(__entry->dev), MINOR(__entry->dev),
  1149. (unsigned long) __entry->ino, __entry->size,
  1150. (unsigned long) __entry->parent)
  1151. );
  1152. TRACE_EVENT(ext4_unlink_exit,
  1153. TP_PROTO(struct dentry *dentry, int ret),
  1154. TP_ARGS(dentry, ret),
  1155. TP_STRUCT__entry(
  1156. __field( dev_t, dev )
  1157. __field( ino_t, ino )
  1158. __field( int, ret )
  1159. ),
  1160. TP_fast_assign(
  1161. __entry->dev = dentry->d_inode->i_sb->s_dev;
  1162. __entry->ino = dentry->d_inode->i_ino;
  1163. __entry->ret = ret;
  1164. ),
  1165. TP_printk("dev %d,%d ino %lu ret %d",
  1166. MAJOR(__entry->dev), MINOR(__entry->dev),
  1167. (unsigned long) __entry->ino,
  1168. __entry->ret)
  1169. );
  1170. DECLARE_EVENT_CLASS(ext4__truncate,
  1171. TP_PROTO(struct inode *inode),
  1172. TP_ARGS(inode),
  1173. TP_STRUCT__entry(
  1174. __field( dev_t, dev )
  1175. __field( ino_t, ino )
  1176. __field( __u64, blocks )
  1177. ),
  1178. TP_fast_assign(
  1179. __entry->dev = inode->i_sb->s_dev;
  1180. __entry->ino = inode->i_ino;
  1181. __entry->blocks = inode->i_blocks;
  1182. ),
  1183. TP_printk("dev %d,%d ino %lu blocks %llu",
  1184. MAJOR(__entry->dev), MINOR(__entry->dev),
  1185. (unsigned long) __entry->ino, __entry->blocks)
  1186. );
  1187. DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
  1188. TP_PROTO(struct inode *inode),
  1189. TP_ARGS(inode)
  1190. );
  1191. DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
  1192. TP_PROTO(struct inode *inode),
  1193. TP_ARGS(inode)
  1194. );
  1195. /* 'ux' is the uninitialized extent. */
  1196. TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
  1197. TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
  1198. struct ext4_extent *ux),
  1199. TP_ARGS(inode, map, ux),
  1200. TP_STRUCT__entry(
  1201. __field( dev_t, dev )
  1202. __field( ino_t, ino )
  1203. __field( ext4_lblk_t, m_lblk )
  1204. __field( unsigned, m_len )
  1205. __field( ext4_lblk_t, u_lblk )
  1206. __field( unsigned, u_len )
  1207. __field( ext4_fsblk_t, u_pblk )
  1208. ),
  1209. TP_fast_assign(
  1210. __entry->dev = inode->i_sb->s_dev;
  1211. __entry->ino = inode->i_ino;
  1212. __entry->m_lblk = map->m_lblk;
  1213. __entry->m_len = map->m_len;
  1214. __entry->u_lblk = le32_to_cpu(ux->ee_block);
  1215. __entry->u_len = ext4_ext_get_actual_len(ux);
  1216. __entry->u_pblk = ext4_ext_pblock(ux);
  1217. ),
  1218. TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
  1219. "u_pblk %llu",
  1220. MAJOR(__entry->dev), MINOR(__entry->dev),
  1221. (unsigned long) __entry->ino,
  1222. __entry->m_lblk, __entry->m_len,
  1223. __entry->u_lblk, __entry->u_len, __entry->u_pblk)
  1224. );
  1225. /*
  1226. * 'ux' is the uninitialized extent.
  1227. * 'ix' is the initialized extent to which blocks are transferred.
  1228. */
  1229. TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
  1230. TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
  1231. struct ext4_extent *ux, struct ext4_extent *ix),
  1232. TP_ARGS(inode, map, ux, ix),
  1233. TP_STRUCT__entry(
  1234. __field( dev_t, dev )
  1235. __field( ino_t, ino )
  1236. __field( ext4_lblk_t, m_lblk )
  1237. __field( unsigned, m_len )
  1238. __field( ext4_lblk_t, u_lblk )
  1239. __field( unsigned, u_len )
  1240. __field( ext4_fsblk_t, u_pblk )
  1241. __field( ext4_lblk_t, i_lblk )
  1242. __field( unsigned, i_len )
  1243. __field( ext4_fsblk_t, i_pblk )
  1244. ),
  1245. TP_fast_assign(
  1246. __entry->dev = inode->i_sb->s_dev;
  1247. __entry->ino = inode->i_ino;
  1248. __entry->m_lblk = map->m_lblk;
  1249. __entry->m_len = map->m_len;
  1250. __entry->u_lblk = le32_to_cpu(ux->ee_block);
  1251. __entry->u_len = ext4_ext_get_actual_len(ux);
  1252. __entry->u_pblk = ext4_ext_pblock(ux);
  1253. __entry->i_lblk = le32_to_cpu(ix->ee_block);
  1254. __entry->i_len = ext4_ext_get_actual_len(ix);
  1255. __entry->i_pblk = ext4_ext_pblock(ix);
  1256. ),
  1257. TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
  1258. "u_lblk %u u_len %u u_pblk %llu "
  1259. "i_lblk %u i_len %u i_pblk %llu ",
  1260. MAJOR(__entry->dev), MINOR(__entry->dev),
  1261. (unsigned long) __entry->ino,
  1262. __entry->m_lblk, __entry->m_len,
  1263. __entry->u_lblk, __entry->u_len, __entry->u_pblk,
  1264. __entry->i_lblk, __entry->i_len, __entry->i_pblk)
  1265. );
  1266. DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
  1267. TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
  1268. unsigned int len, unsigned int flags),
  1269. TP_ARGS(inode, lblk, len, flags),
  1270. TP_STRUCT__entry(
  1271. __field( dev_t, dev )
  1272. __field( ino_t, ino )
  1273. __field( ext4_lblk_t, lblk )
  1274. __field( unsigned int, len )
  1275. __field( unsigned int, flags )
  1276. ),
  1277. TP_fast_assign(
  1278. __entry->dev = inode->i_sb->s_dev;
  1279. __entry->ino = inode->i_ino;
  1280. __entry->lblk = lblk;
  1281. __entry->len = len;
  1282. __entry->flags = flags;
  1283. ),
  1284. TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
  1285. MAJOR(__entry->dev), MINOR(__entry->dev),
  1286. (unsigned long) __entry->ino,
  1287. __entry->lblk, __entry->len, show_map_flags(__entry->flags))
  1288. );
  1289. DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
  1290. TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
  1291. unsigned len, unsigned flags),
  1292. TP_ARGS(inode, lblk, len, flags)
  1293. );
  1294. DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
  1295. TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
  1296. unsigned len, unsigned flags),
  1297. TP_ARGS(inode, lblk, len, flags)
  1298. );
  1299. DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
  1300. TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map,
  1301. int ret),
  1302. TP_ARGS(inode, flags, map, ret),
  1303. TP_STRUCT__entry(
  1304. __field( dev_t, dev )
  1305. __field( ino_t, ino )
  1306. __field( unsigned int, flags )
  1307. __field( ext4_fsblk_t, pblk )
  1308. __field( ext4_lblk_t, lblk )
  1309. __field( unsigned int, len )
  1310. __field( unsigned int, mflags )
  1311. __field( int, ret )
  1312. ),
  1313. TP_fast_assign(
  1314. __entry->dev = inode->i_sb->s_dev;
  1315. __entry->ino = inode->i_ino;
  1316. __entry->flags = flags;
  1317. __entry->pblk = map->m_pblk;
  1318. __entry->lblk = map->m_lblk;
  1319. __entry->len = map->m_len;
  1320. __entry->mflags = map->m_flags;
  1321. __entry->ret = ret;
  1322. ),
  1323. TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
  1324. "mflags %s ret %d",
  1325. MAJOR(__entry->dev), MINOR(__entry->dev),
  1326. (unsigned long) __entry->ino,
  1327. show_map_flags(__entry->flags), __entry->lblk, __entry->pblk,
  1328. __entry->len, show_mflags(__entry->mflags), __entry->ret)
  1329. );
  1330. DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
  1331. TP_PROTO(struct inode *inode, unsigned flags,
  1332. struct ext4_map_blocks *map, int ret),
  1333. TP_ARGS(inode, flags, map, ret)
  1334. );
  1335. DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
  1336. TP_PROTO(struct inode *inode, unsigned flags,
  1337. struct ext4_map_blocks *map, int ret),
  1338. TP_ARGS(inode, flags, map, ret)
  1339. );
  1340. TRACE_EVENT(ext4_ext_load_extent,
  1341. TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
  1342. TP_ARGS(inode, lblk, pblk),
  1343. TP_STRUCT__entry(
  1344. __field( dev_t, dev )
  1345. __field( ino_t, ino )
  1346. __field( ext4_fsblk_t, pblk )
  1347. __field( ext4_lblk_t, lblk )
  1348. ),
  1349. TP_fast_assign(
  1350. __entry->dev = inode->i_sb->s_dev;
  1351. __entry->ino = inode->i_ino;
  1352. __entry->pblk = pblk;
  1353. __entry->lblk = lblk;
  1354. ),
  1355. TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
  1356. MAJOR(__entry->dev), MINOR(__entry->dev),
  1357. (unsigned long) __entry->ino,
  1358. __entry->lblk, __entry->pblk)
  1359. );
  1360. TRACE_EVENT(ext4_load_inode,
  1361. TP_PROTO(struct inode *inode),
  1362. TP_ARGS(inode),
  1363. TP_STRUCT__entry(
  1364. __field( dev_t, dev )
  1365. __field( ino_t, ino )
  1366. ),
  1367. TP_fast_assign(
  1368. __entry->dev = inode->i_sb->s_dev;
  1369. __entry->ino = inode->i_ino;
  1370. ),
  1371. TP_printk("dev %d,%d ino %ld",
  1372. MAJOR(__entry->dev), MINOR(__entry->dev),
  1373. (unsigned long) __entry->ino)
  1374. );
  1375. TRACE_EVENT(ext4_journal_start,
  1376. TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
  1377. unsigned long IP),
  1378. TP_ARGS(sb, blocks, rsv_blocks, IP),
  1379. TP_STRUCT__entry(
  1380. __field( dev_t, dev )
  1381. __field(unsigned long, ip )
  1382. __field( int, blocks )
  1383. __field( int, rsv_blocks )
  1384. ),
  1385. TP_fast_assign(
  1386. __entry->dev = sb->s_dev;
  1387. __entry->ip = IP;
  1388. __entry->blocks = blocks;
  1389. __entry->rsv_blocks = rsv_blocks;
  1390. ),
  1391. TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pF",
  1392. MAJOR(__entry->dev), MINOR(__entry->dev),
  1393. __entry->blocks, __entry->rsv_blocks, (void *)__entry->ip)
  1394. );
  1395. TRACE_EVENT(ext4_journal_start_reserved,
  1396. TP_PROTO(struct super_block *sb, int blocks, unsigned long IP),
  1397. TP_ARGS(sb, blocks, IP),
  1398. TP_STRUCT__entry(
  1399. __field( dev_t, dev )
  1400. __field(unsigned long, ip )
  1401. __field( int, blocks )
  1402. ),
  1403. TP_fast_assign(
  1404. __entry->dev = sb->s_dev;
  1405. __entry->ip = IP;
  1406. __entry->blocks = blocks;
  1407. ),
  1408. TP_printk("dev %d,%d blocks, %d caller %pF",
  1409. MAJOR(__entry->dev), MINOR(__entry->dev),
  1410. __entry->blocks, (void *)__entry->ip)
  1411. );
  1412. DECLARE_EVENT_CLASS(ext4__trim,
  1413. TP_PROTO(struct super_block *sb,
  1414. ext4_group_t group,
  1415. ext4_grpblk_t start,
  1416. ext4_grpblk_t len),
  1417. TP_ARGS(sb, group, start, len),
  1418. TP_STRUCT__entry(
  1419. __field( int, dev_major )
  1420. __field( int, dev_minor )
  1421. __field( __u32, group )
  1422. __field( int, start )
  1423. __field( int, len )
  1424. ),
  1425. TP_fast_assign(
  1426. __entry->dev_major = MAJOR(sb->s_dev);
  1427. __entry->dev_minor = MINOR(sb->s_dev);
  1428. __entry->group = group;
  1429. __entry->start = start;
  1430. __entry->len = len;
  1431. ),
  1432. TP_printk("dev %d,%d group %u, start %d, len %d",
  1433. __entry->dev_major, __entry->dev_minor,
  1434. __entry->group, __entry->start, __entry->len)
  1435. );
  1436. DEFINE_EVENT(ext4__trim, ext4_trim_extent,
  1437. TP_PROTO(struct super_block *sb,
  1438. ext4_group_t group,
  1439. ext4_grpblk_t start,
  1440. ext4_grpblk_t len),
  1441. TP_ARGS(sb, group, start, len)
  1442. );
  1443. DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
  1444. TP_PROTO(struct super_block *sb,
  1445. ext4_group_t group,
  1446. ext4_grpblk_t start,
  1447. ext4_grpblk_t len),
  1448. TP_ARGS(sb, group, start, len)
  1449. );
  1450. TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
  1451. TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags,
  1452. unsigned int allocated, ext4_fsblk_t newblock),
  1453. TP_ARGS(inode, map, flags, allocated, newblock),
  1454. TP_STRUCT__entry(
  1455. __field( dev_t, dev )
  1456. __field( ino_t, ino )
  1457. __field( int, flags )
  1458. __field( ext4_lblk_t, lblk )
  1459. __field( ext4_fsblk_t, pblk )
  1460. __field( unsigned int, len )
  1461. __field( unsigned int, allocated )
  1462. __field( ext4_fsblk_t, newblk )
  1463. ),
  1464. TP_fast_assign(
  1465. __entry->dev = inode->i_sb->s_dev;
  1466. __entry->ino = inode->i_ino;
  1467. __entry->flags = flags;
  1468. __entry->lblk = map->m_lblk;
  1469. __entry->pblk = map->m_pblk;
  1470. __entry->len = map->m_len;
  1471. __entry->allocated = allocated;
  1472. __entry->newblk = newblock;
  1473. ),
  1474. TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %s "
  1475. "allocated %d newblock %llu",
  1476. MAJOR(__entry->dev), MINOR(__entry->dev),
  1477. (unsigned long) __entry->ino,
  1478. (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
  1479. __entry->len, show_map_flags(__entry->flags),
  1480. (unsigned int) __entry->allocated,
  1481. (unsigned long long) __entry->newblk)
  1482. );
  1483. TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
  1484. TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
  1485. TP_ARGS(sb, map, ret),
  1486. TP_STRUCT__entry(
  1487. __field( dev_t, dev )
  1488. __field( unsigned int, flags )
  1489. __field( ext4_lblk_t, lblk )
  1490. __field( ext4_fsblk_t, pblk )
  1491. __field( unsigned int, len )
  1492. __field( int, ret )
  1493. ),
  1494. TP_fast_assign(
  1495. __entry->dev = sb->s_dev;
  1496. __entry->flags = map->m_flags;
  1497. __entry->lblk = map->m_lblk;
  1498. __entry->pblk = map->m_pblk;
  1499. __entry->len = map->m_len;
  1500. __entry->ret = ret;
  1501. ),
  1502. TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %s ret %d",
  1503. MAJOR(__entry->dev), MINOR(__entry->dev),
  1504. __entry->lblk, (unsigned long long) __entry->pblk,
  1505. __entry->len, show_mflags(__entry->flags), __entry->ret)
  1506. );
  1507. TRACE_EVENT(ext4_ext_put_in_cache,
  1508. TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
  1509. ext4_fsblk_t start),
  1510. TP_ARGS(inode, lblk, len, start),
  1511. TP_STRUCT__entry(
  1512. __field( dev_t, dev )
  1513. __field( ino_t, ino )
  1514. __field( ext4_lblk_t, lblk )
  1515. __field( unsigned int, len )
  1516. __field( ext4_fsblk_t, start )
  1517. ),
  1518. TP_fast_assign(
  1519. __entry->dev = inode->i_sb->s_dev;
  1520. __entry->ino = inode->i_ino;
  1521. __entry->lblk = lblk;
  1522. __entry->len = len;
  1523. __entry->start = start;
  1524. ),
  1525. TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
  1526. MAJOR(__entry->dev), MINOR(__entry->dev),
  1527. (unsigned long) __entry->ino,
  1528. (unsigned) __entry->lblk,
  1529. __entry->len,
  1530. (unsigned long long) __entry->start)
  1531. );
  1532. TRACE_EVENT(ext4_ext_in_cache,
  1533. TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
  1534. TP_ARGS(inode, lblk, ret),
  1535. TP_STRUCT__entry(
  1536. __field( dev_t, dev )
  1537. __field( ino_t, ino )
  1538. __field( ext4_lblk_t, lblk )
  1539. __field( int, ret )
  1540. ),
  1541. TP_fast_assign(
  1542. __entry->dev = inode->i_sb->s_dev;
  1543. __entry->ino = inode->i_ino;
  1544. __entry->lblk = lblk;
  1545. __entry->ret = ret;
  1546. ),
  1547. TP_printk("dev %d,%d ino %lu lblk %u ret %d",
  1548. MAJOR(__entry->dev), MINOR(__entry->dev),
  1549. (unsigned long) __entry->ino,
  1550. (unsigned) __entry->lblk,
  1551. __entry->ret)
  1552. );
  1553. TRACE_EVENT(ext4_find_delalloc_range,
  1554. TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
  1555. int reverse, int found, ext4_lblk_t found_blk),
  1556. TP_ARGS(inode, from, to, reverse, found, found_blk),
  1557. TP_STRUCT__entry(
  1558. __field( dev_t, dev )
  1559. __field( ino_t, ino )
  1560. __field( ext4_lblk_t, from )
  1561. __field( ext4_lblk_t, to )
  1562. __field( int, reverse )
  1563. __field( int, found )
  1564. __field( ext4_lblk_t, found_blk )
  1565. ),
  1566. TP_fast_assign(
  1567. __entry->dev = inode->i_sb->s_dev;
  1568. __entry->ino = inode->i_ino;
  1569. __entry->from = from;
  1570. __entry->to = to;
  1571. __entry->reverse = reverse;
  1572. __entry->found = found;
  1573. __entry->found_blk = found_blk;
  1574. ),
  1575. TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
  1576. "(blk = %u)",
  1577. MAJOR(__entry->dev), MINOR(__entry->dev),
  1578. (unsigned long) __entry->ino,
  1579. (unsigned) __entry->from, (unsigned) __entry->to,
  1580. __entry->reverse, __entry->found,
  1581. (unsigned) __entry->found_blk)
  1582. );
  1583. TRACE_EVENT(ext4_get_reserved_cluster_alloc,
  1584. TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
  1585. TP_ARGS(inode, lblk, len),
  1586. TP_STRUCT__entry(
  1587. __field( dev_t, dev )
  1588. __field( ino_t, ino )
  1589. __field( ext4_lblk_t, lblk )
  1590. __field( unsigned int, len )
  1591. ),
  1592. TP_fast_assign(
  1593. __entry->dev = inode->i_sb->s_dev;
  1594. __entry->ino = inode->i_ino;
  1595. __entry->lblk = lblk;
  1596. __entry->len = len;
  1597. ),
  1598. TP_printk("dev %d,%d ino %lu lblk %u len %u",
  1599. MAJOR(__entry->dev), MINOR(__entry->dev),
  1600. (unsigned long) __entry->ino,
  1601. (unsigned) __entry->lblk,
  1602. __entry->len)
  1603. );
  1604. TRACE_EVENT(ext4_ext_show_extent,
  1605. TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
  1606. unsigned short len),
  1607. TP_ARGS(inode, lblk, pblk, len),
  1608. TP_STRUCT__entry(
  1609. __field( dev_t, dev )
  1610. __field( ino_t, ino )
  1611. __field( ext4_fsblk_t, pblk )
  1612. __field( ext4_lblk_t, lblk )
  1613. __field( unsigned short, len )
  1614. ),
  1615. TP_fast_assign(
  1616. __entry->dev = inode->i_sb->s_dev;
  1617. __entry->ino = inode->i_ino;
  1618. __entry->pblk = pblk;
  1619. __entry->lblk = lblk;
  1620. __entry->len = len;
  1621. ),
  1622. TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
  1623. MAJOR(__entry->dev), MINOR(__entry->dev),
  1624. (unsigned long) __entry->ino,
  1625. (unsigned) __entry->lblk,
  1626. (unsigned long long) __entry->pblk,
  1627. (unsigned short) __entry->len)
  1628. );
  1629. TRACE_EVENT(ext4_remove_blocks,
  1630. TP_PROTO(struct inode *inode, struct ext4_extent *ex,
  1631. ext4_lblk_t from, ext4_fsblk_t to,
  1632. long long partial_cluster),
  1633. TP_ARGS(inode, ex, from, to, partial_cluster),
  1634. TP_STRUCT__entry(
  1635. __field( dev_t, dev )
  1636. __field( ino_t, ino )
  1637. __field( ext4_lblk_t, from )
  1638. __field( ext4_lblk_t, to )
  1639. __field( long long, partial )
  1640. __field( ext4_fsblk_t, ee_pblk )
  1641. __field( ext4_lblk_t, ee_lblk )
  1642. __field( unsigned short, ee_len )
  1643. ),
  1644. TP_fast_assign(
  1645. __entry->dev = inode->i_sb->s_dev;
  1646. __entry->ino = inode->i_ino;
  1647. __entry->from = from;
  1648. __entry->to = to;
  1649. __entry->partial = partial_cluster;
  1650. __entry->ee_pblk = ext4_ext_pblock(ex);
  1651. __entry->ee_lblk = le32_to_cpu(ex->ee_block);
  1652. __entry->ee_len = ext4_ext_get_actual_len(ex);
  1653. ),
  1654. TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
  1655. "from %u to %u partial_cluster %lld",
  1656. MAJOR(__entry->dev), MINOR(__entry->dev),
  1657. (unsigned long) __entry->ino,
  1658. (unsigned) __entry->ee_lblk,
  1659. (unsigned long long) __entry->ee_pblk,
  1660. (unsigned short) __entry->ee_len,
  1661. (unsigned) __entry->from,
  1662. (unsigned) __entry->to,
  1663. (long long) __entry->partial)
  1664. );
  1665. TRACE_EVENT(ext4_ext_rm_leaf,
  1666. TP_PROTO(struct inode *inode, ext4_lblk_t start,
  1667. struct ext4_extent *ex,
  1668. long long partial_cluster),
  1669. TP_ARGS(inode, start, ex, partial_cluster),
  1670. TP_STRUCT__entry(
  1671. __field( dev_t, dev )
  1672. __field( ino_t, ino )
  1673. __field( long long, partial )
  1674. __field( ext4_lblk_t, start )
  1675. __field( ext4_lblk_t, ee_lblk )
  1676. __field( ext4_fsblk_t, ee_pblk )
  1677. __field( short, ee_len )
  1678. ),
  1679. TP_fast_assign(
  1680. __entry->dev = inode->i_sb->s_dev;
  1681. __entry->ino = inode->i_ino;
  1682. __entry->partial = partial_cluster;
  1683. __entry->start = start;
  1684. __entry->ee_lblk = le32_to_cpu(ex->ee_block);
  1685. __entry->ee_pblk = ext4_ext_pblock(ex);
  1686. __entry->ee_len = ext4_ext_get_actual_len(ex);
  1687. ),
  1688. TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
  1689. "partial_cluster %lld",
  1690. MAJOR(__entry->dev), MINOR(__entry->dev),
  1691. (unsigned long) __entry->ino,
  1692. (unsigned) __entry->start,
  1693. (unsigned) __entry->ee_lblk,
  1694. (unsigned long long) __entry->ee_pblk,
  1695. (unsigned short) __entry->ee_len,
  1696. (long long) __entry->partial)
  1697. );
  1698. TRACE_EVENT(ext4_ext_rm_idx,
  1699. TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
  1700. TP_ARGS(inode, pblk),
  1701. TP_STRUCT__entry(
  1702. __field( dev_t, dev )
  1703. __field( ino_t, ino )
  1704. __field( ext4_fsblk_t, pblk )
  1705. ),
  1706. TP_fast_assign(
  1707. __entry->dev = inode->i_sb->s_dev;
  1708. __entry->ino = inode->i_ino;
  1709. __entry->pblk = pblk;
  1710. ),
  1711. TP_printk("dev %d,%d ino %lu index_pblk %llu",
  1712. MAJOR(__entry->dev), MINOR(__entry->dev),
  1713. (unsigned long) __entry->ino,
  1714. (unsigned long long) __entry->pblk)
  1715. );
  1716. TRACE_EVENT(ext4_ext_remove_space,
  1717. TP_PROTO(struct inode *inode, ext4_lblk_t start,
  1718. ext4_lblk_t end, int depth),
  1719. TP_ARGS(inode, start, end, depth),
  1720. TP_STRUCT__entry(
  1721. __field( dev_t, dev )
  1722. __field( ino_t, ino )
  1723. __field( ext4_lblk_t, start )
  1724. __field( ext4_lblk_t, end )
  1725. __field( int, depth )
  1726. ),
  1727. TP_fast_assign(
  1728. __entry->dev = inode->i_sb->s_dev;
  1729. __entry->ino = inode->i_ino;
  1730. __entry->start = start;
  1731. __entry->end = end;
  1732. __entry->depth = depth;
  1733. ),
  1734. TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
  1735. MAJOR(__entry->dev), MINOR(__entry->dev),
  1736. (unsigned long) __entry->ino,
  1737. (unsigned) __entry->start,
  1738. (unsigned) __entry->end,
  1739. __entry->depth)
  1740. );
  1741. TRACE_EVENT(ext4_ext_remove_space_done,
  1742. TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end,
  1743. int depth, long long partial, __le16 eh_entries),
  1744. TP_ARGS(inode, start, end, depth, partial, eh_entries),
  1745. TP_STRUCT__entry(
  1746. __field( dev_t, dev )
  1747. __field( ino_t, ino )
  1748. __field( ext4_lblk_t, start )
  1749. __field( ext4_lblk_t, end )
  1750. __field( int, depth )
  1751. __field( long long, partial )
  1752. __field( unsigned short, eh_entries )
  1753. ),
  1754. TP_fast_assign(
  1755. __entry->dev = inode->i_sb->s_dev;
  1756. __entry->ino = inode->i_ino;
  1757. __entry->start = start;
  1758. __entry->end = end;
  1759. __entry->depth = depth;
  1760. __entry->partial = partial;
  1761. __entry->eh_entries = le16_to_cpu(eh_entries);
  1762. ),
  1763. TP_printk("dev %d,%d ino %lu since %u end %u depth %d partial %lld "
  1764. "remaining_entries %u",
  1765. MAJOR(__entry->dev), MINOR(__entry->dev),
  1766. (unsigned long) __entry->ino,
  1767. (unsigned) __entry->start,
  1768. (unsigned) __entry->end,
  1769. __entry->depth,
  1770. (long long) __entry->partial,
  1771. (unsigned short) __entry->eh_entries)
  1772. );
  1773. DECLARE_EVENT_CLASS(ext4__es_extent,
  1774. TP_PROTO(struct inode *inode, struct extent_status *es),
  1775. TP_ARGS(inode, es),
  1776. TP_STRUCT__entry(
  1777. __field( dev_t, dev )
  1778. __field( ino_t, ino )
  1779. __field( ext4_lblk_t, lblk )
  1780. __field( ext4_lblk_t, len )
  1781. __field( ext4_fsblk_t, pblk )
  1782. __field( char, status )
  1783. ),
  1784. TP_fast_assign(
  1785. __entry->dev = inode->i_sb->s_dev;
  1786. __entry->ino = inode->i_ino;
  1787. __entry->lblk = es->es_lblk;
  1788. __entry->len = es->es_len;
  1789. __entry->pblk = ext4_es_pblock(es);
  1790. __entry->status = ext4_es_status(es);
  1791. ),
  1792. TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
  1793. MAJOR(__entry->dev), MINOR(__entry->dev),
  1794. (unsigned long) __entry->ino,
  1795. __entry->lblk, __entry->len,
  1796. __entry->pblk, show_extent_status(__entry->status))
  1797. );
  1798. DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent,
  1799. TP_PROTO(struct inode *inode, struct extent_status *es),
  1800. TP_ARGS(inode, es)
  1801. );
  1802. DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent,
  1803. TP_PROTO(struct inode *inode, struct extent_status *es),
  1804. TP_ARGS(inode, es)
  1805. );
  1806. TRACE_EVENT(ext4_es_remove_extent,
  1807. TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len),
  1808. TP_ARGS(inode, lblk, len),
  1809. TP_STRUCT__entry(
  1810. __field( dev_t, dev )
  1811. __field( ino_t, ino )
  1812. __field( loff_t, lblk )
  1813. __field( loff_t, len )
  1814. ),
  1815. TP_fast_assign(
  1816. __entry->dev = inode->i_sb->s_dev;
  1817. __entry->ino = inode->i_ino;
  1818. __entry->lblk = lblk;
  1819. __entry->len = len;
  1820. ),
  1821. TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
  1822. MAJOR(__entry->dev), MINOR(__entry->dev),
  1823. (unsigned long) __entry->ino,
  1824. __entry->lblk, __entry->len)
  1825. );
  1826. TRACE_EVENT(ext4_es_find_delayed_extent_range_enter,
  1827. TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
  1828. TP_ARGS(inode, lblk),
  1829. TP_STRUCT__entry(
  1830. __field( dev_t, dev )
  1831. __field( ino_t, ino )
  1832. __field( ext4_lblk_t, lblk )
  1833. ),
  1834. TP_fast_assign(
  1835. __entry->dev = inode->i_sb->s_dev;
  1836. __entry->ino = inode->i_ino;
  1837. __entry->lblk = lblk;
  1838. ),
  1839. TP_printk("dev %d,%d ino %lu lblk %u",
  1840. MAJOR(__entry->dev), MINOR(__entry->dev),
  1841. (unsigned long) __entry->ino, __entry->lblk)
  1842. );
  1843. TRACE_EVENT(ext4_es_find_delayed_extent_range_exit,
  1844. TP_PROTO(struct inode *inode, struct extent_status *es),
  1845. TP_ARGS(inode, es),
  1846. TP_STRUCT__entry(
  1847. __field( dev_t, dev )
  1848. __field( ino_t, ino )
  1849. __field( ext4_lblk_t, lblk )
  1850. __field( ext4_lblk_t, len )
  1851. __field( ext4_fsblk_t, pblk )
  1852. __field( char, status )
  1853. ),
  1854. TP_fast_assign(
  1855. __entry->dev = inode->i_sb->s_dev;
  1856. __entry->ino = inode->i_ino;
  1857. __entry->lblk = es->es_lblk;
  1858. __entry->len = es->es_len;
  1859. __entry->pblk = ext4_es_pblock(es);
  1860. __entry->status = ext4_es_status(es);
  1861. ),
  1862. TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
  1863. MAJOR(__entry->dev), MINOR(__entry->dev),
  1864. (unsigned long) __entry->ino,
  1865. __entry->lblk, __entry->len,
  1866. __entry->pblk, show_extent_status(__entry->status))
  1867. );
  1868. TRACE_EVENT(ext4_es_lookup_extent_enter,
  1869. TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
  1870. TP_ARGS(inode, lblk),
  1871. TP_STRUCT__entry(
  1872. __field( dev_t, dev )
  1873. __field( ino_t, ino )
  1874. __field( ext4_lblk_t, lblk )
  1875. ),
  1876. TP_fast_assign(
  1877. __entry->dev = inode->i_sb->s_dev;
  1878. __entry->ino = inode->i_ino;
  1879. __entry->lblk = lblk;
  1880. ),
  1881. TP_printk("dev %d,%d ino %lu lblk %u",
  1882. MAJOR(__entry->dev), MINOR(__entry->dev),
  1883. (unsigned long) __entry->ino, __entry->lblk)
  1884. );
  1885. TRACE_EVENT(ext4_es_lookup_extent_exit,
  1886. TP_PROTO(struct inode *inode, struct extent_status *es,
  1887. int found),
  1888. TP_ARGS(inode, es, found),
  1889. TP_STRUCT__entry(
  1890. __field( dev_t, dev )
  1891. __field( ino_t, ino )
  1892. __field( ext4_lblk_t, lblk )
  1893. __field( ext4_lblk_t, len )
  1894. __field( ext4_fsblk_t, pblk )
  1895. __field( char, status )
  1896. __field( int, found )
  1897. ),
  1898. TP_fast_assign(
  1899. __entry->dev = inode->i_sb->s_dev;
  1900. __entry->ino = inode->i_ino;
  1901. __entry->lblk = es->es_lblk;
  1902. __entry->len = es->es_len;
  1903. __entry->pblk = ext4_es_pblock(es);
  1904. __entry->status = ext4_es_status(es);
  1905. __entry->found = found;
  1906. ),
  1907. TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
  1908. MAJOR(__entry->dev), MINOR(__entry->dev),
  1909. (unsigned long) __entry->ino, __entry->found,
  1910. __entry->lblk, __entry->len,
  1911. __entry->found ? __entry->pblk : 0,
  1912. show_extent_status(__entry->found ? __entry->status : 0))
  1913. );
  1914. TRACE_EVENT(ext4_es_shrink_enter,
  1915. TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
  1916. TP_ARGS(sb, nr_to_scan, cache_cnt),
  1917. TP_STRUCT__entry(
  1918. __field( dev_t, dev )
  1919. __field( int, nr_to_scan )
  1920. __field( int, cache_cnt )
  1921. ),
  1922. TP_fast_assign(
  1923. __entry->dev = sb->s_dev;
  1924. __entry->nr_to_scan = nr_to_scan;
  1925. __entry->cache_cnt = cache_cnt;
  1926. ),
  1927. TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
  1928. MAJOR(__entry->dev), MINOR(__entry->dev),
  1929. __entry->nr_to_scan, __entry->cache_cnt)
  1930. );
  1931. TRACE_EVENT(ext4_es_shrink_exit,
  1932. TP_PROTO(struct super_block *sb, int shrunk_nr, int cache_cnt),
  1933. TP_ARGS(sb, shrunk_nr, cache_cnt),
  1934. TP_STRUCT__entry(
  1935. __field( dev_t, dev )
  1936. __field( int, shrunk_nr )
  1937. __field( int, cache_cnt )
  1938. ),
  1939. TP_fast_assign(
  1940. __entry->dev = sb->s_dev;
  1941. __entry->shrunk_nr = shrunk_nr;
  1942. __entry->cache_cnt = cache_cnt;
  1943. ),
  1944. TP_printk("dev %d,%d shrunk_nr %d cache_cnt %d",
  1945. MAJOR(__entry->dev), MINOR(__entry->dev),
  1946. __entry->shrunk_nr, __entry->cache_cnt)
  1947. );
  1948. TRACE_EVENT(ext4_collapse_range,
  1949. TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
  1950. TP_ARGS(inode, offset, len),
  1951. TP_STRUCT__entry(
  1952. __field(dev_t, dev)
  1953. __field(ino_t, ino)
  1954. __field(loff_t, offset)
  1955. __field(loff_t, len)
  1956. ),
  1957. TP_fast_assign(
  1958. __entry->dev = inode->i_sb->s_dev;
  1959. __entry->ino = inode->i_ino;
  1960. __entry->offset = offset;
  1961. __entry->len = len;
  1962. ),
  1963. TP_printk("dev %d,%d ino %lu offset %lld len %lld",
  1964. MAJOR(__entry->dev), MINOR(__entry->dev),
  1965. (unsigned long) __entry->ino,
  1966. __entry->offset, __entry->len)
  1967. );
  1968. #endif /* _TRACE_EXT4_H */
  1969. /* This part must be outside protection */
  1970. #include <trace/define_trace.h>