ext4.h 63 KB

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