ext4.h 65 KB

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