xfs_trace.h 106 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413
  1. /*
  2. * Copyright (c) 2009, Christoph Hellwig
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #undef TRACE_SYSTEM
  19. #define TRACE_SYSTEM xfs
  20. #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
  21. #define _TRACE_XFS_H
  22. #include <linux/tracepoint.h>
  23. struct xfs_agf;
  24. struct xfs_alloc_arg;
  25. struct xfs_attr_list_context;
  26. struct xfs_buf_log_item;
  27. struct xfs_da_args;
  28. struct xfs_da_node_entry;
  29. struct xfs_dquot;
  30. struct xfs_log_item;
  31. struct xlog;
  32. struct xlog_ticket;
  33. struct xlog_recover;
  34. struct xlog_recover_item;
  35. struct xfs_buf_log_format;
  36. struct xfs_inode_log_format;
  37. struct xfs_bmbt_irec;
  38. struct xfs_btree_cur;
  39. struct xfs_refcount_irec;
  40. DECLARE_EVENT_CLASS(xfs_attr_list_class,
  41. TP_PROTO(struct xfs_attr_list_context *ctx),
  42. TP_ARGS(ctx),
  43. TP_STRUCT__entry(
  44. __field(dev_t, dev)
  45. __field(xfs_ino_t, ino)
  46. __field(u32, hashval)
  47. __field(u32, blkno)
  48. __field(u32, offset)
  49. __field(void *, alist)
  50. __field(int, bufsize)
  51. __field(int, count)
  52. __field(int, firstu)
  53. __field(int, dupcnt)
  54. __field(int, flags)
  55. ),
  56. TP_fast_assign(
  57. __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
  58. __entry->ino = ctx->dp->i_ino;
  59. __entry->hashval = ctx->cursor->hashval;
  60. __entry->blkno = ctx->cursor->blkno;
  61. __entry->offset = ctx->cursor->offset;
  62. __entry->alist = ctx->alist;
  63. __entry->bufsize = ctx->bufsize;
  64. __entry->count = ctx->count;
  65. __entry->firstu = ctx->firstu;
  66. __entry->flags = ctx->flags;
  67. ),
  68. TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
  69. "alist 0x%p size %u count %u firstu %u flags %d %s",
  70. MAJOR(__entry->dev), MINOR(__entry->dev),
  71. __entry->ino,
  72. __entry->hashval,
  73. __entry->blkno,
  74. __entry->offset,
  75. __entry->dupcnt,
  76. __entry->alist,
  77. __entry->bufsize,
  78. __entry->count,
  79. __entry->firstu,
  80. __entry->flags,
  81. __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
  82. )
  83. )
  84. #define DEFINE_ATTR_LIST_EVENT(name) \
  85. DEFINE_EVENT(xfs_attr_list_class, name, \
  86. TP_PROTO(struct xfs_attr_list_context *ctx), \
  87. TP_ARGS(ctx))
  88. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
  89. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
  90. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
  91. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
  92. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
  93. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
  94. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
  95. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
  96. DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
  97. DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
  98. DECLARE_EVENT_CLASS(xfs_perag_class,
  99. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
  100. unsigned long caller_ip),
  101. TP_ARGS(mp, agno, refcount, caller_ip),
  102. TP_STRUCT__entry(
  103. __field(dev_t, dev)
  104. __field(xfs_agnumber_t, agno)
  105. __field(int, refcount)
  106. __field(unsigned long, caller_ip)
  107. ),
  108. TP_fast_assign(
  109. __entry->dev = mp->m_super->s_dev;
  110. __entry->agno = agno;
  111. __entry->refcount = refcount;
  112. __entry->caller_ip = caller_ip;
  113. ),
  114. TP_printk("dev %d:%d agno %u refcount %d caller %ps",
  115. MAJOR(__entry->dev), MINOR(__entry->dev),
  116. __entry->agno,
  117. __entry->refcount,
  118. (char *)__entry->caller_ip)
  119. );
  120. #define DEFINE_PERAG_REF_EVENT(name) \
  121. DEFINE_EVENT(xfs_perag_class, name, \
  122. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
  123. unsigned long caller_ip), \
  124. TP_ARGS(mp, agno, refcount, caller_ip))
  125. DEFINE_PERAG_REF_EVENT(xfs_perag_get);
  126. DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
  127. DEFINE_PERAG_REF_EVENT(xfs_perag_put);
  128. DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
  129. DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
  130. DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
  131. DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
  132. DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks);
  133. DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks);
  134. DECLARE_EVENT_CLASS(xfs_ag_class,
  135. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
  136. TP_ARGS(mp, agno),
  137. TP_STRUCT__entry(
  138. __field(dev_t, dev)
  139. __field(xfs_agnumber_t, agno)
  140. ),
  141. TP_fast_assign(
  142. __entry->dev = mp->m_super->s_dev;
  143. __entry->agno = agno;
  144. ),
  145. TP_printk("dev %d:%d agno %u",
  146. MAJOR(__entry->dev), MINOR(__entry->dev),
  147. __entry->agno)
  148. );
  149. #define DEFINE_AG_EVENT(name) \
  150. DEFINE_EVENT(xfs_ag_class, name, \
  151. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
  152. TP_ARGS(mp, agno))
  153. DEFINE_AG_EVENT(xfs_read_agf);
  154. DEFINE_AG_EVENT(xfs_alloc_read_agf);
  155. DEFINE_AG_EVENT(xfs_read_agi);
  156. DEFINE_AG_EVENT(xfs_ialloc_read_agi);
  157. TRACE_EVENT(xfs_attr_list_node_descend,
  158. TP_PROTO(struct xfs_attr_list_context *ctx,
  159. struct xfs_da_node_entry *btree),
  160. TP_ARGS(ctx, btree),
  161. TP_STRUCT__entry(
  162. __field(dev_t, dev)
  163. __field(xfs_ino_t, ino)
  164. __field(u32, hashval)
  165. __field(u32, blkno)
  166. __field(u32, offset)
  167. __field(void *, alist)
  168. __field(int, bufsize)
  169. __field(int, count)
  170. __field(int, firstu)
  171. __field(int, dupcnt)
  172. __field(int, flags)
  173. __field(u32, bt_hashval)
  174. __field(u32, bt_before)
  175. ),
  176. TP_fast_assign(
  177. __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
  178. __entry->ino = ctx->dp->i_ino;
  179. __entry->hashval = ctx->cursor->hashval;
  180. __entry->blkno = ctx->cursor->blkno;
  181. __entry->offset = ctx->cursor->offset;
  182. __entry->alist = ctx->alist;
  183. __entry->bufsize = ctx->bufsize;
  184. __entry->count = ctx->count;
  185. __entry->firstu = ctx->firstu;
  186. __entry->flags = ctx->flags;
  187. __entry->bt_hashval = be32_to_cpu(btree->hashval);
  188. __entry->bt_before = be32_to_cpu(btree->before);
  189. ),
  190. TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
  191. "alist 0x%p size %u count %u firstu %u flags %d %s "
  192. "node hashval %u, node before %u",
  193. MAJOR(__entry->dev), MINOR(__entry->dev),
  194. __entry->ino,
  195. __entry->hashval,
  196. __entry->blkno,
  197. __entry->offset,
  198. __entry->dupcnt,
  199. __entry->alist,
  200. __entry->bufsize,
  201. __entry->count,
  202. __entry->firstu,
  203. __entry->flags,
  204. __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
  205. __entry->bt_hashval,
  206. __entry->bt_before)
  207. );
  208. TRACE_EVENT(xfs_iext_insert,
  209. TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
  210. struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
  211. TP_ARGS(ip, idx, r, state, caller_ip),
  212. TP_STRUCT__entry(
  213. __field(dev_t, dev)
  214. __field(xfs_ino_t, ino)
  215. __field(xfs_extnum_t, idx)
  216. __field(xfs_fileoff_t, startoff)
  217. __field(xfs_fsblock_t, startblock)
  218. __field(xfs_filblks_t, blockcount)
  219. __field(xfs_exntst_t, state)
  220. __field(int, bmap_state)
  221. __field(unsigned long, caller_ip)
  222. ),
  223. TP_fast_assign(
  224. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  225. __entry->ino = ip->i_ino;
  226. __entry->idx = idx;
  227. __entry->startoff = r->br_startoff;
  228. __entry->startblock = r->br_startblock;
  229. __entry->blockcount = r->br_blockcount;
  230. __entry->state = r->br_state;
  231. __entry->bmap_state = state;
  232. __entry->caller_ip = caller_ip;
  233. ),
  234. TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
  235. "offset %lld block %lld count %lld flag %d caller %ps",
  236. MAJOR(__entry->dev), MINOR(__entry->dev),
  237. __entry->ino,
  238. __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
  239. (long)__entry->idx,
  240. __entry->startoff,
  241. (__int64_t)__entry->startblock,
  242. __entry->blockcount,
  243. __entry->state,
  244. (char *)__entry->caller_ip)
  245. );
  246. DECLARE_EVENT_CLASS(xfs_bmap_class,
  247. TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
  248. unsigned long caller_ip),
  249. TP_ARGS(ip, idx, state, caller_ip),
  250. TP_STRUCT__entry(
  251. __field(dev_t, dev)
  252. __field(xfs_ino_t, ino)
  253. __field(xfs_extnum_t, idx)
  254. __field(xfs_fileoff_t, startoff)
  255. __field(xfs_fsblock_t, startblock)
  256. __field(xfs_filblks_t, blockcount)
  257. __field(xfs_exntst_t, state)
  258. __field(int, bmap_state)
  259. __field(unsigned long, caller_ip)
  260. ),
  261. TP_fast_assign(
  262. struct xfs_ifork *ifp;
  263. struct xfs_bmbt_irec r;
  264. ifp = xfs_iext_state_to_fork(ip, state);
  265. xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
  266. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  267. __entry->ino = ip->i_ino;
  268. __entry->idx = idx;
  269. __entry->startoff = r.br_startoff;
  270. __entry->startblock = r.br_startblock;
  271. __entry->blockcount = r.br_blockcount;
  272. __entry->state = r.br_state;
  273. __entry->bmap_state = state;
  274. __entry->caller_ip = caller_ip;
  275. ),
  276. TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
  277. "offset %lld block %lld count %lld flag %d caller %ps",
  278. MAJOR(__entry->dev), MINOR(__entry->dev),
  279. __entry->ino,
  280. __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
  281. (long)__entry->idx,
  282. __entry->startoff,
  283. (__int64_t)__entry->startblock,
  284. __entry->blockcount,
  285. __entry->state,
  286. (char *)__entry->caller_ip)
  287. )
  288. #define DEFINE_BMAP_EVENT(name) \
  289. DEFINE_EVENT(xfs_bmap_class, name, \
  290. TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
  291. unsigned long caller_ip), \
  292. TP_ARGS(ip, idx, state, caller_ip))
  293. DEFINE_BMAP_EVENT(xfs_iext_remove);
  294. DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
  295. DEFINE_BMAP_EVENT(xfs_bmap_post_update);
  296. DEFINE_BMAP_EVENT(xfs_extlist);
  297. DECLARE_EVENT_CLASS(xfs_buf_class,
  298. TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
  299. TP_ARGS(bp, caller_ip),
  300. TP_STRUCT__entry(
  301. __field(dev_t, dev)
  302. __field(xfs_daddr_t, bno)
  303. __field(int, nblks)
  304. __field(int, hold)
  305. __field(int, pincount)
  306. __field(unsigned, lockval)
  307. __field(unsigned, flags)
  308. __field(unsigned long, caller_ip)
  309. ),
  310. TP_fast_assign(
  311. __entry->dev = bp->b_target->bt_dev;
  312. __entry->bno = bp->b_bn;
  313. __entry->nblks = bp->b_length;
  314. __entry->hold = atomic_read(&bp->b_hold);
  315. __entry->pincount = atomic_read(&bp->b_pin_count);
  316. __entry->lockval = bp->b_sema.count;
  317. __entry->flags = bp->b_flags;
  318. __entry->caller_ip = caller_ip;
  319. ),
  320. TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
  321. "lock %d flags %s caller %ps",
  322. MAJOR(__entry->dev), MINOR(__entry->dev),
  323. (unsigned long long)__entry->bno,
  324. __entry->nblks,
  325. __entry->hold,
  326. __entry->pincount,
  327. __entry->lockval,
  328. __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
  329. (void *)__entry->caller_ip)
  330. )
  331. #define DEFINE_BUF_EVENT(name) \
  332. DEFINE_EVENT(xfs_buf_class, name, \
  333. TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
  334. TP_ARGS(bp, caller_ip))
  335. DEFINE_BUF_EVENT(xfs_buf_init);
  336. DEFINE_BUF_EVENT(xfs_buf_free);
  337. DEFINE_BUF_EVENT(xfs_buf_hold);
  338. DEFINE_BUF_EVENT(xfs_buf_rele);
  339. DEFINE_BUF_EVENT(xfs_buf_iodone);
  340. DEFINE_BUF_EVENT(xfs_buf_submit);
  341. DEFINE_BUF_EVENT(xfs_buf_submit_wait);
  342. DEFINE_BUF_EVENT(xfs_buf_bawrite);
  343. DEFINE_BUF_EVENT(xfs_buf_lock);
  344. DEFINE_BUF_EVENT(xfs_buf_lock_done);
  345. DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
  346. DEFINE_BUF_EVENT(xfs_buf_trylock);
  347. DEFINE_BUF_EVENT(xfs_buf_unlock);
  348. DEFINE_BUF_EVENT(xfs_buf_iowait);
  349. DEFINE_BUF_EVENT(xfs_buf_iowait_done);
  350. DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
  351. DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
  352. DEFINE_BUF_EVENT(xfs_buf_delwri_split);
  353. DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
  354. DEFINE_BUF_EVENT(xfs_buf_get_uncached);
  355. DEFINE_BUF_EVENT(xfs_bdstrat_shut);
  356. DEFINE_BUF_EVENT(xfs_buf_item_relse);
  357. DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
  358. DEFINE_BUF_EVENT(xfs_buf_error_relse);
  359. DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
  360. DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
  361. DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
  362. /* not really buffer traces, but the buf provides useful information */
  363. DEFINE_BUF_EVENT(xfs_btree_corrupt);
  364. DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
  365. DEFINE_BUF_EVENT(xfs_reset_dqcounts);
  366. DEFINE_BUF_EVENT(xfs_inode_item_push);
  367. /* pass flags explicitly */
  368. DECLARE_EVENT_CLASS(xfs_buf_flags_class,
  369. TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
  370. TP_ARGS(bp, flags, caller_ip),
  371. TP_STRUCT__entry(
  372. __field(dev_t, dev)
  373. __field(xfs_daddr_t, bno)
  374. __field(size_t, buffer_length)
  375. __field(int, hold)
  376. __field(int, pincount)
  377. __field(unsigned, lockval)
  378. __field(unsigned, flags)
  379. __field(unsigned long, caller_ip)
  380. ),
  381. TP_fast_assign(
  382. __entry->dev = bp->b_target->bt_dev;
  383. __entry->bno = bp->b_bn;
  384. __entry->buffer_length = BBTOB(bp->b_length);
  385. __entry->flags = flags;
  386. __entry->hold = atomic_read(&bp->b_hold);
  387. __entry->pincount = atomic_read(&bp->b_pin_count);
  388. __entry->lockval = bp->b_sema.count;
  389. __entry->caller_ip = caller_ip;
  390. ),
  391. TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
  392. "lock %d flags %s caller %ps",
  393. MAJOR(__entry->dev), MINOR(__entry->dev),
  394. (unsigned long long)__entry->bno,
  395. __entry->buffer_length,
  396. __entry->hold,
  397. __entry->pincount,
  398. __entry->lockval,
  399. __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
  400. (void *)__entry->caller_ip)
  401. )
  402. #define DEFINE_BUF_FLAGS_EVENT(name) \
  403. DEFINE_EVENT(xfs_buf_flags_class, name, \
  404. TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
  405. TP_ARGS(bp, flags, caller_ip))
  406. DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
  407. DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
  408. DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
  409. TRACE_EVENT(xfs_buf_ioerror,
  410. TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
  411. TP_ARGS(bp, error, caller_ip),
  412. TP_STRUCT__entry(
  413. __field(dev_t, dev)
  414. __field(xfs_daddr_t, bno)
  415. __field(size_t, buffer_length)
  416. __field(unsigned, flags)
  417. __field(int, hold)
  418. __field(int, pincount)
  419. __field(unsigned, lockval)
  420. __field(int, error)
  421. __field(unsigned long, caller_ip)
  422. ),
  423. TP_fast_assign(
  424. __entry->dev = bp->b_target->bt_dev;
  425. __entry->bno = bp->b_bn;
  426. __entry->buffer_length = BBTOB(bp->b_length);
  427. __entry->hold = atomic_read(&bp->b_hold);
  428. __entry->pincount = atomic_read(&bp->b_pin_count);
  429. __entry->lockval = bp->b_sema.count;
  430. __entry->error = error;
  431. __entry->flags = bp->b_flags;
  432. __entry->caller_ip = caller_ip;
  433. ),
  434. TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
  435. "lock %d error %d flags %s caller %ps",
  436. MAJOR(__entry->dev), MINOR(__entry->dev),
  437. (unsigned long long)__entry->bno,
  438. __entry->buffer_length,
  439. __entry->hold,
  440. __entry->pincount,
  441. __entry->lockval,
  442. __entry->error,
  443. __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
  444. (void *)__entry->caller_ip)
  445. );
  446. DECLARE_EVENT_CLASS(xfs_buf_item_class,
  447. TP_PROTO(struct xfs_buf_log_item *bip),
  448. TP_ARGS(bip),
  449. TP_STRUCT__entry(
  450. __field(dev_t, dev)
  451. __field(xfs_daddr_t, buf_bno)
  452. __field(size_t, buf_len)
  453. __field(int, buf_hold)
  454. __field(int, buf_pincount)
  455. __field(int, buf_lockval)
  456. __field(unsigned, buf_flags)
  457. __field(unsigned, bli_recur)
  458. __field(int, bli_refcount)
  459. __field(unsigned, bli_flags)
  460. __field(void *, li_desc)
  461. __field(unsigned, li_flags)
  462. ),
  463. TP_fast_assign(
  464. __entry->dev = bip->bli_buf->b_target->bt_dev;
  465. __entry->bli_flags = bip->bli_flags;
  466. __entry->bli_recur = bip->bli_recur;
  467. __entry->bli_refcount = atomic_read(&bip->bli_refcount);
  468. __entry->buf_bno = bip->bli_buf->b_bn;
  469. __entry->buf_len = BBTOB(bip->bli_buf->b_length);
  470. __entry->buf_flags = bip->bli_buf->b_flags;
  471. __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
  472. __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
  473. __entry->buf_lockval = bip->bli_buf->b_sema.count;
  474. __entry->li_desc = bip->bli_item.li_desc;
  475. __entry->li_flags = bip->bli_item.li_flags;
  476. ),
  477. TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
  478. "lock %d flags %s recur %d refcount %d bliflags %s "
  479. "lidesc 0x%p liflags %s",
  480. MAJOR(__entry->dev), MINOR(__entry->dev),
  481. (unsigned long long)__entry->buf_bno,
  482. __entry->buf_len,
  483. __entry->buf_hold,
  484. __entry->buf_pincount,
  485. __entry->buf_lockval,
  486. __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
  487. __entry->bli_recur,
  488. __entry->bli_refcount,
  489. __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
  490. __entry->li_desc,
  491. __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
  492. )
  493. #define DEFINE_BUF_ITEM_EVENT(name) \
  494. DEFINE_EVENT(xfs_buf_item_class, name, \
  495. TP_PROTO(struct xfs_buf_log_item *bip), \
  496. TP_ARGS(bip))
  497. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
  498. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
  499. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
  500. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
  501. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
  502. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
  503. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
  504. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
  505. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
  506. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
  507. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
  508. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
  509. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
  510. DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
  511. DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
  512. DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
  513. DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
  514. DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
  515. DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
  516. DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
  517. DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
  518. DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
  519. DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
  520. DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
  521. DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
  522. DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
  523. DECLARE_EVENT_CLASS(xfs_filestream_class,
  524. TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
  525. TP_ARGS(ip, agno),
  526. TP_STRUCT__entry(
  527. __field(dev_t, dev)
  528. __field(xfs_ino_t, ino)
  529. __field(xfs_agnumber_t, agno)
  530. __field(int, streams)
  531. ),
  532. TP_fast_assign(
  533. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  534. __entry->ino = ip->i_ino;
  535. __entry->agno = agno;
  536. __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
  537. ),
  538. TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
  539. MAJOR(__entry->dev), MINOR(__entry->dev),
  540. __entry->ino,
  541. __entry->agno,
  542. __entry->streams)
  543. )
  544. #define DEFINE_FILESTREAM_EVENT(name) \
  545. DEFINE_EVENT(xfs_filestream_class, name, \
  546. TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
  547. TP_ARGS(ip, agno))
  548. DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
  549. DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
  550. DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
  551. TRACE_EVENT(xfs_filestream_pick,
  552. TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
  553. xfs_extlen_t free, int nscan),
  554. TP_ARGS(ip, agno, free, nscan),
  555. TP_STRUCT__entry(
  556. __field(dev_t, dev)
  557. __field(xfs_ino_t, ino)
  558. __field(xfs_agnumber_t, agno)
  559. __field(int, streams)
  560. __field(xfs_extlen_t, free)
  561. __field(int, nscan)
  562. ),
  563. TP_fast_assign(
  564. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  565. __entry->ino = ip->i_ino;
  566. __entry->agno = agno;
  567. __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
  568. __entry->free = free;
  569. __entry->nscan = nscan;
  570. ),
  571. TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
  572. MAJOR(__entry->dev), MINOR(__entry->dev),
  573. __entry->ino,
  574. __entry->agno,
  575. __entry->streams,
  576. __entry->free,
  577. __entry->nscan)
  578. );
  579. DECLARE_EVENT_CLASS(xfs_lock_class,
  580. TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
  581. unsigned long caller_ip),
  582. TP_ARGS(ip, lock_flags, caller_ip),
  583. TP_STRUCT__entry(
  584. __field(dev_t, dev)
  585. __field(xfs_ino_t, ino)
  586. __field(int, lock_flags)
  587. __field(unsigned long, caller_ip)
  588. ),
  589. TP_fast_assign(
  590. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  591. __entry->ino = ip->i_ino;
  592. __entry->lock_flags = lock_flags;
  593. __entry->caller_ip = caller_ip;
  594. ),
  595. TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
  596. MAJOR(__entry->dev), MINOR(__entry->dev),
  597. __entry->ino,
  598. __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
  599. (void *)__entry->caller_ip)
  600. )
  601. #define DEFINE_LOCK_EVENT(name) \
  602. DEFINE_EVENT(xfs_lock_class, name, \
  603. TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
  604. unsigned long caller_ip), \
  605. TP_ARGS(ip, lock_flags, caller_ip))
  606. DEFINE_LOCK_EVENT(xfs_ilock);
  607. DEFINE_LOCK_EVENT(xfs_ilock_nowait);
  608. DEFINE_LOCK_EVENT(xfs_ilock_demote);
  609. DEFINE_LOCK_EVENT(xfs_iunlock);
  610. DECLARE_EVENT_CLASS(xfs_inode_class,
  611. TP_PROTO(struct xfs_inode *ip),
  612. TP_ARGS(ip),
  613. TP_STRUCT__entry(
  614. __field(dev_t, dev)
  615. __field(xfs_ino_t, ino)
  616. ),
  617. TP_fast_assign(
  618. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  619. __entry->ino = ip->i_ino;
  620. ),
  621. TP_printk("dev %d:%d ino 0x%llx",
  622. MAJOR(__entry->dev), MINOR(__entry->dev),
  623. __entry->ino)
  624. )
  625. #define DEFINE_INODE_EVENT(name) \
  626. DEFINE_EVENT(xfs_inode_class, name, \
  627. TP_PROTO(struct xfs_inode *ip), \
  628. TP_ARGS(ip))
  629. DEFINE_INODE_EVENT(xfs_iget_skip);
  630. DEFINE_INODE_EVENT(xfs_iget_reclaim);
  631. DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
  632. DEFINE_INODE_EVENT(xfs_iget_hit);
  633. DEFINE_INODE_EVENT(xfs_iget_miss);
  634. DEFINE_INODE_EVENT(xfs_getattr);
  635. DEFINE_INODE_EVENT(xfs_setattr);
  636. DEFINE_INODE_EVENT(xfs_readlink);
  637. DEFINE_INODE_EVENT(xfs_inactive_symlink);
  638. DEFINE_INODE_EVENT(xfs_alloc_file_space);
  639. DEFINE_INODE_EVENT(xfs_free_file_space);
  640. DEFINE_INODE_EVENT(xfs_zero_file_space);
  641. DEFINE_INODE_EVENT(xfs_collapse_file_space);
  642. DEFINE_INODE_EVENT(xfs_insert_file_space);
  643. DEFINE_INODE_EVENT(xfs_readdir);
  644. #ifdef CONFIG_XFS_POSIX_ACL
  645. DEFINE_INODE_EVENT(xfs_get_acl);
  646. #endif
  647. DEFINE_INODE_EVENT(xfs_vm_bmap);
  648. DEFINE_INODE_EVENT(xfs_file_ioctl);
  649. DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
  650. DEFINE_INODE_EVENT(xfs_ioctl_setattr);
  651. DEFINE_INODE_EVENT(xfs_dir_fsync);
  652. DEFINE_INODE_EVENT(xfs_file_fsync);
  653. DEFINE_INODE_EVENT(xfs_destroy_inode);
  654. DEFINE_INODE_EVENT(xfs_evict_inode);
  655. DEFINE_INODE_EVENT(xfs_update_time);
  656. DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
  657. DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
  658. DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
  659. DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
  660. DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
  661. DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
  662. DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
  663. DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
  664. DEFINE_INODE_EVENT(xfs_filemap_fault);
  665. DEFINE_INODE_EVENT(xfs_filemap_pmd_fault);
  666. DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
  667. DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
  668. DECLARE_EVENT_CLASS(xfs_iref_class,
  669. TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
  670. TP_ARGS(ip, caller_ip),
  671. TP_STRUCT__entry(
  672. __field(dev_t, dev)
  673. __field(xfs_ino_t, ino)
  674. __field(int, count)
  675. __field(int, pincount)
  676. __field(unsigned long, caller_ip)
  677. ),
  678. TP_fast_assign(
  679. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  680. __entry->ino = ip->i_ino;
  681. __entry->count = atomic_read(&VFS_I(ip)->i_count);
  682. __entry->pincount = atomic_read(&ip->i_pincount);
  683. __entry->caller_ip = caller_ip;
  684. ),
  685. TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
  686. MAJOR(__entry->dev), MINOR(__entry->dev),
  687. __entry->ino,
  688. __entry->count,
  689. __entry->pincount,
  690. (char *)__entry->caller_ip)
  691. )
  692. TRACE_EVENT(xfs_iomap_prealloc_size,
  693. TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
  694. unsigned int writeio_blocks),
  695. TP_ARGS(ip, blocks, shift, writeio_blocks),
  696. TP_STRUCT__entry(
  697. __field(dev_t, dev)
  698. __field(xfs_ino_t, ino)
  699. __field(xfs_fsblock_t, blocks)
  700. __field(int, shift)
  701. __field(unsigned int, writeio_blocks)
  702. ),
  703. TP_fast_assign(
  704. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  705. __entry->ino = ip->i_ino;
  706. __entry->blocks = blocks;
  707. __entry->shift = shift;
  708. __entry->writeio_blocks = writeio_blocks;
  709. ),
  710. TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
  711. "m_writeio_blocks %u",
  712. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
  713. __entry->blocks, __entry->shift, __entry->writeio_blocks)
  714. )
  715. TRACE_EVENT(xfs_irec_merge_pre,
  716. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
  717. uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
  718. TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
  719. TP_STRUCT__entry(
  720. __field(dev_t, dev)
  721. __field(xfs_agnumber_t, agno)
  722. __field(xfs_agino_t, agino)
  723. __field(uint16_t, holemask)
  724. __field(xfs_agino_t, nagino)
  725. __field(uint16_t, nholemask)
  726. ),
  727. TP_fast_assign(
  728. __entry->dev = mp->m_super->s_dev;
  729. __entry->agno = agno;
  730. __entry->agino = agino;
  731. __entry->holemask = holemask;
  732. __entry->nagino = nagino;
  733. __entry->nholemask = holemask;
  734. ),
  735. TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
  736. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
  737. __entry->agino, __entry->holemask, __entry->nagino,
  738. __entry->nholemask)
  739. )
  740. TRACE_EVENT(xfs_irec_merge_post,
  741. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
  742. uint16_t holemask),
  743. TP_ARGS(mp, agno, agino, holemask),
  744. TP_STRUCT__entry(
  745. __field(dev_t, dev)
  746. __field(xfs_agnumber_t, agno)
  747. __field(xfs_agino_t, agino)
  748. __field(uint16_t, holemask)
  749. ),
  750. TP_fast_assign(
  751. __entry->dev = mp->m_super->s_dev;
  752. __entry->agno = agno;
  753. __entry->agino = agino;
  754. __entry->holemask = holemask;
  755. ),
  756. TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
  757. MINOR(__entry->dev), __entry->agno, __entry->agino,
  758. __entry->holemask)
  759. )
  760. #define DEFINE_IREF_EVENT(name) \
  761. DEFINE_EVENT(xfs_iref_class, name, \
  762. TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
  763. TP_ARGS(ip, caller_ip))
  764. DEFINE_IREF_EVENT(xfs_ihold);
  765. DEFINE_IREF_EVENT(xfs_irele);
  766. DEFINE_IREF_EVENT(xfs_inode_pin);
  767. DEFINE_IREF_EVENT(xfs_inode_unpin);
  768. DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
  769. DECLARE_EVENT_CLASS(xfs_namespace_class,
  770. TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
  771. TP_ARGS(dp, name),
  772. TP_STRUCT__entry(
  773. __field(dev_t, dev)
  774. __field(xfs_ino_t, dp_ino)
  775. __field(int, namelen)
  776. __dynamic_array(char, name, name->len)
  777. ),
  778. TP_fast_assign(
  779. __entry->dev = VFS_I(dp)->i_sb->s_dev;
  780. __entry->dp_ino = dp->i_ino;
  781. __entry->namelen = name->len;
  782. memcpy(__get_str(name), name->name, name->len);
  783. ),
  784. TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
  785. MAJOR(__entry->dev), MINOR(__entry->dev),
  786. __entry->dp_ino,
  787. __entry->namelen,
  788. __get_str(name))
  789. )
  790. #define DEFINE_NAMESPACE_EVENT(name) \
  791. DEFINE_EVENT(xfs_namespace_class, name, \
  792. TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
  793. TP_ARGS(dp, name))
  794. DEFINE_NAMESPACE_EVENT(xfs_remove);
  795. DEFINE_NAMESPACE_EVENT(xfs_link);
  796. DEFINE_NAMESPACE_EVENT(xfs_lookup);
  797. DEFINE_NAMESPACE_EVENT(xfs_create);
  798. DEFINE_NAMESPACE_EVENT(xfs_symlink);
  799. TRACE_EVENT(xfs_rename,
  800. TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
  801. struct xfs_name *src_name, struct xfs_name *target_name),
  802. TP_ARGS(src_dp, target_dp, src_name, target_name),
  803. TP_STRUCT__entry(
  804. __field(dev_t, dev)
  805. __field(xfs_ino_t, src_dp_ino)
  806. __field(xfs_ino_t, target_dp_ino)
  807. __field(int, src_namelen)
  808. __field(int, target_namelen)
  809. __dynamic_array(char, src_name, src_name->len)
  810. __dynamic_array(char, target_name, target_name->len)
  811. ),
  812. TP_fast_assign(
  813. __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
  814. __entry->src_dp_ino = src_dp->i_ino;
  815. __entry->target_dp_ino = target_dp->i_ino;
  816. __entry->src_namelen = src_name->len;
  817. __entry->target_namelen = target_name->len;
  818. memcpy(__get_str(src_name), src_name->name, src_name->len);
  819. memcpy(__get_str(target_name), target_name->name,
  820. target_name->len);
  821. ),
  822. TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
  823. " src name %.*s target name %.*s",
  824. MAJOR(__entry->dev), MINOR(__entry->dev),
  825. __entry->src_dp_ino,
  826. __entry->target_dp_ino,
  827. __entry->src_namelen,
  828. __get_str(src_name),
  829. __entry->target_namelen,
  830. __get_str(target_name))
  831. )
  832. DECLARE_EVENT_CLASS(xfs_dquot_class,
  833. TP_PROTO(struct xfs_dquot *dqp),
  834. TP_ARGS(dqp),
  835. TP_STRUCT__entry(
  836. __field(dev_t, dev)
  837. __field(u32, id)
  838. __field(unsigned, flags)
  839. __field(unsigned, nrefs)
  840. __field(unsigned long long, res_bcount)
  841. __field(unsigned long long, bcount)
  842. __field(unsigned long long, icount)
  843. __field(unsigned long long, blk_hardlimit)
  844. __field(unsigned long long, blk_softlimit)
  845. __field(unsigned long long, ino_hardlimit)
  846. __field(unsigned long long, ino_softlimit)
  847. ), \
  848. TP_fast_assign(
  849. __entry->dev = dqp->q_mount->m_super->s_dev;
  850. __entry->id = be32_to_cpu(dqp->q_core.d_id);
  851. __entry->flags = dqp->dq_flags;
  852. __entry->nrefs = dqp->q_nrefs;
  853. __entry->res_bcount = dqp->q_res_bcount;
  854. __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
  855. __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
  856. __entry->blk_hardlimit =
  857. be64_to_cpu(dqp->q_core.d_blk_hardlimit);
  858. __entry->blk_softlimit =
  859. be64_to_cpu(dqp->q_core.d_blk_softlimit);
  860. __entry->ino_hardlimit =
  861. be64_to_cpu(dqp->q_core.d_ino_hardlimit);
  862. __entry->ino_softlimit =
  863. be64_to_cpu(dqp->q_core.d_ino_softlimit);
  864. ),
  865. TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
  866. "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
  867. "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
  868. MAJOR(__entry->dev), MINOR(__entry->dev),
  869. __entry->id,
  870. __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
  871. __entry->nrefs,
  872. __entry->res_bcount,
  873. __entry->bcount,
  874. __entry->blk_hardlimit,
  875. __entry->blk_softlimit,
  876. __entry->icount,
  877. __entry->ino_hardlimit,
  878. __entry->ino_softlimit)
  879. )
  880. #define DEFINE_DQUOT_EVENT(name) \
  881. DEFINE_EVENT(xfs_dquot_class, name, \
  882. TP_PROTO(struct xfs_dquot *dqp), \
  883. TP_ARGS(dqp))
  884. DEFINE_DQUOT_EVENT(xfs_dqadjust);
  885. DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
  886. DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
  887. DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
  888. DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
  889. DEFINE_DQUOT_EVENT(xfs_dqattach_found);
  890. DEFINE_DQUOT_EVENT(xfs_dqattach_get);
  891. DEFINE_DQUOT_EVENT(xfs_dqalloc);
  892. DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
  893. DEFINE_DQUOT_EVENT(xfs_dqread);
  894. DEFINE_DQUOT_EVENT(xfs_dqread_fail);
  895. DEFINE_DQUOT_EVENT(xfs_dqget_hit);
  896. DEFINE_DQUOT_EVENT(xfs_dqget_miss);
  897. DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
  898. DEFINE_DQUOT_EVENT(xfs_dqget_dup);
  899. DEFINE_DQUOT_EVENT(xfs_dqput);
  900. DEFINE_DQUOT_EVENT(xfs_dqput_wait);
  901. DEFINE_DQUOT_EVENT(xfs_dqput_free);
  902. DEFINE_DQUOT_EVENT(xfs_dqrele);
  903. DEFINE_DQUOT_EVENT(xfs_dqflush);
  904. DEFINE_DQUOT_EVENT(xfs_dqflush_force);
  905. DEFINE_DQUOT_EVENT(xfs_dqflush_done);
  906. DECLARE_EVENT_CLASS(xfs_loggrant_class,
  907. TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
  908. TP_ARGS(log, tic),
  909. TP_STRUCT__entry(
  910. __field(dev_t, dev)
  911. __field(char, ocnt)
  912. __field(char, cnt)
  913. __field(int, curr_res)
  914. __field(int, unit_res)
  915. __field(unsigned int, flags)
  916. __field(int, reserveq)
  917. __field(int, writeq)
  918. __field(int, grant_reserve_cycle)
  919. __field(int, grant_reserve_bytes)
  920. __field(int, grant_write_cycle)
  921. __field(int, grant_write_bytes)
  922. __field(int, curr_cycle)
  923. __field(int, curr_block)
  924. __field(xfs_lsn_t, tail_lsn)
  925. ),
  926. TP_fast_assign(
  927. __entry->dev = log->l_mp->m_super->s_dev;
  928. __entry->ocnt = tic->t_ocnt;
  929. __entry->cnt = tic->t_cnt;
  930. __entry->curr_res = tic->t_curr_res;
  931. __entry->unit_res = tic->t_unit_res;
  932. __entry->flags = tic->t_flags;
  933. __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
  934. __entry->writeq = list_empty(&log->l_write_head.waiters);
  935. xlog_crack_grant_head(&log->l_reserve_head.grant,
  936. &__entry->grant_reserve_cycle,
  937. &__entry->grant_reserve_bytes);
  938. xlog_crack_grant_head(&log->l_write_head.grant,
  939. &__entry->grant_write_cycle,
  940. &__entry->grant_write_bytes);
  941. __entry->curr_cycle = log->l_curr_cycle;
  942. __entry->curr_block = log->l_curr_block;
  943. __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
  944. ),
  945. TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
  946. "t_unit_res %u t_flags %s reserveq %s "
  947. "writeq %s grant_reserve_cycle %d "
  948. "grant_reserve_bytes %d grant_write_cycle %d "
  949. "grant_write_bytes %d curr_cycle %d curr_block %d "
  950. "tail_cycle %d tail_block %d",
  951. MAJOR(__entry->dev), MINOR(__entry->dev),
  952. __entry->ocnt,
  953. __entry->cnt,
  954. __entry->curr_res,
  955. __entry->unit_res,
  956. __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
  957. __entry->reserveq ? "empty" : "active",
  958. __entry->writeq ? "empty" : "active",
  959. __entry->grant_reserve_cycle,
  960. __entry->grant_reserve_bytes,
  961. __entry->grant_write_cycle,
  962. __entry->grant_write_bytes,
  963. __entry->curr_cycle,
  964. __entry->curr_block,
  965. CYCLE_LSN(__entry->tail_lsn),
  966. BLOCK_LSN(__entry->tail_lsn)
  967. )
  968. )
  969. #define DEFINE_LOGGRANT_EVENT(name) \
  970. DEFINE_EVENT(xfs_loggrant_class, name, \
  971. TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
  972. TP_ARGS(log, tic))
  973. DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
  974. DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
  975. DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
  976. DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
  977. DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
  978. DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
  979. DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
  980. DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
  981. DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
  982. DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
  983. DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
  984. DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
  985. DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
  986. DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
  987. DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
  988. DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
  989. DECLARE_EVENT_CLASS(xfs_log_item_class,
  990. TP_PROTO(struct xfs_log_item *lip),
  991. TP_ARGS(lip),
  992. TP_STRUCT__entry(
  993. __field(dev_t, dev)
  994. __field(void *, lip)
  995. __field(uint, type)
  996. __field(uint, flags)
  997. __field(xfs_lsn_t, lsn)
  998. ),
  999. TP_fast_assign(
  1000. __entry->dev = lip->li_mountp->m_super->s_dev;
  1001. __entry->lip = lip;
  1002. __entry->type = lip->li_type;
  1003. __entry->flags = lip->li_flags;
  1004. __entry->lsn = lip->li_lsn;
  1005. ),
  1006. TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
  1007. MAJOR(__entry->dev), MINOR(__entry->dev),
  1008. __entry->lip,
  1009. CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
  1010. __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
  1011. __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
  1012. )
  1013. TRACE_EVENT(xfs_log_force,
  1014. TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
  1015. TP_ARGS(mp, lsn, caller_ip),
  1016. TP_STRUCT__entry(
  1017. __field(dev_t, dev)
  1018. __field(xfs_lsn_t, lsn)
  1019. __field(unsigned long, caller_ip)
  1020. ),
  1021. TP_fast_assign(
  1022. __entry->dev = mp->m_super->s_dev;
  1023. __entry->lsn = lsn;
  1024. __entry->caller_ip = caller_ip;
  1025. ),
  1026. TP_printk("dev %d:%d lsn 0x%llx caller %ps",
  1027. MAJOR(__entry->dev), MINOR(__entry->dev),
  1028. __entry->lsn, (void *)__entry->caller_ip)
  1029. )
  1030. #define DEFINE_LOG_ITEM_EVENT(name) \
  1031. DEFINE_EVENT(xfs_log_item_class, name, \
  1032. TP_PROTO(struct xfs_log_item *lip), \
  1033. TP_ARGS(lip))
  1034. DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
  1035. DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
  1036. DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
  1037. DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
  1038. DECLARE_EVENT_CLASS(xfs_ail_class,
  1039. TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
  1040. TP_ARGS(lip, old_lsn, new_lsn),
  1041. TP_STRUCT__entry(
  1042. __field(dev_t, dev)
  1043. __field(void *, lip)
  1044. __field(uint, type)
  1045. __field(uint, flags)
  1046. __field(xfs_lsn_t, old_lsn)
  1047. __field(xfs_lsn_t, new_lsn)
  1048. ),
  1049. TP_fast_assign(
  1050. __entry->dev = lip->li_mountp->m_super->s_dev;
  1051. __entry->lip = lip;
  1052. __entry->type = lip->li_type;
  1053. __entry->flags = lip->li_flags;
  1054. __entry->old_lsn = old_lsn;
  1055. __entry->new_lsn = new_lsn;
  1056. ),
  1057. TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
  1058. MAJOR(__entry->dev), MINOR(__entry->dev),
  1059. __entry->lip,
  1060. CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
  1061. CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
  1062. __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
  1063. __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
  1064. )
  1065. #define DEFINE_AIL_EVENT(name) \
  1066. DEFINE_EVENT(xfs_ail_class, name, \
  1067. TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
  1068. TP_ARGS(lip, old_lsn, new_lsn))
  1069. DEFINE_AIL_EVENT(xfs_ail_insert);
  1070. DEFINE_AIL_EVENT(xfs_ail_move);
  1071. DEFINE_AIL_EVENT(xfs_ail_delete);
  1072. TRACE_EVENT(xfs_log_assign_tail_lsn,
  1073. TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
  1074. TP_ARGS(log, new_lsn),
  1075. TP_STRUCT__entry(
  1076. __field(dev_t, dev)
  1077. __field(xfs_lsn_t, new_lsn)
  1078. __field(xfs_lsn_t, old_lsn)
  1079. __field(xfs_lsn_t, last_sync_lsn)
  1080. ),
  1081. TP_fast_assign(
  1082. __entry->dev = log->l_mp->m_super->s_dev;
  1083. __entry->new_lsn = new_lsn;
  1084. __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
  1085. __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
  1086. ),
  1087. TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
  1088. MAJOR(__entry->dev), MINOR(__entry->dev),
  1089. CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
  1090. CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
  1091. CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
  1092. )
  1093. DECLARE_EVENT_CLASS(xfs_file_class,
  1094. TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
  1095. TP_ARGS(ip, count, offset),
  1096. TP_STRUCT__entry(
  1097. __field(dev_t, dev)
  1098. __field(xfs_ino_t, ino)
  1099. __field(xfs_fsize_t, size)
  1100. __field(loff_t, offset)
  1101. __field(size_t, count)
  1102. ),
  1103. TP_fast_assign(
  1104. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1105. __entry->ino = ip->i_ino;
  1106. __entry->size = ip->i_d.di_size;
  1107. __entry->offset = offset;
  1108. __entry->count = count;
  1109. ),
  1110. TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
  1111. MAJOR(__entry->dev), MINOR(__entry->dev),
  1112. __entry->ino,
  1113. __entry->size,
  1114. __entry->offset,
  1115. __entry->count)
  1116. )
  1117. #define DEFINE_RW_EVENT(name) \
  1118. DEFINE_EVENT(xfs_file_class, name, \
  1119. TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
  1120. TP_ARGS(ip, count, offset))
  1121. DEFINE_RW_EVENT(xfs_file_buffered_read);
  1122. DEFINE_RW_EVENT(xfs_file_direct_read);
  1123. DEFINE_RW_EVENT(xfs_file_dax_read);
  1124. DEFINE_RW_EVENT(xfs_file_buffered_write);
  1125. DEFINE_RW_EVENT(xfs_file_direct_write);
  1126. DEFINE_RW_EVENT(xfs_file_dax_write);
  1127. DECLARE_EVENT_CLASS(xfs_page_class,
  1128. TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
  1129. unsigned int len),
  1130. TP_ARGS(inode, page, off, len),
  1131. TP_STRUCT__entry(
  1132. __field(dev_t, dev)
  1133. __field(xfs_ino_t, ino)
  1134. __field(pgoff_t, pgoff)
  1135. __field(loff_t, size)
  1136. __field(unsigned long, offset)
  1137. __field(unsigned int, length)
  1138. __field(int, delalloc)
  1139. __field(int, unwritten)
  1140. ),
  1141. TP_fast_assign(
  1142. int delalloc = -1, unwritten = -1;
  1143. if (page_has_buffers(page))
  1144. xfs_count_page_state(page, &delalloc, &unwritten);
  1145. __entry->dev = inode->i_sb->s_dev;
  1146. __entry->ino = XFS_I(inode)->i_ino;
  1147. __entry->pgoff = page_offset(page);
  1148. __entry->size = i_size_read(inode);
  1149. __entry->offset = off;
  1150. __entry->length = len;
  1151. __entry->delalloc = delalloc;
  1152. __entry->unwritten = unwritten;
  1153. ),
  1154. TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
  1155. "length %x delalloc %d unwritten %d",
  1156. MAJOR(__entry->dev), MINOR(__entry->dev),
  1157. __entry->ino,
  1158. __entry->pgoff,
  1159. __entry->size,
  1160. __entry->offset,
  1161. __entry->length,
  1162. __entry->delalloc,
  1163. __entry->unwritten)
  1164. )
  1165. #define DEFINE_PAGE_EVENT(name) \
  1166. DEFINE_EVENT(xfs_page_class, name, \
  1167. TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
  1168. unsigned int len), \
  1169. TP_ARGS(inode, page, off, len))
  1170. DEFINE_PAGE_EVENT(xfs_writepage);
  1171. DEFINE_PAGE_EVENT(xfs_releasepage);
  1172. DEFINE_PAGE_EVENT(xfs_invalidatepage);
  1173. DECLARE_EVENT_CLASS(xfs_readpage_class,
  1174. TP_PROTO(struct inode *inode, int nr_pages),
  1175. TP_ARGS(inode, nr_pages),
  1176. TP_STRUCT__entry(
  1177. __field(dev_t, dev)
  1178. __field(xfs_ino_t, ino)
  1179. __field(int, nr_pages)
  1180. ),
  1181. TP_fast_assign(
  1182. __entry->dev = inode->i_sb->s_dev;
  1183. __entry->ino = inode->i_ino;
  1184. __entry->nr_pages = nr_pages;
  1185. ),
  1186. TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
  1187. MAJOR(__entry->dev), MINOR(__entry->dev),
  1188. __entry->ino,
  1189. __entry->nr_pages)
  1190. )
  1191. #define DEFINE_READPAGE_EVENT(name) \
  1192. DEFINE_EVENT(xfs_readpage_class, name, \
  1193. TP_PROTO(struct inode *inode, int nr_pages), \
  1194. TP_ARGS(inode, nr_pages))
  1195. DEFINE_READPAGE_EVENT(xfs_vm_readpage);
  1196. DEFINE_READPAGE_EVENT(xfs_vm_readpages);
  1197. DECLARE_EVENT_CLASS(xfs_imap_class,
  1198. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
  1199. int type, struct xfs_bmbt_irec *irec),
  1200. TP_ARGS(ip, offset, count, type, irec),
  1201. TP_STRUCT__entry(
  1202. __field(dev_t, dev)
  1203. __field(xfs_ino_t, ino)
  1204. __field(loff_t, size)
  1205. __field(loff_t, offset)
  1206. __field(size_t, count)
  1207. __field(int, type)
  1208. __field(xfs_fileoff_t, startoff)
  1209. __field(xfs_fsblock_t, startblock)
  1210. __field(xfs_filblks_t, blockcount)
  1211. ),
  1212. TP_fast_assign(
  1213. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1214. __entry->ino = ip->i_ino;
  1215. __entry->size = ip->i_d.di_size;
  1216. __entry->offset = offset;
  1217. __entry->count = count;
  1218. __entry->type = type;
  1219. __entry->startoff = irec ? irec->br_startoff : 0;
  1220. __entry->startblock = irec ? irec->br_startblock : 0;
  1221. __entry->blockcount = irec ? irec->br_blockcount : 0;
  1222. ),
  1223. TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
  1224. "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
  1225. MAJOR(__entry->dev), MINOR(__entry->dev),
  1226. __entry->ino,
  1227. __entry->size,
  1228. __entry->offset,
  1229. __entry->count,
  1230. __print_symbolic(__entry->type, XFS_IO_TYPES),
  1231. __entry->startoff,
  1232. (__int64_t)__entry->startblock,
  1233. __entry->blockcount)
  1234. )
  1235. #define DEFINE_IOMAP_EVENT(name) \
  1236. DEFINE_EVENT(xfs_imap_class, name, \
  1237. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
  1238. int type, struct xfs_bmbt_irec *irec), \
  1239. TP_ARGS(ip, offset, count, type, irec))
  1240. DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
  1241. DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
  1242. DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
  1243. DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
  1244. DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
  1245. DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
  1246. DEFINE_IOMAP_EVENT(xfs_iomap_found);
  1247. DECLARE_EVENT_CLASS(xfs_simple_io_class,
  1248. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
  1249. TP_ARGS(ip, offset, count),
  1250. TP_STRUCT__entry(
  1251. __field(dev_t, dev)
  1252. __field(xfs_ino_t, ino)
  1253. __field(loff_t, isize)
  1254. __field(loff_t, disize)
  1255. __field(loff_t, offset)
  1256. __field(size_t, count)
  1257. ),
  1258. TP_fast_assign(
  1259. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1260. __entry->ino = ip->i_ino;
  1261. __entry->isize = VFS_I(ip)->i_size;
  1262. __entry->disize = ip->i_d.di_size;
  1263. __entry->offset = offset;
  1264. __entry->count = count;
  1265. ),
  1266. TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
  1267. "offset 0x%llx count %zd",
  1268. MAJOR(__entry->dev), MINOR(__entry->dev),
  1269. __entry->ino,
  1270. __entry->isize,
  1271. __entry->disize,
  1272. __entry->offset,
  1273. __entry->count)
  1274. );
  1275. #define DEFINE_SIMPLE_IO_EVENT(name) \
  1276. DEFINE_EVENT(xfs_simple_io_class, name, \
  1277. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
  1278. TP_ARGS(ip, offset, count))
  1279. DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
  1280. DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
  1281. DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
  1282. DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
  1283. DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
  1284. DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
  1285. DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
  1286. DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
  1287. DECLARE_EVENT_CLASS(xfs_itrunc_class,
  1288. TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
  1289. TP_ARGS(ip, new_size),
  1290. TP_STRUCT__entry(
  1291. __field(dev_t, dev)
  1292. __field(xfs_ino_t, ino)
  1293. __field(xfs_fsize_t, size)
  1294. __field(xfs_fsize_t, new_size)
  1295. ),
  1296. TP_fast_assign(
  1297. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1298. __entry->ino = ip->i_ino;
  1299. __entry->size = ip->i_d.di_size;
  1300. __entry->new_size = new_size;
  1301. ),
  1302. TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
  1303. MAJOR(__entry->dev), MINOR(__entry->dev),
  1304. __entry->ino,
  1305. __entry->size,
  1306. __entry->new_size)
  1307. )
  1308. #define DEFINE_ITRUNC_EVENT(name) \
  1309. DEFINE_EVENT(xfs_itrunc_class, name, \
  1310. TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
  1311. TP_ARGS(ip, new_size))
  1312. DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
  1313. DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
  1314. TRACE_EVENT(xfs_pagecache_inval,
  1315. TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
  1316. TP_ARGS(ip, start, finish),
  1317. TP_STRUCT__entry(
  1318. __field(dev_t, dev)
  1319. __field(xfs_ino_t, ino)
  1320. __field(xfs_fsize_t, size)
  1321. __field(xfs_off_t, start)
  1322. __field(xfs_off_t, finish)
  1323. ),
  1324. TP_fast_assign(
  1325. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1326. __entry->ino = ip->i_ino;
  1327. __entry->size = ip->i_d.di_size;
  1328. __entry->start = start;
  1329. __entry->finish = finish;
  1330. ),
  1331. TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
  1332. MAJOR(__entry->dev), MINOR(__entry->dev),
  1333. __entry->ino,
  1334. __entry->size,
  1335. __entry->start,
  1336. __entry->finish)
  1337. );
  1338. TRACE_EVENT(xfs_bunmap,
  1339. TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
  1340. int flags, unsigned long caller_ip),
  1341. TP_ARGS(ip, bno, len, flags, caller_ip),
  1342. TP_STRUCT__entry(
  1343. __field(dev_t, dev)
  1344. __field(xfs_ino_t, ino)
  1345. __field(xfs_fsize_t, size)
  1346. __field(xfs_fileoff_t, bno)
  1347. __field(xfs_filblks_t, len)
  1348. __field(unsigned long, caller_ip)
  1349. __field(int, flags)
  1350. ),
  1351. TP_fast_assign(
  1352. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1353. __entry->ino = ip->i_ino;
  1354. __entry->size = ip->i_d.di_size;
  1355. __entry->bno = bno;
  1356. __entry->len = len;
  1357. __entry->caller_ip = caller_ip;
  1358. __entry->flags = flags;
  1359. ),
  1360. TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
  1361. "flags %s caller %ps",
  1362. MAJOR(__entry->dev), MINOR(__entry->dev),
  1363. __entry->ino,
  1364. __entry->size,
  1365. __entry->bno,
  1366. __entry->len,
  1367. __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
  1368. (void *)__entry->caller_ip)
  1369. );
  1370. DECLARE_EVENT_CLASS(xfs_extent_busy_class,
  1371. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  1372. xfs_agblock_t agbno, xfs_extlen_t len),
  1373. TP_ARGS(mp, agno, agbno, len),
  1374. TP_STRUCT__entry(
  1375. __field(dev_t, dev)
  1376. __field(xfs_agnumber_t, agno)
  1377. __field(xfs_agblock_t, agbno)
  1378. __field(xfs_extlen_t, len)
  1379. ),
  1380. TP_fast_assign(
  1381. __entry->dev = mp->m_super->s_dev;
  1382. __entry->agno = agno;
  1383. __entry->agbno = agbno;
  1384. __entry->len = len;
  1385. ),
  1386. TP_printk("dev %d:%d agno %u agbno %u len %u",
  1387. MAJOR(__entry->dev), MINOR(__entry->dev),
  1388. __entry->agno,
  1389. __entry->agbno,
  1390. __entry->len)
  1391. );
  1392. #define DEFINE_BUSY_EVENT(name) \
  1393. DEFINE_EVENT(xfs_extent_busy_class, name, \
  1394. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  1395. xfs_agblock_t agbno, xfs_extlen_t len), \
  1396. TP_ARGS(mp, agno, agbno, len))
  1397. DEFINE_BUSY_EVENT(xfs_extent_busy);
  1398. DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
  1399. DEFINE_BUSY_EVENT(xfs_extent_busy_force);
  1400. DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
  1401. DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
  1402. TRACE_EVENT(xfs_extent_busy_trim,
  1403. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  1404. xfs_agblock_t agbno, xfs_extlen_t len,
  1405. xfs_agblock_t tbno, xfs_extlen_t tlen),
  1406. TP_ARGS(mp, agno, agbno, len, tbno, tlen),
  1407. TP_STRUCT__entry(
  1408. __field(dev_t, dev)
  1409. __field(xfs_agnumber_t, agno)
  1410. __field(xfs_agblock_t, agbno)
  1411. __field(xfs_extlen_t, len)
  1412. __field(xfs_agblock_t, tbno)
  1413. __field(xfs_extlen_t, tlen)
  1414. ),
  1415. TP_fast_assign(
  1416. __entry->dev = mp->m_super->s_dev;
  1417. __entry->agno = agno;
  1418. __entry->agbno = agbno;
  1419. __entry->len = len;
  1420. __entry->tbno = tbno;
  1421. __entry->tlen = tlen;
  1422. ),
  1423. TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
  1424. MAJOR(__entry->dev), MINOR(__entry->dev),
  1425. __entry->agno,
  1426. __entry->agbno,
  1427. __entry->len,
  1428. __entry->tbno,
  1429. __entry->tlen)
  1430. );
  1431. TRACE_EVENT(xfs_trans_commit_lsn,
  1432. TP_PROTO(struct xfs_trans *trans),
  1433. TP_ARGS(trans),
  1434. TP_STRUCT__entry(
  1435. __field(dev_t, dev)
  1436. __field(struct xfs_trans *, tp)
  1437. __field(xfs_lsn_t, lsn)
  1438. ),
  1439. TP_fast_assign(
  1440. __entry->dev = trans->t_mountp->m_super->s_dev;
  1441. __entry->tp = trans;
  1442. __entry->lsn = trans->t_commit_lsn;
  1443. ),
  1444. TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
  1445. MAJOR(__entry->dev), MINOR(__entry->dev),
  1446. __entry->tp,
  1447. __entry->lsn)
  1448. );
  1449. DECLARE_EVENT_CLASS(xfs_agf_class,
  1450. TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
  1451. unsigned long caller_ip),
  1452. TP_ARGS(mp, agf, flags, caller_ip),
  1453. TP_STRUCT__entry(
  1454. __field(dev_t, dev)
  1455. __field(xfs_agnumber_t, agno)
  1456. __field(int, flags)
  1457. __field(__u32, length)
  1458. __field(__u32, bno_root)
  1459. __field(__u32, cnt_root)
  1460. __field(__u32, bno_level)
  1461. __field(__u32, cnt_level)
  1462. __field(__u32, flfirst)
  1463. __field(__u32, fllast)
  1464. __field(__u32, flcount)
  1465. __field(__u32, freeblks)
  1466. __field(__u32, longest)
  1467. __field(unsigned long, caller_ip)
  1468. ),
  1469. TP_fast_assign(
  1470. __entry->dev = mp->m_super->s_dev;
  1471. __entry->agno = be32_to_cpu(agf->agf_seqno),
  1472. __entry->flags = flags;
  1473. __entry->length = be32_to_cpu(agf->agf_length),
  1474. __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
  1475. __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
  1476. __entry->bno_level =
  1477. be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
  1478. __entry->cnt_level =
  1479. be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
  1480. __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
  1481. __entry->fllast = be32_to_cpu(agf->agf_fllast),
  1482. __entry->flcount = be32_to_cpu(agf->agf_flcount),
  1483. __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
  1484. __entry->longest = be32_to_cpu(agf->agf_longest);
  1485. __entry->caller_ip = caller_ip;
  1486. ),
  1487. TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
  1488. "levels b %u c %u flfirst %u fllast %u flcount %u "
  1489. "freeblks %u longest %u caller %ps",
  1490. MAJOR(__entry->dev), MINOR(__entry->dev),
  1491. __entry->agno,
  1492. __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
  1493. __entry->length,
  1494. __entry->bno_root,
  1495. __entry->cnt_root,
  1496. __entry->bno_level,
  1497. __entry->cnt_level,
  1498. __entry->flfirst,
  1499. __entry->fllast,
  1500. __entry->flcount,
  1501. __entry->freeblks,
  1502. __entry->longest,
  1503. (void *)__entry->caller_ip)
  1504. );
  1505. #define DEFINE_AGF_EVENT(name) \
  1506. DEFINE_EVENT(xfs_agf_class, name, \
  1507. TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
  1508. unsigned long caller_ip), \
  1509. TP_ARGS(mp, agf, flags, caller_ip))
  1510. DEFINE_AGF_EVENT(xfs_agf);
  1511. DEFINE_AGF_EVENT(xfs_agfl_reset);
  1512. TRACE_EVENT(xfs_free_extent,
  1513. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
  1514. xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
  1515. int haveright),
  1516. TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
  1517. TP_STRUCT__entry(
  1518. __field(dev_t, dev)
  1519. __field(xfs_agnumber_t, agno)
  1520. __field(xfs_agblock_t, agbno)
  1521. __field(xfs_extlen_t, len)
  1522. __field(int, resv)
  1523. __field(int, haveleft)
  1524. __field(int, haveright)
  1525. ),
  1526. TP_fast_assign(
  1527. __entry->dev = mp->m_super->s_dev;
  1528. __entry->agno = agno;
  1529. __entry->agbno = agbno;
  1530. __entry->len = len;
  1531. __entry->resv = resv;
  1532. __entry->haveleft = haveleft;
  1533. __entry->haveright = haveright;
  1534. ),
  1535. TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
  1536. MAJOR(__entry->dev), MINOR(__entry->dev),
  1537. __entry->agno,
  1538. __entry->agbno,
  1539. __entry->len,
  1540. __entry->resv,
  1541. __entry->haveleft ?
  1542. (__entry->haveright ? "both" : "left") :
  1543. (__entry->haveright ? "right" : "none"))
  1544. );
  1545. DECLARE_EVENT_CLASS(xfs_alloc_class,
  1546. TP_PROTO(struct xfs_alloc_arg *args),
  1547. TP_ARGS(args),
  1548. TP_STRUCT__entry(
  1549. __field(dev_t, dev)
  1550. __field(xfs_agnumber_t, agno)
  1551. __field(xfs_agblock_t, agbno)
  1552. __field(xfs_extlen_t, minlen)
  1553. __field(xfs_extlen_t, maxlen)
  1554. __field(xfs_extlen_t, mod)
  1555. __field(xfs_extlen_t, prod)
  1556. __field(xfs_extlen_t, minleft)
  1557. __field(xfs_extlen_t, total)
  1558. __field(xfs_extlen_t, alignment)
  1559. __field(xfs_extlen_t, minalignslop)
  1560. __field(xfs_extlen_t, len)
  1561. __field(short, type)
  1562. __field(short, otype)
  1563. __field(char, wasdel)
  1564. __field(char, wasfromfl)
  1565. __field(int, resv)
  1566. __field(int, datatype)
  1567. __field(xfs_fsblock_t, firstblock)
  1568. ),
  1569. TP_fast_assign(
  1570. __entry->dev = args->mp->m_super->s_dev;
  1571. __entry->agno = args->agno;
  1572. __entry->agbno = args->agbno;
  1573. __entry->minlen = args->minlen;
  1574. __entry->maxlen = args->maxlen;
  1575. __entry->mod = args->mod;
  1576. __entry->prod = args->prod;
  1577. __entry->minleft = args->minleft;
  1578. __entry->total = args->total;
  1579. __entry->alignment = args->alignment;
  1580. __entry->minalignslop = args->minalignslop;
  1581. __entry->len = args->len;
  1582. __entry->type = args->type;
  1583. __entry->otype = args->otype;
  1584. __entry->wasdel = args->wasdel;
  1585. __entry->wasfromfl = args->wasfromfl;
  1586. __entry->resv = args->resv;
  1587. __entry->datatype = args->datatype;
  1588. __entry->firstblock = args->firstblock;
  1589. ),
  1590. TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
  1591. "prod %u minleft %u total %u alignment %u minalignslop %u "
  1592. "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
  1593. "datatype 0x%x firstblock 0x%llx",
  1594. MAJOR(__entry->dev), MINOR(__entry->dev),
  1595. __entry->agno,
  1596. __entry->agbno,
  1597. __entry->minlen,
  1598. __entry->maxlen,
  1599. __entry->mod,
  1600. __entry->prod,
  1601. __entry->minleft,
  1602. __entry->total,
  1603. __entry->alignment,
  1604. __entry->minalignslop,
  1605. __entry->len,
  1606. __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
  1607. __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
  1608. __entry->wasdel,
  1609. __entry->wasfromfl,
  1610. __entry->resv,
  1611. __entry->datatype,
  1612. (unsigned long long)__entry->firstblock)
  1613. )
  1614. #define DEFINE_ALLOC_EVENT(name) \
  1615. DEFINE_EVENT(xfs_alloc_class, name, \
  1616. TP_PROTO(struct xfs_alloc_arg *args), \
  1617. TP_ARGS(args))
  1618. DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
  1619. DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
  1620. DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
  1621. DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
  1622. DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
  1623. DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
  1624. DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
  1625. DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
  1626. DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
  1627. DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
  1628. DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
  1629. DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
  1630. DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
  1631. DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
  1632. DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
  1633. DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
  1634. DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
  1635. DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
  1636. DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
  1637. DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
  1638. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
  1639. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
  1640. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
  1641. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
  1642. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
  1643. DECLARE_EVENT_CLASS(xfs_da_class,
  1644. TP_PROTO(struct xfs_da_args *args),
  1645. TP_ARGS(args),
  1646. TP_STRUCT__entry(
  1647. __field(dev_t, dev)
  1648. __field(xfs_ino_t, ino)
  1649. __dynamic_array(char, name, args->namelen)
  1650. __field(int, namelen)
  1651. __field(xfs_dahash_t, hashval)
  1652. __field(xfs_ino_t, inumber)
  1653. __field(int, op_flags)
  1654. ),
  1655. TP_fast_assign(
  1656. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1657. __entry->ino = args->dp->i_ino;
  1658. if (args->namelen)
  1659. memcpy(__get_str(name), args->name, args->namelen);
  1660. __entry->namelen = args->namelen;
  1661. __entry->hashval = args->hashval;
  1662. __entry->inumber = args->inumber;
  1663. __entry->op_flags = args->op_flags;
  1664. ),
  1665. TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
  1666. "inumber 0x%llx op_flags %s",
  1667. MAJOR(__entry->dev), MINOR(__entry->dev),
  1668. __entry->ino,
  1669. __entry->namelen,
  1670. __entry->namelen ? __get_str(name) : NULL,
  1671. __entry->namelen,
  1672. __entry->hashval,
  1673. __entry->inumber,
  1674. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
  1675. )
  1676. #define DEFINE_DIR2_EVENT(name) \
  1677. DEFINE_EVENT(xfs_da_class, name, \
  1678. TP_PROTO(struct xfs_da_args *args), \
  1679. TP_ARGS(args))
  1680. DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
  1681. DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
  1682. DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
  1683. DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
  1684. DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
  1685. DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
  1686. DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
  1687. DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
  1688. DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
  1689. DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
  1690. DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
  1691. DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
  1692. DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
  1693. DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
  1694. DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
  1695. DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
  1696. DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
  1697. DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
  1698. DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
  1699. DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
  1700. DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
  1701. DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
  1702. DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
  1703. DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
  1704. DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
  1705. DECLARE_EVENT_CLASS(xfs_attr_class,
  1706. TP_PROTO(struct xfs_da_args *args),
  1707. TP_ARGS(args),
  1708. TP_STRUCT__entry(
  1709. __field(dev_t, dev)
  1710. __field(xfs_ino_t, ino)
  1711. __dynamic_array(char, name, args->namelen)
  1712. __field(int, namelen)
  1713. __field(int, valuelen)
  1714. __field(xfs_dahash_t, hashval)
  1715. __field(int, op_flags)
  1716. ),
  1717. TP_fast_assign(
  1718. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1719. __entry->ino = args->dp->i_ino;
  1720. if (args->namelen)
  1721. memcpy(__get_str(name), args->name, args->namelen);
  1722. __entry->namelen = args->namelen;
  1723. __entry->valuelen = args->valuelen;
  1724. __entry->hashval = args->hashval;
  1725. __entry->op_flags = args->op_flags;
  1726. ),
  1727. TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
  1728. "hashval 0x%x op_flags %s",
  1729. MAJOR(__entry->dev), MINOR(__entry->dev),
  1730. __entry->ino,
  1731. __entry->namelen,
  1732. __entry->namelen ? __get_str(name) : NULL,
  1733. __entry->namelen,
  1734. __entry->valuelen,
  1735. __entry->hashval,
  1736. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
  1737. )
  1738. #define DEFINE_ATTR_EVENT(name) \
  1739. DEFINE_EVENT(xfs_attr_class, name, \
  1740. TP_PROTO(struct xfs_da_args *args), \
  1741. TP_ARGS(args))
  1742. DEFINE_ATTR_EVENT(xfs_attr_sf_add);
  1743. DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
  1744. DEFINE_ATTR_EVENT(xfs_attr_sf_create);
  1745. DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
  1746. DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
  1747. DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
  1748. DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
  1749. DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
  1750. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
  1751. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
  1752. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
  1753. DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
  1754. DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
  1755. DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
  1756. DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
  1757. DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
  1758. DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
  1759. DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
  1760. DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
  1761. DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
  1762. DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
  1763. DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
  1764. DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
  1765. DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
  1766. DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
  1767. DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
  1768. DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
  1769. DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
  1770. DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
  1771. DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
  1772. DEFINE_ATTR_EVENT(xfs_attr_node_addname);
  1773. DEFINE_ATTR_EVENT(xfs_attr_node_get);
  1774. DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
  1775. DEFINE_ATTR_EVENT(xfs_attr_node_replace);
  1776. DEFINE_ATTR_EVENT(xfs_attr_node_removename);
  1777. DEFINE_ATTR_EVENT(xfs_attr_fillstate);
  1778. DEFINE_ATTR_EVENT(xfs_attr_refillstate);
  1779. DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
  1780. DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
  1781. DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
  1782. #define DEFINE_DA_EVENT(name) \
  1783. DEFINE_EVENT(xfs_da_class, name, \
  1784. TP_PROTO(struct xfs_da_args *args), \
  1785. TP_ARGS(args))
  1786. DEFINE_DA_EVENT(xfs_da_split);
  1787. DEFINE_DA_EVENT(xfs_da_join);
  1788. DEFINE_DA_EVENT(xfs_da_link_before);
  1789. DEFINE_DA_EVENT(xfs_da_link_after);
  1790. DEFINE_DA_EVENT(xfs_da_unlink_back);
  1791. DEFINE_DA_EVENT(xfs_da_unlink_forward);
  1792. DEFINE_DA_EVENT(xfs_da_root_split);
  1793. DEFINE_DA_EVENT(xfs_da_root_join);
  1794. DEFINE_DA_EVENT(xfs_da_node_add);
  1795. DEFINE_DA_EVENT(xfs_da_node_create);
  1796. DEFINE_DA_EVENT(xfs_da_node_split);
  1797. DEFINE_DA_EVENT(xfs_da_node_remove);
  1798. DEFINE_DA_EVENT(xfs_da_node_rebalance);
  1799. DEFINE_DA_EVENT(xfs_da_node_unbalance);
  1800. DEFINE_DA_EVENT(xfs_da_node_toosmall);
  1801. DEFINE_DA_EVENT(xfs_da_swap_lastblock);
  1802. DEFINE_DA_EVENT(xfs_da_grow_inode);
  1803. DEFINE_DA_EVENT(xfs_da_shrink_inode);
  1804. DEFINE_DA_EVENT(xfs_da_fixhashpath);
  1805. DEFINE_DA_EVENT(xfs_da_path_shift);
  1806. DECLARE_EVENT_CLASS(xfs_dir2_space_class,
  1807. TP_PROTO(struct xfs_da_args *args, int idx),
  1808. TP_ARGS(args, idx),
  1809. TP_STRUCT__entry(
  1810. __field(dev_t, dev)
  1811. __field(xfs_ino_t, ino)
  1812. __field(int, op_flags)
  1813. __field(int, idx)
  1814. ),
  1815. TP_fast_assign(
  1816. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1817. __entry->ino = args->dp->i_ino;
  1818. __entry->op_flags = args->op_flags;
  1819. __entry->idx = idx;
  1820. ),
  1821. TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
  1822. MAJOR(__entry->dev), MINOR(__entry->dev),
  1823. __entry->ino,
  1824. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
  1825. __entry->idx)
  1826. )
  1827. #define DEFINE_DIR2_SPACE_EVENT(name) \
  1828. DEFINE_EVENT(xfs_dir2_space_class, name, \
  1829. TP_PROTO(struct xfs_da_args *args, int idx), \
  1830. TP_ARGS(args, idx))
  1831. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
  1832. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
  1833. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
  1834. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
  1835. TRACE_EVENT(xfs_dir2_leafn_moveents,
  1836. TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
  1837. TP_ARGS(args, src_idx, dst_idx, count),
  1838. TP_STRUCT__entry(
  1839. __field(dev_t, dev)
  1840. __field(xfs_ino_t, ino)
  1841. __field(int, op_flags)
  1842. __field(int, src_idx)
  1843. __field(int, dst_idx)
  1844. __field(int, count)
  1845. ),
  1846. TP_fast_assign(
  1847. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1848. __entry->ino = args->dp->i_ino;
  1849. __entry->op_flags = args->op_flags;
  1850. __entry->src_idx = src_idx;
  1851. __entry->dst_idx = dst_idx;
  1852. __entry->count = count;
  1853. ),
  1854. TP_printk("dev %d:%d ino 0x%llx op_flags %s "
  1855. "src_idx %d dst_idx %d count %d",
  1856. MAJOR(__entry->dev), MINOR(__entry->dev),
  1857. __entry->ino,
  1858. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
  1859. __entry->src_idx,
  1860. __entry->dst_idx,
  1861. __entry->count)
  1862. );
  1863. #define XFS_SWAPEXT_INODES \
  1864. { 0, "target" }, \
  1865. { 1, "temp" }
  1866. #define XFS_INODE_FORMAT_STR \
  1867. { 0, "invalid" }, \
  1868. { 1, "local" }, \
  1869. { 2, "extent" }, \
  1870. { 3, "btree" }
  1871. DECLARE_EVENT_CLASS(xfs_swap_extent_class,
  1872. TP_PROTO(struct xfs_inode *ip, int which),
  1873. TP_ARGS(ip, which),
  1874. TP_STRUCT__entry(
  1875. __field(dev_t, dev)
  1876. __field(int, which)
  1877. __field(xfs_ino_t, ino)
  1878. __field(int, format)
  1879. __field(int, nex)
  1880. __field(int, broot_size)
  1881. __field(int, fork_off)
  1882. ),
  1883. TP_fast_assign(
  1884. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1885. __entry->which = which;
  1886. __entry->ino = ip->i_ino;
  1887. __entry->format = ip->i_d.di_format;
  1888. __entry->nex = ip->i_d.di_nextents;
  1889. __entry->broot_size = ip->i_df.if_broot_bytes;
  1890. __entry->fork_off = XFS_IFORK_BOFF(ip);
  1891. ),
  1892. TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
  1893. "broot size %d, fork offset %d",
  1894. MAJOR(__entry->dev), MINOR(__entry->dev),
  1895. __entry->ino,
  1896. __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
  1897. __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
  1898. __entry->nex,
  1899. __entry->broot_size,
  1900. __entry->fork_off)
  1901. )
  1902. #define DEFINE_SWAPEXT_EVENT(name) \
  1903. DEFINE_EVENT(xfs_swap_extent_class, name, \
  1904. TP_PROTO(struct xfs_inode *ip, int which), \
  1905. TP_ARGS(ip, which))
  1906. DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
  1907. DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
  1908. TRACE_EVENT(xfs_log_recover,
  1909. TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
  1910. TP_ARGS(log, headblk, tailblk),
  1911. TP_STRUCT__entry(
  1912. __field(dev_t, dev)
  1913. __field(xfs_daddr_t, headblk)
  1914. __field(xfs_daddr_t, tailblk)
  1915. ),
  1916. TP_fast_assign(
  1917. __entry->dev = log->l_mp->m_super->s_dev;
  1918. __entry->headblk = headblk;
  1919. __entry->tailblk = tailblk;
  1920. ),
  1921. TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
  1922. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
  1923. __entry->tailblk)
  1924. )
  1925. TRACE_EVENT(xfs_log_recover_record,
  1926. TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
  1927. TP_ARGS(log, rhead, pass),
  1928. TP_STRUCT__entry(
  1929. __field(dev_t, dev)
  1930. __field(xfs_lsn_t, lsn)
  1931. __field(int, len)
  1932. __field(int, num_logops)
  1933. __field(int, pass)
  1934. ),
  1935. TP_fast_assign(
  1936. __entry->dev = log->l_mp->m_super->s_dev;
  1937. __entry->lsn = be64_to_cpu(rhead->h_lsn);
  1938. __entry->len = be32_to_cpu(rhead->h_len);
  1939. __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
  1940. __entry->pass = pass;
  1941. ),
  1942. TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
  1943. MAJOR(__entry->dev), MINOR(__entry->dev),
  1944. __entry->lsn, __entry->len, __entry->num_logops,
  1945. __entry->pass)
  1946. )
  1947. DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
  1948. TP_PROTO(struct xlog *log, struct xlog_recover *trans,
  1949. struct xlog_recover_item *item, int pass),
  1950. TP_ARGS(log, trans, item, pass),
  1951. TP_STRUCT__entry(
  1952. __field(dev_t, dev)
  1953. __field(unsigned long, item)
  1954. __field(xlog_tid_t, tid)
  1955. __field(xfs_lsn_t, lsn)
  1956. __field(int, type)
  1957. __field(int, pass)
  1958. __field(int, count)
  1959. __field(int, total)
  1960. ),
  1961. TP_fast_assign(
  1962. __entry->dev = log->l_mp->m_super->s_dev;
  1963. __entry->item = (unsigned long)item;
  1964. __entry->tid = trans->r_log_tid;
  1965. __entry->lsn = trans->r_lsn;
  1966. __entry->type = ITEM_TYPE(item);
  1967. __entry->pass = pass;
  1968. __entry->count = item->ri_cnt;
  1969. __entry->total = item->ri_total;
  1970. ),
  1971. TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, "
  1972. "item type %s item region count/total %d/%d",
  1973. MAJOR(__entry->dev), MINOR(__entry->dev),
  1974. __entry->tid,
  1975. __entry->lsn,
  1976. __entry->pass,
  1977. (void *)__entry->item,
  1978. __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
  1979. __entry->count,
  1980. __entry->total)
  1981. )
  1982. #define DEFINE_LOG_RECOVER_ITEM(name) \
  1983. DEFINE_EVENT(xfs_log_recover_item_class, name, \
  1984. TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
  1985. struct xlog_recover_item *item, int pass), \
  1986. TP_ARGS(log, trans, item, pass))
  1987. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
  1988. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
  1989. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
  1990. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
  1991. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
  1992. DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
  1993. TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
  1994. TP_ARGS(log, buf_f),
  1995. TP_STRUCT__entry(
  1996. __field(dev_t, dev)
  1997. __field(__int64_t, blkno)
  1998. __field(unsigned short, len)
  1999. __field(unsigned short, flags)
  2000. __field(unsigned short, size)
  2001. __field(unsigned int, map_size)
  2002. ),
  2003. TP_fast_assign(
  2004. __entry->dev = log->l_mp->m_super->s_dev;
  2005. __entry->blkno = buf_f->blf_blkno;
  2006. __entry->len = buf_f->blf_len;
  2007. __entry->flags = buf_f->blf_flags;
  2008. __entry->size = buf_f->blf_size;
  2009. __entry->map_size = buf_f->blf_map_size;
  2010. ),
  2011. TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
  2012. "map_size %d",
  2013. MAJOR(__entry->dev), MINOR(__entry->dev),
  2014. __entry->blkno,
  2015. __entry->len,
  2016. __entry->flags,
  2017. __entry->size,
  2018. __entry->map_size)
  2019. )
  2020. #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
  2021. DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
  2022. TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
  2023. TP_ARGS(log, buf_f))
  2024. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
  2025. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
  2026. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
  2027. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
  2028. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
  2029. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
  2030. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
  2031. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
  2032. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
  2033. DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
  2034. TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
  2035. TP_ARGS(log, in_f),
  2036. TP_STRUCT__entry(
  2037. __field(dev_t, dev)
  2038. __field(xfs_ino_t, ino)
  2039. __field(unsigned short, size)
  2040. __field(int, fields)
  2041. __field(unsigned short, asize)
  2042. __field(unsigned short, dsize)
  2043. __field(__int64_t, blkno)
  2044. __field(int, len)
  2045. __field(int, boffset)
  2046. ),
  2047. TP_fast_assign(
  2048. __entry->dev = log->l_mp->m_super->s_dev;
  2049. __entry->ino = in_f->ilf_ino;
  2050. __entry->size = in_f->ilf_size;
  2051. __entry->fields = in_f->ilf_fields;
  2052. __entry->asize = in_f->ilf_asize;
  2053. __entry->dsize = in_f->ilf_dsize;
  2054. __entry->blkno = in_f->ilf_blkno;
  2055. __entry->len = in_f->ilf_len;
  2056. __entry->boffset = in_f->ilf_boffset;
  2057. ),
  2058. TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
  2059. "dsize %d, blkno 0x%llx, len %d, boffset %d",
  2060. MAJOR(__entry->dev), MINOR(__entry->dev),
  2061. __entry->ino,
  2062. __entry->size,
  2063. __entry->fields,
  2064. __entry->asize,
  2065. __entry->dsize,
  2066. __entry->blkno,
  2067. __entry->len,
  2068. __entry->boffset)
  2069. )
  2070. #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
  2071. DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
  2072. TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
  2073. TP_ARGS(log, in_f))
  2074. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
  2075. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
  2076. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
  2077. DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
  2078. TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
  2079. TP_ARGS(log, in_f),
  2080. TP_STRUCT__entry(
  2081. __field(dev_t, dev)
  2082. __field(xfs_agnumber_t, agno)
  2083. __field(xfs_agblock_t, agbno)
  2084. __field(unsigned int, count)
  2085. __field(unsigned int, isize)
  2086. __field(xfs_agblock_t, length)
  2087. __field(unsigned int, gen)
  2088. ),
  2089. TP_fast_assign(
  2090. __entry->dev = log->l_mp->m_super->s_dev;
  2091. __entry->agno = be32_to_cpu(in_f->icl_ag);
  2092. __entry->agbno = be32_to_cpu(in_f->icl_agbno);
  2093. __entry->count = be32_to_cpu(in_f->icl_count);
  2094. __entry->isize = be32_to_cpu(in_f->icl_isize);
  2095. __entry->length = be32_to_cpu(in_f->icl_length);
  2096. __entry->gen = be32_to_cpu(in_f->icl_gen);
  2097. ),
  2098. TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
  2099. "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
  2100. __entry->agno, __entry->agbno, __entry->count, __entry->isize,
  2101. __entry->length, __entry->gen)
  2102. )
  2103. #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
  2104. DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
  2105. TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
  2106. TP_ARGS(log, in_f))
  2107. DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
  2108. DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
  2109. DECLARE_EVENT_CLASS(xfs_discard_class,
  2110. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2111. xfs_agblock_t agbno, xfs_extlen_t len),
  2112. TP_ARGS(mp, agno, agbno, len),
  2113. TP_STRUCT__entry(
  2114. __field(dev_t, dev)
  2115. __field(xfs_agnumber_t, agno)
  2116. __field(xfs_agblock_t, agbno)
  2117. __field(xfs_extlen_t, len)
  2118. ),
  2119. TP_fast_assign(
  2120. __entry->dev = mp->m_super->s_dev;
  2121. __entry->agno = agno;
  2122. __entry->agbno = agbno;
  2123. __entry->len = len;
  2124. ),
  2125. TP_printk("dev %d:%d agno %u agbno %u len %u\n",
  2126. MAJOR(__entry->dev), MINOR(__entry->dev),
  2127. __entry->agno,
  2128. __entry->agbno,
  2129. __entry->len)
  2130. )
  2131. #define DEFINE_DISCARD_EVENT(name) \
  2132. DEFINE_EVENT(xfs_discard_class, name, \
  2133. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2134. xfs_agblock_t agbno, xfs_extlen_t len), \
  2135. TP_ARGS(mp, agno, agbno, len))
  2136. DEFINE_DISCARD_EVENT(xfs_discard_extent);
  2137. DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
  2138. DEFINE_DISCARD_EVENT(xfs_discard_exclude);
  2139. DEFINE_DISCARD_EVENT(xfs_discard_busy);
  2140. /* btree cursor events */
  2141. DECLARE_EVENT_CLASS(xfs_btree_cur_class,
  2142. TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
  2143. TP_ARGS(cur, level, bp),
  2144. TP_STRUCT__entry(
  2145. __field(dev_t, dev)
  2146. __field(xfs_btnum_t, btnum)
  2147. __field(int, level)
  2148. __field(int, nlevels)
  2149. __field(int, ptr)
  2150. __field(xfs_daddr_t, daddr)
  2151. ),
  2152. TP_fast_assign(
  2153. __entry->dev = cur->bc_mp->m_super->s_dev;
  2154. __entry->btnum = cur->bc_btnum;
  2155. __entry->level = level;
  2156. __entry->nlevels = cur->bc_nlevels;
  2157. __entry->ptr = cur->bc_ptrs[level];
  2158. __entry->daddr = bp ? bp->b_bn : -1;
  2159. ),
  2160. TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
  2161. MAJOR(__entry->dev), MINOR(__entry->dev),
  2162. __entry->btnum,
  2163. __entry->level,
  2164. __entry->nlevels,
  2165. __entry->ptr,
  2166. (unsigned long long)__entry->daddr)
  2167. )
  2168. #define DEFINE_BTREE_CUR_EVENT(name) \
  2169. DEFINE_EVENT(xfs_btree_cur_class, name, \
  2170. TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
  2171. TP_ARGS(cur, level, bp))
  2172. DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
  2173. DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
  2174. /* deferred ops */
  2175. struct xfs_defer_pending;
  2176. struct xfs_defer_intake;
  2177. struct xfs_defer_ops;
  2178. DECLARE_EVENT_CLASS(xfs_defer_class,
  2179. TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop),
  2180. TP_ARGS(mp, dop),
  2181. TP_STRUCT__entry(
  2182. __field(dev_t, dev)
  2183. __field(void *, dop)
  2184. __field(bool, committed)
  2185. __field(bool, low)
  2186. ),
  2187. TP_fast_assign(
  2188. __entry->dev = mp ? mp->m_super->s_dev : 0;
  2189. __entry->dop = dop;
  2190. __entry->committed = dop->dop_committed;
  2191. __entry->low = dop->dop_low;
  2192. ),
  2193. TP_printk("dev %d:%d ops %p committed %d low %d\n",
  2194. MAJOR(__entry->dev), MINOR(__entry->dev),
  2195. __entry->dop,
  2196. __entry->committed,
  2197. __entry->low)
  2198. )
  2199. #define DEFINE_DEFER_EVENT(name) \
  2200. DEFINE_EVENT(xfs_defer_class, name, \
  2201. TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
  2202. TP_ARGS(mp, dop))
  2203. DECLARE_EVENT_CLASS(xfs_defer_error_class,
  2204. TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
  2205. TP_ARGS(mp, dop, error),
  2206. TP_STRUCT__entry(
  2207. __field(dev_t, dev)
  2208. __field(void *, dop)
  2209. __field(bool, committed)
  2210. __field(bool, low)
  2211. __field(int, error)
  2212. ),
  2213. TP_fast_assign(
  2214. __entry->dev = mp ? mp->m_super->s_dev : 0;
  2215. __entry->dop = dop;
  2216. __entry->committed = dop->dop_committed;
  2217. __entry->low = dop->dop_low;
  2218. __entry->error = error;
  2219. ),
  2220. TP_printk("dev %d:%d ops %p committed %d low %d err %d\n",
  2221. MAJOR(__entry->dev), MINOR(__entry->dev),
  2222. __entry->dop,
  2223. __entry->committed,
  2224. __entry->low,
  2225. __entry->error)
  2226. )
  2227. #define DEFINE_DEFER_ERROR_EVENT(name) \
  2228. DEFINE_EVENT(xfs_defer_error_class, name, \
  2229. TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
  2230. TP_ARGS(mp, dop, error))
  2231. DECLARE_EVENT_CLASS(xfs_defer_pending_class,
  2232. TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
  2233. TP_ARGS(mp, dfp),
  2234. TP_STRUCT__entry(
  2235. __field(dev_t, dev)
  2236. __field(int, type)
  2237. __field(void *, intent)
  2238. __field(bool, committed)
  2239. __field(int, nr)
  2240. ),
  2241. TP_fast_assign(
  2242. __entry->dev = mp ? mp->m_super->s_dev : 0;
  2243. __entry->type = dfp->dfp_type->type;
  2244. __entry->intent = dfp->dfp_intent;
  2245. __entry->committed = dfp->dfp_done != NULL;
  2246. __entry->nr = dfp->dfp_count;
  2247. ),
  2248. TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n",
  2249. MAJOR(__entry->dev), MINOR(__entry->dev),
  2250. __entry->type,
  2251. __entry->intent,
  2252. __entry->committed,
  2253. __entry->nr)
  2254. )
  2255. #define DEFINE_DEFER_PENDING_EVENT(name) \
  2256. DEFINE_EVENT(xfs_defer_pending_class, name, \
  2257. TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
  2258. TP_ARGS(mp, dfp))
  2259. DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
  2260. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2261. int type, xfs_agblock_t agbno, xfs_extlen_t len),
  2262. TP_ARGS(mp, agno, type, agbno, len),
  2263. TP_STRUCT__entry(
  2264. __field(dev_t, dev)
  2265. __field(xfs_agnumber_t, agno)
  2266. __field(int, type)
  2267. __field(xfs_agblock_t, agbno)
  2268. __field(xfs_extlen_t, len)
  2269. ),
  2270. TP_fast_assign(
  2271. __entry->dev = mp->m_super->s_dev;
  2272. __entry->agno = agno;
  2273. __entry->type = type;
  2274. __entry->agbno = agbno;
  2275. __entry->len = len;
  2276. ),
  2277. TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
  2278. MAJOR(__entry->dev), MINOR(__entry->dev),
  2279. __entry->type,
  2280. __entry->agno,
  2281. __entry->agbno,
  2282. __entry->len)
  2283. );
  2284. #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
  2285. DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
  2286. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2287. int type, \
  2288. xfs_agblock_t bno, \
  2289. xfs_extlen_t len), \
  2290. TP_ARGS(mp, agno, type, bno, len))
  2291. DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
  2292. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2293. int op,
  2294. xfs_agblock_t agbno,
  2295. xfs_ino_t ino,
  2296. int whichfork,
  2297. xfs_fileoff_t offset,
  2298. xfs_filblks_t len,
  2299. xfs_exntst_t state),
  2300. TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
  2301. TP_STRUCT__entry(
  2302. __field(dev_t, dev)
  2303. __field(xfs_agnumber_t, agno)
  2304. __field(xfs_ino_t, ino)
  2305. __field(xfs_agblock_t, agbno)
  2306. __field(int, whichfork)
  2307. __field(xfs_fileoff_t, l_loff)
  2308. __field(xfs_filblks_t, l_len)
  2309. __field(xfs_exntst_t, l_state)
  2310. __field(int, op)
  2311. ),
  2312. TP_fast_assign(
  2313. __entry->dev = mp->m_super->s_dev;
  2314. __entry->agno = agno;
  2315. __entry->ino = ino;
  2316. __entry->agbno = agbno;
  2317. __entry->whichfork = whichfork;
  2318. __entry->l_loff = offset;
  2319. __entry->l_len = len;
  2320. __entry->l_state = state;
  2321. __entry->op = op;
  2322. ),
  2323. TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
  2324. MAJOR(__entry->dev), MINOR(__entry->dev),
  2325. __entry->op,
  2326. __entry->agno,
  2327. __entry->agbno,
  2328. __entry->ino,
  2329. __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
  2330. __entry->l_loff,
  2331. __entry->l_len,
  2332. __entry->l_state)
  2333. );
  2334. #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
  2335. DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
  2336. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2337. int op, \
  2338. xfs_agblock_t agbno, \
  2339. xfs_ino_t ino, \
  2340. int whichfork, \
  2341. xfs_fileoff_t offset, \
  2342. xfs_filblks_t len, \
  2343. xfs_exntst_t state), \
  2344. TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
  2345. DEFINE_DEFER_EVENT(xfs_defer_init);
  2346. DEFINE_DEFER_EVENT(xfs_defer_cancel);
  2347. DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
  2348. DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
  2349. DEFINE_DEFER_EVENT(xfs_defer_finish);
  2350. DEFINE_DEFER_EVENT(xfs_defer_finish_done);
  2351. DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
  2352. DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
  2353. DEFINE_DEFER_ERROR_EVENT(xfs_defer_op_finish_error);
  2354. DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
  2355. DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
  2356. DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_commit);
  2357. DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
  2358. DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
  2359. DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
  2360. #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
  2361. DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
  2362. DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
  2363. /* rmap tracepoints */
  2364. DECLARE_EVENT_CLASS(xfs_rmap_class,
  2365. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2366. xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
  2367. struct xfs_owner_info *oinfo),
  2368. TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
  2369. TP_STRUCT__entry(
  2370. __field(dev_t, dev)
  2371. __field(xfs_agnumber_t, agno)
  2372. __field(xfs_agblock_t, agbno)
  2373. __field(xfs_extlen_t, len)
  2374. __field(uint64_t, owner)
  2375. __field(uint64_t, offset)
  2376. __field(unsigned long, flags)
  2377. ),
  2378. TP_fast_assign(
  2379. __entry->dev = mp->m_super->s_dev;
  2380. __entry->agno = agno;
  2381. __entry->agbno = agbno;
  2382. __entry->len = len;
  2383. __entry->owner = oinfo->oi_owner;
  2384. __entry->offset = oinfo->oi_offset;
  2385. __entry->flags = oinfo->oi_flags;
  2386. if (unwritten)
  2387. __entry->flags |= XFS_RMAP_UNWRITTEN;
  2388. ),
  2389. TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
  2390. MAJOR(__entry->dev), MINOR(__entry->dev),
  2391. __entry->agno,
  2392. __entry->agbno,
  2393. __entry->len,
  2394. __entry->owner,
  2395. __entry->offset,
  2396. __entry->flags)
  2397. );
  2398. #define DEFINE_RMAP_EVENT(name) \
  2399. DEFINE_EVENT(xfs_rmap_class, name, \
  2400. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2401. xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
  2402. struct xfs_owner_info *oinfo), \
  2403. TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
  2404. /* simple AG-based error/%ip tracepoint class */
  2405. DECLARE_EVENT_CLASS(xfs_ag_error_class,
  2406. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
  2407. unsigned long caller_ip),
  2408. TP_ARGS(mp, agno, error, caller_ip),
  2409. TP_STRUCT__entry(
  2410. __field(dev_t, dev)
  2411. __field(xfs_agnumber_t, agno)
  2412. __field(int, error)
  2413. __field(unsigned long, caller_ip)
  2414. ),
  2415. TP_fast_assign(
  2416. __entry->dev = mp->m_super->s_dev;
  2417. __entry->agno = agno;
  2418. __entry->error = error;
  2419. __entry->caller_ip = caller_ip;
  2420. ),
  2421. TP_printk("dev %d:%d agno %u error %d caller %ps",
  2422. MAJOR(__entry->dev), MINOR(__entry->dev),
  2423. __entry->agno,
  2424. __entry->error,
  2425. (char *)__entry->caller_ip)
  2426. );
  2427. #define DEFINE_AG_ERROR_EVENT(name) \
  2428. DEFINE_EVENT(xfs_ag_error_class, name, \
  2429. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
  2430. unsigned long caller_ip), \
  2431. TP_ARGS(mp, agno, error, caller_ip))
  2432. DEFINE_RMAP_EVENT(xfs_rmap_unmap);
  2433. DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
  2434. DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
  2435. DEFINE_RMAP_EVENT(xfs_rmap_map);
  2436. DEFINE_RMAP_EVENT(xfs_rmap_map_done);
  2437. DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
  2438. DEFINE_RMAP_EVENT(xfs_rmap_convert);
  2439. DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
  2440. DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
  2441. DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
  2442. DECLARE_EVENT_CLASS(xfs_rmapbt_class,
  2443. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2444. xfs_agblock_t agbno, xfs_extlen_t len,
  2445. uint64_t owner, uint64_t offset, unsigned int flags),
  2446. TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
  2447. TP_STRUCT__entry(
  2448. __field(dev_t, dev)
  2449. __field(xfs_agnumber_t, agno)
  2450. __field(xfs_agblock_t, agbno)
  2451. __field(xfs_extlen_t, len)
  2452. __field(uint64_t, owner)
  2453. __field(uint64_t, offset)
  2454. __field(unsigned int, flags)
  2455. ),
  2456. TP_fast_assign(
  2457. __entry->dev = mp->m_super->s_dev;
  2458. __entry->agno = agno;
  2459. __entry->agbno = agbno;
  2460. __entry->len = len;
  2461. __entry->owner = owner;
  2462. __entry->offset = offset;
  2463. __entry->flags = flags;
  2464. ),
  2465. TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
  2466. MAJOR(__entry->dev), MINOR(__entry->dev),
  2467. __entry->agno,
  2468. __entry->agbno,
  2469. __entry->len,
  2470. __entry->owner,
  2471. __entry->offset,
  2472. __entry->flags)
  2473. );
  2474. #define DEFINE_RMAPBT_EVENT(name) \
  2475. DEFINE_EVENT(xfs_rmapbt_class, name, \
  2476. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2477. xfs_agblock_t agbno, xfs_extlen_t len, \
  2478. uint64_t owner, uint64_t offset, unsigned int flags), \
  2479. TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
  2480. #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
  2481. DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
  2482. DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
  2483. DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
  2484. DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
  2485. DEFINE_RMAPBT_EVENT(xfs_rmap_update);
  2486. DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
  2487. DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
  2488. DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
  2489. DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
  2490. DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
  2491. DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
  2492. DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
  2493. DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
  2494. DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
  2495. DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
  2496. DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
  2497. DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
  2498. /* deferred bmbt updates */
  2499. #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
  2500. DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
  2501. DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
  2502. /* per-AG reservation */
  2503. DECLARE_EVENT_CLASS(xfs_ag_resv_class,
  2504. TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
  2505. xfs_extlen_t len),
  2506. TP_ARGS(pag, resv, len),
  2507. TP_STRUCT__entry(
  2508. __field(dev_t, dev)
  2509. __field(xfs_agnumber_t, agno)
  2510. __field(int, resv)
  2511. __field(xfs_extlen_t, freeblks)
  2512. __field(xfs_extlen_t, flcount)
  2513. __field(xfs_extlen_t, reserved)
  2514. __field(xfs_extlen_t, asked)
  2515. __field(xfs_extlen_t, len)
  2516. ),
  2517. TP_fast_assign(
  2518. struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
  2519. __entry->dev = pag->pag_mount->m_super->s_dev;
  2520. __entry->agno = pag->pag_agno;
  2521. __entry->resv = resv;
  2522. __entry->freeblks = pag->pagf_freeblks;
  2523. __entry->flcount = pag->pagf_flcount;
  2524. __entry->reserved = r ? r->ar_reserved : 0;
  2525. __entry->asked = r ? r->ar_asked : 0;
  2526. __entry->len = len;
  2527. ),
  2528. TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u resv %u ask %u len %u\n",
  2529. MAJOR(__entry->dev), MINOR(__entry->dev),
  2530. __entry->agno,
  2531. __entry->resv,
  2532. __entry->freeblks,
  2533. __entry->flcount,
  2534. __entry->reserved,
  2535. __entry->asked,
  2536. __entry->len)
  2537. )
  2538. #define DEFINE_AG_RESV_EVENT(name) \
  2539. DEFINE_EVENT(xfs_ag_resv_class, name, \
  2540. TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
  2541. xfs_extlen_t len), \
  2542. TP_ARGS(pag, type, len))
  2543. /* per-AG reservation tracepoints */
  2544. DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
  2545. DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
  2546. DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
  2547. DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
  2548. DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
  2549. DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
  2550. DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
  2551. DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
  2552. /* refcount tracepoint classes */
  2553. /* reuse the discard trace class for agbno/aglen-based traces */
  2554. #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
  2555. /* ag btree lookup tracepoint class */
  2556. #define XFS_AG_BTREE_CMP_FORMAT_STR \
  2557. { XFS_LOOKUP_EQ, "eq" }, \
  2558. { XFS_LOOKUP_LE, "le" }, \
  2559. { XFS_LOOKUP_GE, "ge" }
  2560. DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
  2561. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2562. xfs_agblock_t agbno, xfs_lookup_t dir),
  2563. TP_ARGS(mp, agno, agbno, dir),
  2564. TP_STRUCT__entry(
  2565. __field(dev_t, dev)
  2566. __field(xfs_agnumber_t, agno)
  2567. __field(xfs_agblock_t, agbno)
  2568. __field(xfs_lookup_t, dir)
  2569. ),
  2570. TP_fast_assign(
  2571. __entry->dev = mp->m_super->s_dev;
  2572. __entry->agno = agno;
  2573. __entry->agbno = agbno;
  2574. __entry->dir = dir;
  2575. ),
  2576. TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)\n",
  2577. MAJOR(__entry->dev), MINOR(__entry->dev),
  2578. __entry->agno,
  2579. __entry->agbno,
  2580. __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
  2581. __entry->dir)
  2582. )
  2583. #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
  2584. DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
  2585. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2586. xfs_agblock_t agbno, xfs_lookup_t dir), \
  2587. TP_ARGS(mp, agno, agbno, dir))
  2588. /* single-rcext tracepoint class */
  2589. DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
  2590. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2591. struct xfs_refcount_irec *irec),
  2592. TP_ARGS(mp, agno, irec),
  2593. TP_STRUCT__entry(
  2594. __field(dev_t, dev)
  2595. __field(xfs_agnumber_t, agno)
  2596. __field(xfs_agblock_t, startblock)
  2597. __field(xfs_extlen_t, blockcount)
  2598. __field(xfs_nlink_t, refcount)
  2599. ),
  2600. TP_fast_assign(
  2601. __entry->dev = mp->m_super->s_dev;
  2602. __entry->agno = agno;
  2603. __entry->startblock = irec->rc_startblock;
  2604. __entry->blockcount = irec->rc_blockcount;
  2605. __entry->refcount = irec->rc_refcount;
  2606. ),
  2607. TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u\n",
  2608. MAJOR(__entry->dev), MINOR(__entry->dev),
  2609. __entry->agno,
  2610. __entry->startblock,
  2611. __entry->blockcount,
  2612. __entry->refcount)
  2613. )
  2614. #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
  2615. DEFINE_EVENT(xfs_refcount_extent_class, name, \
  2616. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2617. struct xfs_refcount_irec *irec), \
  2618. TP_ARGS(mp, agno, irec))
  2619. /* single-rcext and an agbno tracepoint class */
  2620. DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
  2621. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2622. struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
  2623. TP_ARGS(mp, agno, irec, agbno),
  2624. TP_STRUCT__entry(
  2625. __field(dev_t, dev)
  2626. __field(xfs_agnumber_t, agno)
  2627. __field(xfs_agblock_t, startblock)
  2628. __field(xfs_extlen_t, blockcount)
  2629. __field(xfs_nlink_t, refcount)
  2630. __field(xfs_agblock_t, agbno)
  2631. ),
  2632. TP_fast_assign(
  2633. __entry->dev = mp->m_super->s_dev;
  2634. __entry->agno = agno;
  2635. __entry->startblock = irec->rc_startblock;
  2636. __entry->blockcount = irec->rc_blockcount;
  2637. __entry->refcount = irec->rc_refcount;
  2638. __entry->agbno = agbno;
  2639. ),
  2640. TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u\n",
  2641. MAJOR(__entry->dev), MINOR(__entry->dev),
  2642. __entry->agno,
  2643. __entry->startblock,
  2644. __entry->blockcount,
  2645. __entry->refcount,
  2646. __entry->agbno)
  2647. )
  2648. #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
  2649. DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
  2650. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2651. struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
  2652. TP_ARGS(mp, agno, irec, agbno))
  2653. /* double-rcext tracepoint class */
  2654. DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
  2655. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2656. struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
  2657. TP_ARGS(mp, agno, i1, i2),
  2658. TP_STRUCT__entry(
  2659. __field(dev_t, dev)
  2660. __field(xfs_agnumber_t, agno)
  2661. __field(xfs_agblock_t, i1_startblock)
  2662. __field(xfs_extlen_t, i1_blockcount)
  2663. __field(xfs_nlink_t, i1_refcount)
  2664. __field(xfs_agblock_t, i2_startblock)
  2665. __field(xfs_extlen_t, i2_blockcount)
  2666. __field(xfs_nlink_t, i2_refcount)
  2667. ),
  2668. TP_fast_assign(
  2669. __entry->dev = mp->m_super->s_dev;
  2670. __entry->agno = agno;
  2671. __entry->i1_startblock = i1->rc_startblock;
  2672. __entry->i1_blockcount = i1->rc_blockcount;
  2673. __entry->i1_refcount = i1->rc_refcount;
  2674. __entry->i2_startblock = i2->rc_startblock;
  2675. __entry->i2_blockcount = i2->rc_blockcount;
  2676. __entry->i2_refcount = i2->rc_refcount;
  2677. ),
  2678. TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
  2679. "agbno %u len %u refcount %u\n",
  2680. MAJOR(__entry->dev), MINOR(__entry->dev),
  2681. __entry->agno,
  2682. __entry->i1_startblock,
  2683. __entry->i1_blockcount,
  2684. __entry->i1_refcount,
  2685. __entry->i2_startblock,
  2686. __entry->i2_blockcount,
  2687. __entry->i2_refcount)
  2688. )
  2689. #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
  2690. DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
  2691. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2692. struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
  2693. TP_ARGS(mp, agno, i1, i2))
  2694. /* double-rcext and an agbno tracepoint class */
  2695. DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
  2696. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2697. struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
  2698. xfs_agblock_t agbno),
  2699. TP_ARGS(mp, agno, i1, i2, agbno),
  2700. TP_STRUCT__entry(
  2701. __field(dev_t, dev)
  2702. __field(xfs_agnumber_t, agno)
  2703. __field(xfs_agblock_t, i1_startblock)
  2704. __field(xfs_extlen_t, i1_blockcount)
  2705. __field(xfs_nlink_t, i1_refcount)
  2706. __field(xfs_agblock_t, i2_startblock)
  2707. __field(xfs_extlen_t, i2_blockcount)
  2708. __field(xfs_nlink_t, i2_refcount)
  2709. __field(xfs_agblock_t, agbno)
  2710. ),
  2711. TP_fast_assign(
  2712. __entry->dev = mp->m_super->s_dev;
  2713. __entry->agno = agno;
  2714. __entry->i1_startblock = i1->rc_startblock;
  2715. __entry->i1_blockcount = i1->rc_blockcount;
  2716. __entry->i1_refcount = i1->rc_refcount;
  2717. __entry->i2_startblock = i2->rc_startblock;
  2718. __entry->i2_blockcount = i2->rc_blockcount;
  2719. __entry->i2_refcount = i2->rc_refcount;
  2720. __entry->agbno = agbno;
  2721. ),
  2722. TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
  2723. "agbno %u len %u refcount %u @ agbno %u\n",
  2724. MAJOR(__entry->dev), MINOR(__entry->dev),
  2725. __entry->agno,
  2726. __entry->i1_startblock,
  2727. __entry->i1_blockcount,
  2728. __entry->i1_refcount,
  2729. __entry->i2_startblock,
  2730. __entry->i2_blockcount,
  2731. __entry->i2_refcount,
  2732. __entry->agbno)
  2733. )
  2734. #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
  2735. DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
  2736. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2737. struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
  2738. xfs_agblock_t agbno), \
  2739. TP_ARGS(mp, agno, i1, i2, agbno))
  2740. /* triple-rcext tracepoint class */
  2741. DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
  2742. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2743. struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
  2744. struct xfs_refcount_irec *i3),
  2745. TP_ARGS(mp, agno, i1, i2, i3),
  2746. TP_STRUCT__entry(
  2747. __field(dev_t, dev)
  2748. __field(xfs_agnumber_t, agno)
  2749. __field(xfs_agblock_t, i1_startblock)
  2750. __field(xfs_extlen_t, i1_blockcount)
  2751. __field(xfs_nlink_t, i1_refcount)
  2752. __field(xfs_agblock_t, i2_startblock)
  2753. __field(xfs_extlen_t, i2_blockcount)
  2754. __field(xfs_nlink_t, i2_refcount)
  2755. __field(xfs_agblock_t, i3_startblock)
  2756. __field(xfs_extlen_t, i3_blockcount)
  2757. __field(xfs_nlink_t, i3_refcount)
  2758. ),
  2759. TP_fast_assign(
  2760. __entry->dev = mp->m_super->s_dev;
  2761. __entry->agno = agno;
  2762. __entry->i1_startblock = i1->rc_startblock;
  2763. __entry->i1_blockcount = i1->rc_blockcount;
  2764. __entry->i1_refcount = i1->rc_refcount;
  2765. __entry->i2_startblock = i2->rc_startblock;
  2766. __entry->i2_blockcount = i2->rc_blockcount;
  2767. __entry->i2_refcount = i2->rc_refcount;
  2768. __entry->i3_startblock = i3->rc_startblock;
  2769. __entry->i3_blockcount = i3->rc_blockcount;
  2770. __entry->i3_refcount = i3->rc_refcount;
  2771. ),
  2772. TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
  2773. "agbno %u len %u refcount %u -- "
  2774. "agbno %u len %u refcount %u\n",
  2775. MAJOR(__entry->dev), MINOR(__entry->dev),
  2776. __entry->agno,
  2777. __entry->i1_startblock,
  2778. __entry->i1_blockcount,
  2779. __entry->i1_refcount,
  2780. __entry->i2_startblock,
  2781. __entry->i2_blockcount,
  2782. __entry->i2_refcount,
  2783. __entry->i3_startblock,
  2784. __entry->i3_blockcount,
  2785. __entry->i3_refcount)
  2786. );
  2787. #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
  2788. DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
  2789. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2790. struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
  2791. struct xfs_refcount_irec *i3), \
  2792. TP_ARGS(mp, agno, i1, i2, i3))
  2793. /* refcount btree tracepoints */
  2794. DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
  2795. DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
  2796. DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
  2797. DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
  2798. DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
  2799. DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
  2800. DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
  2801. DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
  2802. DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
  2803. DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
  2804. /* refcount adjustment tracepoints */
  2805. DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
  2806. DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
  2807. DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
  2808. DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
  2809. DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
  2810. DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
  2811. DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
  2812. DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
  2813. DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
  2814. DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
  2815. DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
  2816. DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
  2817. DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
  2818. DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
  2819. DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
  2820. DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
  2821. DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
  2822. DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
  2823. DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
  2824. DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
  2825. DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
  2826. /* reflink helpers */
  2827. DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
  2828. DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
  2829. DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
  2830. #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
  2831. DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
  2832. DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
  2833. TRACE_EVENT(xfs_refcount_finish_one_leftover,
  2834. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2835. int type, xfs_agblock_t agbno, xfs_extlen_t len,
  2836. xfs_agblock_t new_agbno, xfs_extlen_t new_len),
  2837. TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
  2838. TP_STRUCT__entry(
  2839. __field(dev_t, dev)
  2840. __field(xfs_agnumber_t, agno)
  2841. __field(int, type)
  2842. __field(xfs_agblock_t, agbno)
  2843. __field(xfs_extlen_t, len)
  2844. __field(xfs_agblock_t, new_agbno)
  2845. __field(xfs_extlen_t, new_len)
  2846. ),
  2847. TP_fast_assign(
  2848. __entry->dev = mp->m_super->s_dev;
  2849. __entry->agno = agno;
  2850. __entry->type = type;
  2851. __entry->agbno = agbno;
  2852. __entry->len = len;
  2853. __entry->new_agbno = new_agbno;
  2854. __entry->new_len = new_len;
  2855. ),
  2856. TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
  2857. MAJOR(__entry->dev), MINOR(__entry->dev),
  2858. __entry->type,
  2859. __entry->agno,
  2860. __entry->agbno,
  2861. __entry->len,
  2862. __entry->new_agbno,
  2863. __entry->new_len)
  2864. );
  2865. /* simple inode-based error/%ip tracepoint class */
  2866. DECLARE_EVENT_CLASS(xfs_inode_error_class,
  2867. TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
  2868. TP_ARGS(ip, error, caller_ip),
  2869. TP_STRUCT__entry(
  2870. __field(dev_t, dev)
  2871. __field(xfs_ino_t, ino)
  2872. __field(int, error)
  2873. __field(unsigned long, caller_ip)
  2874. ),
  2875. TP_fast_assign(
  2876. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  2877. __entry->ino = ip->i_ino;
  2878. __entry->error = error;
  2879. __entry->caller_ip = caller_ip;
  2880. ),
  2881. TP_printk("dev %d:%d ino %llx error %d caller %ps",
  2882. MAJOR(__entry->dev), MINOR(__entry->dev),
  2883. __entry->ino,
  2884. __entry->error,
  2885. (char *)__entry->caller_ip)
  2886. );
  2887. #define DEFINE_INODE_ERROR_EVENT(name) \
  2888. DEFINE_EVENT(xfs_inode_error_class, name, \
  2889. TP_PROTO(struct xfs_inode *ip, int error, \
  2890. unsigned long caller_ip), \
  2891. TP_ARGS(ip, error, caller_ip))
  2892. /* reflink allocator */
  2893. TRACE_EVENT(xfs_bmap_remap_alloc,
  2894. TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t fsbno,
  2895. xfs_extlen_t len),
  2896. TP_ARGS(ip, fsbno, len),
  2897. TP_STRUCT__entry(
  2898. __field(dev_t, dev)
  2899. __field(xfs_ino_t, ino)
  2900. __field(xfs_fsblock_t, fsbno)
  2901. __field(xfs_extlen_t, len)
  2902. ),
  2903. TP_fast_assign(
  2904. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  2905. __entry->ino = ip->i_ino;
  2906. __entry->fsbno = fsbno;
  2907. __entry->len = len;
  2908. ),
  2909. TP_printk("dev %d:%d ino 0x%llx fsbno 0x%llx len %x",
  2910. MAJOR(__entry->dev), MINOR(__entry->dev),
  2911. __entry->ino,
  2912. __entry->fsbno,
  2913. __entry->len)
  2914. );
  2915. DEFINE_INODE_ERROR_EVENT(xfs_bmap_remap_alloc_error);
  2916. /* reflink tracepoint classes */
  2917. /* two-file io tracepoint class */
  2918. DECLARE_EVENT_CLASS(xfs_double_io_class,
  2919. TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
  2920. struct xfs_inode *dest, xfs_off_t doffset),
  2921. TP_ARGS(src, soffset, len, dest, doffset),
  2922. TP_STRUCT__entry(
  2923. __field(dev_t, dev)
  2924. __field(xfs_ino_t, src_ino)
  2925. __field(loff_t, src_isize)
  2926. __field(loff_t, src_disize)
  2927. __field(loff_t, src_offset)
  2928. __field(size_t, len)
  2929. __field(xfs_ino_t, dest_ino)
  2930. __field(loff_t, dest_isize)
  2931. __field(loff_t, dest_disize)
  2932. __field(loff_t, dest_offset)
  2933. ),
  2934. TP_fast_assign(
  2935. __entry->dev = VFS_I(src)->i_sb->s_dev;
  2936. __entry->src_ino = src->i_ino;
  2937. __entry->src_isize = VFS_I(src)->i_size;
  2938. __entry->src_disize = src->i_d.di_size;
  2939. __entry->src_offset = soffset;
  2940. __entry->len = len;
  2941. __entry->dest_ino = dest->i_ino;
  2942. __entry->dest_isize = VFS_I(dest)->i_size;
  2943. __entry->dest_disize = dest->i_d.di_size;
  2944. __entry->dest_offset = doffset;
  2945. ),
  2946. TP_printk("dev %d:%d count %zd "
  2947. "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
  2948. "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
  2949. MAJOR(__entry->dev), MINOR(__entry->dev),
  2950. __entry->len,
  2951. __entry->src_ino,
  2952. __entry->src_isize,
  2953. __entry->src_disize,
  2954. __entry->src_offset,
  2955. __entry->dest_ino,
  2956. __entry->dest_isize,
  2957. __entry->dest_disize,
  2958. __entry->dest_offset)
  2959. )
  2960. #define DEFINE_DOUBLE_IO_EVENT(name) \
  2961. DEFINE_EVENT(xfs_double_io_class, name, \
  2962. TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
  2963. struct xfs_inode *dest, xfs_off_t doffset), \
  2964. TP_ARGS(src, soffset, len, dest, doffset))
  2965. /* two-file vfs io tracepoint class */
  2966. DECLARE_EVENT_CLASS(xfs_double_vfs_io_class,
  2967. TP_PROTO(struct inode *src, u64 soffset, u64 len,
  2968. struct inode *dest, u64 doffset),
  2969. TP_ARGS(src, soffset, len, dest, doffset),
  2970. TP_STRUCT__entry(
  2971. __field(dev_t, dev)
  2972. __field(unsigned long, src_ino)
  2973. __field(loff_t, src_isize)
  2974. __field(loff_t, src_offset)
  2975. __field(size_t, len)
  2976. __field(unsigned long, dest_ino)
  2977. __field(loff_t, dest_isize)
  2978. __field(loff_t, dest_offset)
  2979. ),
  2980. TP_fast_assign(
  2981. __entry->dev = src->i_sb->s_dev;
  2982. __entry->src_ino = src->i_ino;
  2983. __entry->src_isize = i_size_read(src);
  2984. __entry->src_offset = soffset;
  2985. __entry->len = len;
  2986. __entry->dest_ino = dest->i_ino;
  2987. __entry->dest_isize = i_size_read(dest);
  2988. __entry->dest_offset = doffset;
  2989. ),
  2990. TP_printk("dev %d:%d count %zd "
  2991. "ino 0x%lx isize 0x%llx offset 0x%llx -> "
  2992. "ino 0x%lx isize 0x%llx offset 0x%llx",
  2993. MAJOR(__entry->dev), MINOR(__entry->dev),
  2994. __entry->len,
  2995. __entry->src_ino,
  2996. __entry->src_isize,
  2997. __entry->src_offset,
  2998. __entry->dest_ino,
  2999. __entry->dest_isize,
  3000. __entry->dest_offset)
  3001. )
  3002. #define DEFINE_DOUBLE_VFS_IO_EVENT(name) \
  3003. DEFINE_EVENT(xfs_double_vfs_io_class, name, \
  3004. TP_PROTO(struct inode *src, u64 soffset, u64 len, \
  3005. struct inode *dest, u64 doffset), \
  3006. TP_ARGS(src, soffset, len, dest, doffset))
  3007. /* CoW write tracepoint */
  3008. DECLARE_EVENT_CLASS(xfs_copy_on_write_class,
  3009. TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, xfs_fsblock_t pblk,
  3010. xfs_extlen_t len, xfs_fsblock_t new_pblk),
  3011. TP_ARGS(ip, lblk, pblk, len, new_pblk),
  3012. TP_STRUCT__entry(
  3013. __field(dev_t, dev)
  3014. __field(xfs_ino_t, ino)
  3015. __field(xfs_fileoff_t, lblk)
  3016. __field(xfs_fsblock_t, pblk)
  3017. __field(xfs_extlen_t, len)
  3018. __field(xfs_fsblock_t, new_pblk)
  3019. ),
  3020. TP_fast_assign(
  3021. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  3022. __entry->ino = ip->i_ino;
  3023. __entry->lblk = lblk;
  3024. __entry->pblk = pblk;
  3025. __entry->len = len;
  3026. __entry->new_pblk = new_pblk;
  3027. ),
  3028. TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx pblk 0x%llx "
  3029. "len 0x%x new_pblk %llu",
  3030. MAJOR(__entry->dev), MINOR(__entry->dev),
  3031. __entry->ino,
  3032. __entry->lblk,
  3033. __entry->pblk,
  3034. __entry->len,
  3035. __entry->new_pblk)
  3036. )
  3037. #define DEFINE_COW_EVENT(name) \
  3038. DEFINE_EVENT(xfs_copy_on_write_class, name, \
  3039. TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, xfs_fsblock_t pblk, \
  3040. xfs_extlen_t len, xfs_fsblock_t new_pblk), \
  3041. TP_ARGS(ip, lblk, pblk, len, new_pblk))
  3042. /* inode/irec events */
  3043. DECLARE_EVENT_CLASS(xfs_inode_irec_class,
  3044. TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
  3045. TP_ARGS(ip, irec),
  3046. TP_STRUCT__entry(
  3047. __field(dev_t, dev)
  3048. __field(xfs_ino_t, ino)
  3049. __field(xfs_fileoff_t, lblk)
  3050. __field(xfs_extlen_t, len)
  3051. __field(xfs_fsblock_t, pblk)
  3052. __field(int, state)
  3053. ),
  3054. TP_fast_assign(
  3055. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  3056. __entry->ino = ip->i_ino;
  3057. __entry->lblk = irec->br_startoff;
  3058. __entry->len = irec->br_blockcount;
  3059. __entry->pblk = irec->br_startblock;
  3060. __entry->state = irec->br_state;
  3061. ),
  3062. TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d",
  3063. MAJOR(__entry->dev), MINOR(__entry->dev),
  3064. __entry->ino,
  3065. __entry->lblk,
  3066. __entry->len,
  3067. __entry->pblk,
  3068. __entry->state)
  3069. );
  3070. #define DEFINE_INODE_IREC_EVENT(name) \
  3071. DEFINE_EVENT(xfs_inode_irec_class, name, \
  3072. TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
  3073. TP_ARGS(ip, irec))
  3074. /* refcount/reflink tracepoint definitions */
  3075. /* reflink tracepoints */
  3076. DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
  3077. DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
  3078. DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
  3079. DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap);
  3080. TRACE_EVENT(xfs_reflink_remap_blocks_loop,
  3081. TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
  3082. xfs_filblks_t len, struct xfs_inode *dest,
  3083. xfs_fileoff_t doffset),
  3084. TP_ARGS(src, soffset, len, dest, doffset),
  3085. TP_STRUCT__entry(
  3086. __field(dev_t, dev)
  3087. __field(xfs_ino_t, src_ino)
  3088. __field(xfs_fileoff_t, src_lblk)
  3089. __field(xfs_filblks_t, len)
  3090. __field(xfs_ino_t, dest_ino)
  3091. __field(xfs_fileoff_t, dest_lblk)
  3092. ),
  3093. TP_fast_assign(
  3094. __entry->dev = VFS_I(src)->i_sb->s_dev;
  3095. __entry->src_ino = src->i_ino;
  3096. __entry->src_lblk = soffset;
  3097. __entry->len = len;
  3098. __entry->dest_ino = dest->i_ino;
  3099. __entry->dest_lblk = doffset;
  3100. ),
  3101. TP_printk("dev %d:%d len 0x%llx "
  3102. "ino 0x%llx offset 0x%llx blocks -> "
  3103. "ino 0x%llx offset 0x%llx blocks",
  3104. MAJOR(__entry->dev), MINOR(__entry->dev),
  3105. __entry->len,
  3106. __entry->src_ino,
  3107. __entry->src_lblk,
  3108. __entry->dest_ino,
  3109. __entry->dest_lblk)
  3110. );
  3111. TRACE_EVENT(xfs_reflink_punch_range,
  3112. TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
  3113. xfs_extlen_t len),
  3114. TP_ARGS(ip, lblk, len),
  3115. TP_STRUCT__entry(
  3116. __field(dev_t, dev)
  3117. __field(xfs_ino_t, ino)
  3118. __field(xfs_fileoff_t, lblk)
  3119. __field(xfs_extlen_t, len)
  3120. ),
  3121. TP_fast_assign(
  3122. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  3123. __entry->ino = ip->i_ino;
  3124. __entry->lblk = lblk;
  3125. __entry->len = len;
  3126. ),
  3127. TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
  3128. MAJOR(__entry->dev), MINOR(__entry->dev),
  3129. __entry->ino,
  3130. __entry->lblk,
  3131. __entry->len)
  3132. );
  3133. TRACE_EVENT(xfs_reflink_remap,
  3134. TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
  3135. xfs_extlen_t len, xfs_fsblock_t new_pblk),
  3136. TP_ARGS(ip, lblk, len, new_pblk),
  3137. TP_STRUCT__entry(
  3138. __field(dev_t, dev)
  3139. __field(xfs_ino_t, ino)
  3140. __field(xfs_fileoff_t, lblk)
  3141. __field(xfs_extlen_t, len)
  3142. __field(xfs_fsblock_t, new_pblk)
  3143. ),
  3144. TP_fast_assign(
  3145. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  3146. __entry->ino = ip->i_ino;
  3147. __entry->lblk = lblk;
  3148. __entry->len = len;
  3149. __entry->new_pblk = new_pblk;
  3150. ),
  3151. TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
  3152. MAJOR(__entry->dev), MINOR(__entry->dev),
  3153. __entry->ino,
  3154. __entry->lblk,
  3155. __entry->len,
  3156. __entry->new_pblk)
  3157. );
  3158. DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
  3159. DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
  3160. DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
  3161. DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
  3162. DEFINE_INODE_ERROR_EVENT(xfs_reflink_reflink_main_loop_error);
  3163. DEFINE_INODE_ERROR_EVENT(xfs_reflink_read_iomap_error);
  3164. DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
  3165. DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
  3166. /* dedupe tracepoints */
  3167. DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
  3168. DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
  3169. /* ioctl tracepoints */
  3170. DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_reflink);
  3171. DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_clone_range);
  3172. DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_file_extent_same);
  3173. TRACE_EVENT(xfs_ioctl_clone,
  3174. TP_PROTO(struct inode *src, struct inode *dest),
  3175. TP_ARGS(src, dest),
  3176. TP_STRUCT__entry(
  3177. __field(dev_t, dev)
  3178. __field(unsigned long, src_ino)
  3179. __field(loff_t, src_isize)
  3180. __field(unsigned long, dest_ino)
  3181. __field(loff_t, dest_isize)
  3182. ),
  3183. TP_fast_assign(
  3184. __entry->dev = src->i_sb->s_dev;
  3185. __entry->src_ino = src->i_ino;
  3186. __entry->src_isize = i_size_read(src);
  3187. __entry->dest_ino = dest->i_ino;
  3188. __entry->dest_isize = i_size_read(dest);
  3189. ),
  3190. TP_printk("dev %d:%d "
  3191. "ino 0x%lx isize 0x%llx -> "
  3192. "ino 0x%lx isize 0x%llx\n",
  3193. MAJOR(__entry->dev), MINOR(__entry->dev),
  3194. __entry->src_ino,
  3195. __entry->src_isize,
  3196. __entry->dest_ino,
  3197. __entry->dest_isize)
  3198. );
  3199. /* unshare tracepoints */
  3200. DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
  3201. DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cow_eof_block);
  3202. DEFINE_PAGE_EVENT(xfs_reflink_unshare_page);
  3203. DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
  3204. DEFINE_INODE_ERROR_EVENT(xfs_reflink_cow_eof_block_error);
  3205. DEFINE_INODE_ERROR_EVENT(xfs_reflink_dirty_page_error);
  3206. /* copy on write */
  3207. DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
  3208. DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc);
  3209. DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
  3210. DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
  3211. DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
  3212. DEFINE_RW_EVENT(xfs_reflink_reserve_cow);
  3213. DEFINE_RW_EVENT(xfs_reflink_allocate_cow_range);
  3214. DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
  3215. DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping);
  3216. DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec);
  3217. DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
  3218. DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
  3219. DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
  3220. DEFINE_INODE_ERROR_EVENT(xfs_reflink_allocate_cow_range_error);
  3221. DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
  3222. DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
  3223. DEFINE_COW_EVENT(xfs_reflink_fork_buf);
  3224. DEFINE_COW_EVENT(xfs_reflink_finish_fork_buf);
  3225. DEFINE_INODE_ERROR_EVENT(xfs_reflink_fork_buf_error);
  3226. DEFINE_INODE_ERROR_EVENT(xfs_reflink_finish_fork_buf_error);
  3227. DEFINE_INODE_EVENT(xfs_reflink_cancel_pending_cow);
  3228. DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
  3229. DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_pending_cow_error);
  3230. /* rmap swapext tracepoints */
  3231. DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
  3232. DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
  3233. DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
  3234. #endif /* _TRACE_XFS_H */
  3235. #undef TRACE_INCLUDE_PATH
  3236. #define TRACE_INCLUDE_PATH .
  3237. #define TRACE_INCLUDE_FILE xfs_trace
  3238. #include <trace/define_trace.h>