xfs_trace.h 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174
  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. DECLARE_EVENT_CLASS(xfs_attr_list_class,
  39. TP_PROTO(struct xfs_attr_list_context *ctx),
  40. TP_ARGS(ctx),
  41. TP_STRUCT__entry(
  42. __field(dev_t, dev)
  43. __field(xfs_ino_t, ino)
  44. __field(u32, hashval)
  45. __field(u32, blkno)
  46. __field(u32, offset)
  47. __field(void *, alist)
  48. __field(int, bufsize)
  49. __field(int, count)
  50. __field(int, firstu)
  51. __field(int, dupcnt)
  52. __field(int, flags)
  53. ),
  54. TP_fast_assign(
  55. __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
  56. __entry->ino = ctx->dp->i_ino;
  57. __entry->hashval = ctx->cursor->hashval;
  58. __entry->blkno = ctx->cursor->blkno;
  59. __entry->offset = ctx->cursor->offset;
  60. __entry->alist = ctx->alist;
  61. __entry->bufsize = ctx->bufsize;
  62. __entry->count = ctx->count;
  63. __entry->firstu = ctx->firstu;
  64. __entry->flags = ctx->flags;
  65. ),
  66. TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
  67. "alist 0x%p size %u count %u firstu %u flags %d %s",
  68. MAJOR(__entry->dev), MINOR(__entry->dev),
  69. __entry->ino,
  70. __entry->hashval,
  71. __entry->blkno,
  72. __entry->offset,
  73. __entry->dupcnt,
  74. __entry->alist,
  75. __entry->bufsize,
  76. __entry->count,
  77. __entry->firstu,
  78. __entry->flags,
  79. __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
  80. )
  81. )
  82. #define DEFINE_ATTR_LIST_EVENT(name) \
  83. DEFINE_EVENT(xfs_attr_list_class, name, \
  84. TP_PROTO(struct xfs_attr_list_context *ctx), \
  85. TP_ARGS(ctx))
  86. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
  87. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
  88. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
  89. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
  90. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
  91. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
  92. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
  93. DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
  94. DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
  95. DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
  96. DECLARE_EVENT_CLASS(xfs_perag_class,
  97. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
  98. unsigned long caller_ip),
  99. TP_ARGS(mp, agno, refcount, caller_ip),
  100. TP_STRUCT__entry(
  101. __field(dev_t, dev)
  102. __field(xfs_agnumber_t, agno)
  103. __field(int, refcount)
  104. __field(unsigned long, caller_ip)
  105. ),
  106. TP_fast_assign(
  107. __entry->dev = mp->m_super->s_dev;
  108. __entry->agno = agno;
  109. __entry->refcount = refcount;
  110. __entry->caller_ip = caller_ip;
  111. ),
  112. TP_printk("dev %d:%d agno %u refcount %d caller %ps",
  113. MAJOR(__entry->dev), MINOR(__entry->dev),
  114. __entry->agno,
  115. __entry->refcount,
  116. (char *)__entry->caller_ip)
  117. );
  118. #define DEFINE_PERAG_REF_EVENT(name) \
  119. DEFINE_EVENT(xfs_perag_class, name, \
  120. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
  121. unsigned long caller_ip), \
  122. TP_ARGS(mp, agno, refcount, caller_ip))
  123. DEFINE_PERAG_REF_EVENT(xfs_perag_get);
  124. DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
  125. DEFINE_PERAG_REF_EVENT(xfs_perag_put);
  126. DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
  127. DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
  128. DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
  129. DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
  130. DECLARE_EVENT_CLASS(xfs_ag_class,
  131. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
  132. TP_ARGS(mp, agno),
  133. TP_STRUCT__entry(
  134. __field(dev_t, dev)
  135. __field(xfs_agnumber_t, agno)
  136. ),
  137. TP_fast_assign(
  138. __entry->dev = mp->m_super->s_dev;
  139. __entry->agno = agno;
  140. ),
  141. TP_printk("dev %d:%d agno %u",
  142. MAJOR(__entry->dev), MINOR(__entry->dev),
  143. __entry->agno)
  144. );
  145. #define DEFINE_AG_EVENT(name) \
  146. DEFINE_EVENT(xfs_ag_class, name, \
  147. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
  148. TP_ARGS(mp, agno))
  149. DEFINE_AG_EVENT(xfs_read_agf);
  150. DEFINE_AG_EVENT(xfs_alloc_read_agf);
  151. DEFINE_AG_EVENT(xfs_read_agi);
  152. DEFINE_AG_EVENT(xfs_ialloc_read_agi);
  153. TRACE_EVENT(xfs_attr_list_node_descend,
  154. TP_PROTO(struct xfs_attr_list_context *ctx,
  155. struct xfs_da_node_entry *btree),
  156. TP_ARGS(ctx, btree),
  157. TP_STRUCT__entry(
  158. __field(dev_t, dev)
  159. __field(xfs_ino_t, ino)
  160. __field(u32, hashval)
  161. __field(u32, blkno)
  162. __field(u32, offset)
  163. __field(void *, alist)
  164. __field(int, bufsize)
  165. __field(int, count)
  166. __field(int, firstu)
  167. __field(int, dupcnt)
  168. __field(int, flags)
  169. __field(u32, bt_hashval)
  170. __field(u32, bt_before)
  171. ),
  172. TP_fast_assign(
  173. __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
  174. __entry->ino = ctx->dp->i_ino;
  175. __entry->hashval = ctx->cursor->hashval;
  176. __entry->blkno = ctx->cursor->blkno;
  177. __entry->offset = ctx->cursor->offset;
  178. __entry->alist = ctx->alist;
  179. __entry->bufsize = ctx->bufsize;
  180. __entry->count = ctx->count;
  181. __entry->firstu = ctx->firstu;
  182. __entry->flags = ctx->flags;
  183. __entry->bt_hashval = be32_to_cpu(btree->hashval);
  184. __entry->bt_before = be32_to_cpu(btree->before);
  185. ),
  186. TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
  187. "alist 0x%p size %u count %u firstu %u flags %d %s "
  188. "node hashval %u, node before %u",
  189. MAJOR(__entry->dev), MINOR(__entry->dev),
  190. __entry->ino,
  191. __entry->hashval,
  192. __entry->blkno,
  193. __entry->offset,
  194. __entry->dupcnt,
  195. __entry->alist,
  196. __entry->bufsize,
  197. __entry->count,
  198. __entry->firstu,
  199. __entry->flags,
  200. __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
  201. __entry->bt_hashval,
  202. __entry->bt_before)
  203. );
  204. TRACE_EVENT(xfs_iext_insert,
  205. TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
  206. struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
  207. TP_ARGS(ip, idx, r, state, caller_ip),
  208. TP_STRUCT__entry(
  209. __field(dev_t, dev)
  210. __field(xfs_ino_t, ino)
  211. __field(xfs_extnum_t, idx)
  212. __field(xfs_fileoff_t, startoff)
  213. __field(xfs_fsblock_t, startblock)
  214. __field(xfs_filblks_t, blockcount)
  215. __field(xfs_exntst_t, state)
  216. __field(int, bmap_state)
  217. __field(unsigned long, caller_ip)
  218. ),
  219. TP_fast_assign(
  220. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  221. __entry->ino = ip->i_ino;
  222. __entry->idx = idx;
  223. __entry->startoff = r->br_startoff;
  224. __entry->startblock = r->br_startblock;
  225. __entry->blockcount = r->br_blockcount;
  226. __entry->state = r->br_state;
  227. __entry->bmap_state = state;
  228. __entry->caller_ip = caller_ip;
  229. ),
  230. TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
  231. "offset %lld block %lld count %lld flag %d caller %ps",
  232. MAJOR(__entry->dev), MINOR(__entry->dev),
  233. __entry->ino,
  234. __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
  235. (long)__entry->idx,
  236. __entry->startoff,
  237. (__int64_t)__entry->startblock,
  238. __entry->blockcount,
  239. __entry->state,
  240. (char *)__entry->caller_ip)
  241. );
  242. DECLARE_EVENT_CLASS(xfs_bmap_class,
  243. TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
  244. unsigned long caller_ip),
  245. TP_ARGS(ip, idx, state, caller_ip),
  246. TP_STRUCT__entry(
  247. __field(dev_t, dev)
  248. __field(xfs_ino_t, ino)
  249. __field(xfs_extnum_t, idx)
  250. __field(xfs_fileoff_t, startoff)
  251. __field(xfs_fsblock_t, startblock)
  252. __field(xfs_filblks_t, blockcount)
  253. __field(xfs_exntst_t, state)
  254. __field(int, bmap_state)
  255. __field(unsigned long, caller_ip)
  256. ),
  257. TP_fast_assign(
  258. struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
  259. ip->i_afp : &ip->i_df;
  260. struct xfs_bmbt_irec r;
  261. xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
  262. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  263. __entry->ino = ip->i_ino;
  264. __entry->idx = idx;
  265. __entry->startoff = r.br_startoff;
  266. __entry->startblock = r.br_startblock;
  267. __entry->blockcount = r.br_blockcount;
  268. __entry->state = r.br_state;
  269. __entry->bmap_state = state;
  270. __entry->caller_ip = caller_ip;
  271. ),
  272. TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
  273. "offset %lld block %lld count %lld flag %d caller %ps",
  274. MAJOR(__entry->dev), MINOR(__entry->dev),
  275. __entry->ino,
  276. __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
  277. (long)__entry->idx,
  278. __entry->startoff,
  279. (__int64_t)__entry->startblock,
  280. __entry->blockcount,
  281. __entry->state,
  282. (char *)__entry->caller_ip)
  283. )
  284. #define DEFINE_BMAP_EVENT(name) \
  285. DEFINE_EVENT(xfs_bmap_class, name, \
  286. TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
  287. unsigned long caller_ip), \
  288. TP_ARGS(ip, idx, state, caller_ip))
  289. DEFINE_BMAP_EVENT(xfs_iext_remove);
  290. DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
  291. DEFINE_BMAP_EVENT(xfs_bmap_post_update);
  292. DEFINE_BMAP_EVENT(xfs_extlist);
  293. DECLARE_EVENT_CLASS(xfs_buf_class,
  294. TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
  295. TP_ARGS(bp, caller_ip),
  296. TP_STRUCT__entry(
  297. __field(dev_t, dev)
  298. __field(xfs_daddr_t, bno)
  299. __field(int, nblks)
  300. __field(int, hold)
  301. __field(int, pincount)
  302. __field(unsigned, lockval)
  303. __field(unsigned, flags)
  304. __field(unsigned long, caller_ip)
  305. ),
  306. TP_fast_assign(
  307. __entry->dev = bp->b_target->bt_dev;
  308. __entry->bno = bp->b_bn;
  309. __entry->nblks = bp->b_length;
  310. __entry->hold = atomic_read(&bp->b_hold);
  311. __entry->pincount = atomic_read(&bp->b_pin_count);
  312. __entry->lockval = bp->b_sema.count;
  313. __entry->flags = bp->b_flags;
  314. __entry->caller_ip = caller_ip;
  315. ),
  316. TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
  317. "lock %d flags %s caller %ps",
  318. MAJOR(__entry->dev), MINOR(__entry->dev),
  319. (unsigned long long)__entry->bno,
  320. __entry->nblks,
  321. __entry->hold,
  322. __entry->pincount,
  323. __entry->lockval,
  324. __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
  325. (void *)__entry->caller_ip)
  326. )
  327. #define DEFINE_BUF_EVENT(name) \
  328. DEFINE_EVENT(xfs_buf_class, name, \
  329. TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
  330. TP_ARGS(bp, caller_ip))
  331. DEFINE_BUF_EVENT(xfs_buf_init);
  332. DEFINE_BUF_EVENT(xfs_buf_free);
  333. DEFINE_BUF_EVENT(xfs_buf_hold);
  334. DEFINE_BUF_EVENT(xfs_buf_rele);
  335. DEFINE_BUF_EVENT(xfs_buf_iodone);
  336. DEFINE_BUF_EVENT(xfs_buf_submit);
  337. DEFINE_BUF_EVENT(xfs_buf_submit_wait);
  338. DEFINE_BUF_EVENT(xfs_buf_bawrite);
  339. DEFINE_BUF_EVENT(xfs_buf_lock);
  340. DEFINE_BUF_EVENT(xfs_buf_lock_done);
  341. DEFINE_BUF_EVENT(xfs_buf_trylock);
  342. DEFINE_BUF_EVENT(xfs_buf_unlock);
  343. DEFINE_BUF_EVENT(xfs_buf_iowait);
  344. DEFINE_BUF_EVENT(xfs_buf_iowait_done);
  345. DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
  346. DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
  347. DEFINE_BUF_EVENT(xfs_buf_delwri_split);
  348. DEFINE_BUF_EVENT(xfs_buf_get_uncached);
  349. DEFINE_BUF_EVENT(xfs_bdstrat_shut);
  350. DEFINE_BUF_EVENT(xfs_buf_item_relse);
  351. DEFINE_BUF_EVENT(xfs_buf_item_iodone);
  352. DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
  353. DEFINE_BUF_EVENT(xfs_buf_error_relse);
  354. DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
  355. DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
  356. DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
  357. /* not really buffer traces, but the buf provides useful information */
  358. DEFINE_BUF_EVENT(xfs_btree_corrupt);
  359. DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
  360. DEFINE_BUF_EVENT(xfs_reset_dqcounts);
  361. DEFINE_BUF_EVENT(xfs_inode_item_push);
  362. /* pass flags explicitly */
  363. DECLARE_EVENT_CLASS(xfs_buf_flags_class,
  364. TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
  365. TP_ARGS(bp, flags, caller_ip),
  366. TP_STRUCT__entry(
  367. __field(dev_t, dev)
  368. __field(xfs_daddr_t, bno)
  369. __field(size_t, buffer_length)
  370. __field(int, hold)
  371. __field(int, pincount)
  372. __field(unsigned, lockval)
  373. __field(unsigned, flags)
  374. __field(unsigned long, caller_ip)
  375. ),
  376. TP_fast_assign(
  377. __entry->dev = bp->b_target->bt_dev;
  378. __entry->bno = bp->b_bn;
  379. __entry->buffer_length = BBTOB(bp->b_length);
  380. __entry->flags = flags;
  381. __entry->hold = atomic_read(&bp->b_hold);
  382. __entry->pincount = atomic_read(&bp->b_pin_count);
  383. __entry->lockval = bp->b_sema.count;
  384. __entry->caller_ip = caller_ip;
  385. ),
  386. TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
  387. "lock %d flags %s caller %ps",
  388. MAJOR(__entry->dev), MINOR(__entry->dev),
  389. (unsigned long long)__entry->bno,
  390. __entry->buffer_length,
  391. __entry->hold,
  392. __entry->pincount,
  393. __entry->lockval,
  394. __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
  395. (void *)__entry->caller_ip)
  396. )
  397. #define DEFINE_BUF_FLAGS_EVENT(name) \
  398. DEFINE_EVENT(xfs_buf_flags_class, name, \
  399. TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
  400. TP_ARGS(bp, flags, caller_ip))
  401. DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
  402. DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
  403. DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
  404. TRACE_EVENT(xfs_buf_ioerror,
  405. TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
  406. TP_ARGS(bp, error, caller_ip),
  407. TP_STRUCT__entry(
  408. __field(dev_t, dev)
  409. __field(xfs_daddr_t, bno)
  410. __field(size_t, buffer_length)
  411. __field(unsigned, flags)
  412. __field(int, hold)
  413. __field(int, pincount)
  414. __field(unsigned, lockval)
  415. __field(int, error)
  416. __field(unsigned long, caller_ip)
  417. ),
  418. TP_fast_assign(
  419. __entry->dev = bp->b_target->bt_dev;
  420. __entry->bno = bp->b_bn;
  421. __entry->buffer_length = BBTOB(bp->b_length);
  422. __entry->hold = atomic_read(&bp->b_hold);
  423. __entry->pincount = atomic_read(&bp->b_pin_count);
  424. __entry->lockval = bp->b_sema.count;
  425. __entry->error = error;
  426. __entry->flags = bp->b_flags;
  427. __entry->caller_ip = caller_ip;
  428. ),
  429. TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
  430. "lock %d error %d flags %s caller %ps",
  431. MAJOR(__entry->dev), MINOR(__entry->dev),
  432. (unsigned long long)__entry->bno,
  433. __entry->buffer_length,
  434. __entry->hold,
  435. __entry->pincount,
  436. __entry->lockval,
  437. __entry->error,
  438. __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
  439. (void *)__entry->caller_ip)
  440. );
  441. DECLARE_EVENT_CLASS(xfs_buf_item_class,
  442. TP_PROTO(struct xfs_buf_log_item *bip),
  443. TP_ARGS(bip),
  444. TP_STRUCT__entry(
  445. __field(dev_t, dev)
  446. __field(xfs_daddr_t, buf_bno)
  447. __field(size_t, buf_len)
  448. __field(int, buf_hold)
  449. __field(int, buf_pincount)
  450. __field(int, buf_lockval)
  451. __field(unsigned, buf_flags)
  452. __field(unsigned, bli_recur)
  453. __field(int, bli_refcount)
  454. __field(unsigned, bli_flags)
  455. __field(void *, li_desc)
  456. __field(unsigned, li_flags)
  457. ),
  458. TP_fast_assign(
  459. __entry->dev = bip->bli_buf->b_target->bt_dev;
  460. __entry->bli_flags = bip->bli_flags;
  461. __entry->bli_recur = bip->bli_recur;
  462. __entry->bli_refcount = atomic_read(&bip->bli_refcount);
  463. __entry->buf_bno = bip->bli_buf->b_bn;
  464. __entry->buf_len = BBTOB(bip->bli_buf->b_length);
  465. __entry->buf_flags = bip->bli_buf->b_flags;
  466. __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
  467. __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
  468. __entry->buf_lockval = bip->bli_buf->b_sema.count;
  469. __entry->li_desc = bip->bli_item.li_desc;
  470. __entry->li_flags = bip->bli_item.li_flags;
  471. ),
  472. TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
  473. "lock %d flags %s recur %d refcount %d bliflags %s "
  474. "lidesc 0x%p liflags %s",
  475. MAJOR(__entry->dev), MINOR(__entry->dev),
  476. (unsigned long long)__entry->buf_bno,
  477. __entry->buf_len,
  478. __entry->buf_hold,
  479. __entry->buf_pincount,
  480. __entry->buf_lockval,
  481. __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
  482. __entry->bli_recur,
  483. __entry->bli_refcount,
  484. __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
  485. __entry->li_desc,
  486. __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
  487. )
  488. #define DEFINE_BUF_ITEM_EVENT(name) \
  489. DEFINE_EVENT(xfs_buf_item_class, name, \
  490. TP_PROTO(struct xfs_buf_log_item *bip), \
  491. TP_ARGS(bip))
  492. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
  493. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
  494. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
  495. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
  496. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
  497. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
  498. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
  499. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
  500. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
  501. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
  502. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
  503. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
  504. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
  505. DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
  506. DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
  507. DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
  508. DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
  509. DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
  510. DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
  511. DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
  512. DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
  513. DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
  514. DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
  515. DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
  516. DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
  517. DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
  518. DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
  519. DECLARE_EVENT_CLASS(xfs_filestream_class,
  520. TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
  521. TP_ARGS(ip, agno),
  522. TP_STRUCT__entry(
  523. __field(dev_t, dev)
  524. __field(xfs_ino_t, ino)
  525. __field(xfs_agnumber_t, agno)
  526. __field(int, streams)
  527. ),
  528. TP_fast_assign(
  529. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  530. __entry->ino = ip->i_ino;
  531. __entry->agno = agno;
  532. __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
  533. ),
  534. TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
  535. MAJOR(__entry->dev), MINOR(__entry->dev),
  536. __entry->ino,
  537. __entry->agno,
  538. __entry->streams)
  539. )
  540. #define DEFINE_FILESTREAM_EVENT(name) \
  541. DEFINE_EVENT(xfs_filestream_class, name, \
  542. TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
  543. TP_ARGS(ip, agno))
  544. DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
  545. DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
  546. DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
  547. TRACE_EVENT(xfs_filestream_pick,
  548. TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
  549. xfs_extlen_t free, int nscan),
  550. TP_ARGS(ip, agno, free, nscan),
  551. TP_STRUCT__entry(
  552. __field(dev_t, dev)
  553. __field(xfs_ino_t, ino)
  554. __field(xfs_agnumber_t, agno)
  555. __field(int, streams)
  556. __field(xfs_extlen_t, free)
  557. __field(int, nscan)
  558. ),
  559. TP_fast_assign(
  560. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  561. __entry->ino = ip->i_ino;
  562. __entry->agno = agno;
  563. __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
  564. __entry->free = free;
  565. __entry->nscan = nscan;
  566. ),
  567. TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
  568. MAJOR(__entry->dev), MINOR(__entry->dev),
  569. __entry->ino,
  570. __entry->agno,
  571. __entry->streams,
  572. __entry->free,
  573. __entry->nscan)
  574. );
  575. DECLARE_EVENT_CLASS(xfs_lock_class,
  576. TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
  577. unsigned long caller_ip),
  578. TP_ARGS(ip, lock_flags, caller_ip),
  579. TP_STRUCT__entry(
  580. __field(dev_t, dev)
  581. __field(xfs_ino_t, ino)
  582. __field(int, lock_flags)
  583. __field(unsigned long, caller_ip)
  584. ),
  585. TP_fast_assign(
  586. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  587. __entry->ino = ip->i_ino;
  588. __entry->lock_flags = lock_flags;
  589. __entry->caller_ip = caller_ip;
  590. ),
  591. TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
  592. MAJOR(__entry->dev), MINOR(__entry->dev),
  593. __entry->ino,
  594. __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
  595. (void *)__entry->caller_ip)
  596. )
  597. #define DEFINE_LOCK_EVENT(name) \
  598. DEFINE_EVENT(xfs_lock_class, name, \
  599. TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
  600. unsigned long caller_ip), \
  601. TP_ARGS(ip, lock_flags, caller_ip))
  602. DEFINE_LOCK_EVENT(xfs_ilock);
  603. DEFINE_LOCK_EVENT(xfs_ilock_nowait);
  604. DEFINE_LOCK_EVENT(xfs_ilock_demote);
  605. DEFINE_LOCK_EVENT(xfs_iunlock);
  606. DECLARE_EVENT_CLASS(xfs_inode_class,
  607. TP_PROTO(struct xfs_inode *ip),
  608. TP_ARGS(ip),
  609. TP_STRUCT__entry(
  610. __field(dev_t, dev)
  611. __field(xfs_ino_t, ino)
  612. ),
  613. TP_fast_assign(
  614. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  615. __entry->ino = ip->i_ino;
  616. ),
  617. TP_printk("dev %d:%d ino 0x%llx",
  618. MAJOR(__entry->dev), MINOR(__entry->dev),
  619. __entry->ino)
  620. )
  621. #define DEFINE_INODE_EVENT(name) \
  622. DEFINE_EVENT(xfs_inode_class, name, \
  623. TP_PROTO(struct xfs_inode *ip), \
  624. TP_ARGS(ip))
  625. DEFINE_INODE_EVENT(xfs_iget_skip);
  626. DEFINE_INODE_EVENT(xfs_iget_reclaim);
  627. DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
  628. DEFINE_INODE_EVENT(xfs_iget_hit);
  629. DEFINE_INODE_EVENT(xfs_iget_miss);
  630. DEFINE_INODE_EVENT(xfs_getattr);
  631. DEFINE_INODE_EVENT(xfs_setattr);
  632. DEFINE_INODE_EVENT(xfs_readlink);
  633. DEFINE_INODE_EVENT(xfs_inactive_symlink);
  634. DEFINE_INODE_EVENT(xfs_alloc_file_space);
  635. DEFINE_INODE_EVENT(xfs_free_file_space);
  636. DEFINE_INODE_EVENT(xfs_zero_file_space);
  637. DEFINE_INODE_EVENT(xfs_collapse_file_space);
  638. DEFINE_INODE_EVENT(xfs_insert_file_space);
  639. DEFINE_INODE_EVENT(xfs_readdir);
  640. #ifdef CONFIG_XFS_POSIX_ACL
  641. DEFINE_INODE_EVENT(xfs_get_acl);
  642. #endif
  643. DEFINE_INODE_EVENT(xfs_vm_bmap);
  644. DEFINE_INODE_EVENT(xfs_file_ioctl);
  645. DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
  646. DEFINE_INODE_EVENT(xfs_ioctl_setattr);
  647. DEFINE_INODE_EVENT(xfs_dir_fsync);
  648. DEFINE_INODE_EVENT(xfs_file_fsync);
  649. DEFINE_INODE_EVENT(xfs_destroy_inode);
  650. DEFINE_INODE_EVENT(xfs_evict_inode);
  651. DEFINE_INODE_EVENT(xfs_update_time);
  652. DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
  653. DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
  654. DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
  655. DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
  656. DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
  657. DEFINE_INODE_EVENT(xfs_filemap_fault);
  658. DEFINE_INODE_EVENT(xfs_filemap_pmd_fault);
  659. DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
  660. DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
  661. DECLARE_EVENT_CLASS(xfs_iref_class,
  662. TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
  663. TP_ARGS(ip, caller_ip),
  664. TP_STRUCT__entry(
  665. __field(dev_t, dev)
  666. __field(xfs_ino_t, ino)
  667. __field(int, count)
  668. __field(int, pincount)
  669. __field(unsigned long, caller_ip)
  670. ),
  671. TP_fast_assign(
  672. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  673. __entry->ino = ip->i_ino;
  674. __entry->count = atomic_read(&VFS_I(ip)->i_count);
  675. __entry->pincount = atomic_read(&ip->i_pincount);
  676. __entry->caller_ip = caller_ip;
  677. ),
  678. TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
  679. MAJOR(__entry->dev), MINOR(__entry->dev),
  680. __entry->ino,
  681. __entry->count,
  682. __entry->pincount,
  683. (char *)__entry->caller_ip)
  684. )
  685. TRACE_EVENT(xfs_iomap_prealloc_size,
  686. TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
  687. unsigned int writeio_blocks),
  688. TP_ARGS(ip, blocks, shift, writeio_blocks),
  689. TP_STRUCT__entry(
  690. __field(dev_t, dev)
  691. __field(xfs_ino_t, ino)
  692. __field(xfs_fsblock_t, blocks)
  693. __field(int, shift)
  694. __field(unsigned int, writeio_blocks)
  695. ),
  696. TP_fast_assign(
  697. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  698. __entry->ino = ip->i_ino;
  699. __entry->blocks = blocks;
  700. __entry->shift = shift;
  701. __entry->writeio_blocks = writeio_blocks;
  702. ),
  703. TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
  704. "m_writeio_blocks %u",
  705. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
  706. __entry->blocks, __entry->shift, __entry->writeio_blocks)
  707. )
  708. TRACE_EVENT(xfs_irec_merge_pre,
  709. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
  710. uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
  711. TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
  712. TP_STRUCT__entry(
  713. __field(dev_t, dev)
  714. __field(xfs_agnumber_t, agno)
  715. __field(xfs_agino_t, agino)
  716. __field(uint16_t, holemask)
  717. __field(xfs_agino_t, nagino)
  718. __field(uint16_t, nholemask)
  719. ),
  720. TP_fast_assign(
  721. __entry->dev = mp->m_super->s_dev;
  722. __entry->agno = agno;
  723. __entry->agino = agino;
  724. __entry->holemask = holemask;
  725. __entry->nagino = nagino;
  726. __entry->nholemask = holemask;
  727. ),
  728. TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
  729. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
  730. __entry->agino, __entry->holemask, __entry->nagino,
  731. __entry->nholemask)
  732. )
  733. TRACE_EVENT(xfs_irec_merge_post,
  734. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
  735. uint16_t holemask),
  736. TP_ARGS(mp, agno, agino, holemask),
  737. TP_STRUCT__entry(
  738. __field(dev_t, dev)
  739. __field(xfs_agnumber_t, agno)
  740. __field(xfs_agino_t, agino)
  741. __field(uint16_t, holemask)
  742. ),
  743. TP_fast_assign(
  744. __entry->dev = mp->m_super->s_dev;
  745. __entry->agno = agno;
  746. __entry->agino = agino;
  747. __entry->holemask = holemask;
  748. ),
  749. TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
  750. MINOR(__entry->dev), __entry->agno, __entry->agino,
  751. __entry->holemask)
  752. )
  753. #define DEFINE_IREF_EVENT(name) \
  754. DEFINE_EVENT(xfs_iref_class, name, \
  755. TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
  756. TP_ARGS(ip, caller_ip))
  757. DEFINE_IREF_EVENT(xfs_ihold);
  758. DEFINE_IREF_EVENT(xfs_irele);
  759. DEFINE_IREF_EVENT(xfs_inode_pin);
  760. DEFINE_IREF_EVENT(xfs_inode_unpin);
  761. DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
  762. DECLARE_EVENT_CLASS(xfs_namespace_class,
  763. TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
  764. TP_ARGS(dp, name),
  765. TP_STRUCT__entry(
  766. __field(dev_t, dev)
  767. __field(xfs_ino_t, dp_ino)
  768. __field(int, namelen)
  769. __dynamic_array(char, name, name->len)
  770. ),
  771. TP_fast_assign(
  772. __entry->dev = VFS_I(dp)->i_sb->s_dev;
  773. __entry->dp_ino = dp->i_ino;
  774. __entry->namelen = name->len;
  775. memcpy(__get_str(name), name->name, name->len);
  776. ),
  777. TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
  778. MAJOR(__entry->dev), MINOR(__entry->dev),
  779. __entry->dp_ino,
  780. __entry->namelen,
  781. __get_str(name))
  782. )
  783. #define DEFINE_NAMESPACE_EVENT(name) \
  784. DEFINE_EVENT(xfs_namespace_class, name, \
  785. TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
  786. TP_ARGS(dp, name))
  787. DEFINE_NAMESPACE_EVENT(xfs_remove);
  788. DEFINE_NAMESPACE_EVENT(xfs_link);
  789. DEFINE_NAMESPACE_EVENT(xfs_lookup);
  790. DEFINE_NAMESPACE_EVENT(xfs_create);
  791. DEFINE_NAMESPACE_EVENT(xfs_symlink);
  792. TRACE_EVENT(xfs_rename,
  793. TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
  794. struct xfs_name *src_name, struct xfs_name *target_name),
  795. TP_ARGS(src_dp, target_dp, src_name, target_name),
  796. TP_STRUCT__entry(
  797. __field(dev_t, dev)
  798. __field(xfs_ino_t, src_dp_ino)
  799. __field(xfs_ino_t, target_dp_ino)
  800. __field(int, src_namelen)
  801. __field(int, target_namelen)
  802. __dynamic_array(char, src_name, src_name->len)
  803. __dynamic_array(char, target_name, target_name->len)
  804. ),
  805. TP_fast_assign(
  806. __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
  807. __entry->src_dp_ino = src_dp->i_ino;
  808. __entry->target_dp_ino = target_dp->i_ino;
  809. __entry->src_namelen = src_name->len;
  810. __entry->target_namelen = target_name->len;
  811. memcpy(__get_str(src_name), src_name->name, src_name->len);
  812. memcpy(__get_str(target_name), target_name->name,
  813. target_name->len);
  814. ),
  815. TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
  816. " src name %.*s target name %.*s",
  817. MAJOR(__entry->dev), MINOR(__entry->dev),
  818. __entry->src_dp_ino,
  819. __entry->target_dp_ino,
  820. __entry->src_namelen,
  821. __get_str(src_name),
  822. __entry->target_namelen,
  823. __get_str(target_name))
  824. )
  825. DECLARE_EVENT_CLASS(xfs_dquot_class,
  826. TP_PROTO(struct xfs_dquot *dqp),
  827. TP_ARGS(dqp),
  828. TP_STRUCT__entry(
  829. __field(dev_t, dev)
  830. __field(u32, id)
  831. __field(unsigned, flags)
  832. __field(unsigned, nrefs)
  833. __field(unsigned long long, res_bcount)
  834. __field(unsigned long long, bcount)
  835. __field(unsigned long long, icount)
  836. __field(unsigned long long, blk_hardlimit)
  837. __field(unsigned long long, blk_softlimit)
  838. __field(unsigned long long, ino_hardlimit)
  839. __field(unsigned long long, ino_softlimit)
  840. ), \
  841. TP_fast_assign(
  842. __entry->dev = dqp->q_mount->m_super->s_dev;
  843. __entry->id = be32_to_cpu(dqp->q_core.d_id);
  844. __entry->flags = dqp->dq_flags;
  845. __entry->nrefs = dqp->q_nrefs;
  846. __entry->res_bcount = dqp->q_res_bcount;
  847. __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
  848. __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
  849. __entry->blk_hardlimit =
  850. be64_to_cpu(dqp->q_core.d_blk_hardlimit);
  851. __entry->blk_softlimit =
  852. be64_to_cpu(dqp->q_core.d_blk_softlimit);
  853. __entry->ino_hardlimit =
  854. be64_to_cpu(dqp->q_core.d_ino_hardlimit);
  855. __entry->ino_softlimit =
  856. be64_to_cpu(dqp->q_core.d_ino_softlimit);
  857. ),
  858. TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
  859. "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
  860. "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
  861. MAJOR(__entry->dev), MINOR(__entry->dev),
  862. __entry->id,
  863. __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
  864. __entry->nrefs,
  865. __entry->res_bcount,
  866. __entry->bcount,
  867. __entry->blk_hardlimit,
  868. __entry->blk_softlimit,
  869. __entry->icount,
  870. __entry->ino_hardlimit,
  871. __entry->ino_softlimit)
  872. )
  873. #define DEFINE_DQUOT_EVENT(name) \
  874. DEFINE_EVENT(xfs_dquot_class, name, \
  875. TP_PROTO(struct xfs_dquot *dqp), \
  876. TP_ARGS(dqp))
  877. DEFINE_DQUOT_EVENT(xfs_dqadjust);
  878. DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
  879. DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
  880. DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
  881. DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
  882. DEFINE_DQUOT_EVENT(xfs_dqattach_found);
  883. DEFINE_DQUOT_EVENT(xfs_dqattach_get);
  884. DEFINE_DQUOT_EVENT(xfs_dqalloc);
  885. DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
  886. DEFINE_DQUOT_EVENT(xfs_dqread);
  887. DEFINE_DQUOT_EVENT(xfs_dqread_fail);
  888. DEFINE_DQUOT_EVENT(xfs_dqget_hit);
  889. DEFINE_DQUOT_EVENT(xfs_dqget_miss);
  890. DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
  891. DEFINE_DQUOT_EVENT(xfs_dqget_dup);
  892. DEFINE_DQUOT_EVENT(xfs_dqput);
  893. DEFINE_DQUOT_EVENT(xfs_dqput_wait);
  894. DEFINE_DQUOT_EVENT(xfs_dqput_free);
  895. DEFINE_DQUOT_EVENT(xfs_dqrele);
  896. DEFINE_DQUOT_EVENT(xfs_dqflush);
  897. DEFINE_DQUOT_EVENT(xfs_dqflush_force);
  898. DEFINE_DQUOT_EVENT(xfs_dqflush_done);
  899. DECLARE_EVENT_CLASS(xfs_loggrant_class,
  900. TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
  901. TP_ARGS(log, tic),
  902. TP_STRUCT__entry(
  903. __field(dev_t, dev)
  904. __field(unsigned, trans_type)
  905. __field(char, ocnt)
  906. __field(char, cnt)
  907. __field(int, curr_res)
  908. __field(int, unit_res)
  909. __field(unsigned int, flags)
  910. __field(int, reserveq)
  911. __field(int, writeq)
  912. __field(int, grant_reserve_cycle)
  913. __field(int, grant_reserve_bytes)
  914. __field(int, grant_write_cycle)
  915. __field(int, grant_write_bytes)
  916. __field(int, curr_cycle)
  917. __field(int, curr_block)
  918. __field(xfs_lsn_t, tail_lsn)
  919. ),
  920. TP_fast_assign(
  921. __entry->dev = log->l_mp->m_super->s_dev;
  922. __entry->trans_type = tic->t_trans_type;
  923. __entry->ocnt = tic->t_ocnt;
  924. __entry->cnt = tic->t_cnt;
  925. __entry->curr_res = tic->t_curr_res;
  926. __entry->unit_res = tic->t_unit_res;
  927. __entry->flags = tic->t_flags;
  928. __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
  929. __entry->writeq = list_empty(&log->l_write_head.waiters);
  930. xlog_crack_grant_head(&log->l_reserve_head.grant,
  931. &__entry->grant_reserve_cycle,
  932. &__entry->grant_reserve_bytes);
  933. xlog_crack_grant_head(&log->l_write_head.grant,
  934. &__entry->grant_write_cycle,
  935. &__entry->grant_write_bytes);
  936. __entry->curr_cycle = log->l_curr_cycle;
  937. __entry->curr_block = log->l_curr_block;
  938. __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
  939. ),
  940. TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
  941. "t_unit_res %u t_flags %s reserveq %s "
  942. "writeq %s grant_reserve_cycle %d "
  943. "grant_reserve_bytes %d grant_write_cycle %d "
  944. "grant_write_bytes %d curr_cycle %d curr_block %d "
  945. "tail_cycle %d tail_block %d",
  946. MAJOR(__entry->dev), MINOR(__entry->dev),
  947. __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
  948. __entry->ocnt,
  949. __entry->cnt,
  950. __entry->curr_res,
  951. __entry->unit_res,
  952. __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
  953. __entry->reserveq ? "empty" : "active",
  954. __entry->writeq ? "empty" : "active",
  955. __entry->grant_reserve_cycle,
  956. __entry->grant_reserve_bytes,
  957. __entry->grant_write_cycle,
  958. __entry->grant_write_bytes,
  959. __entry->curr_cycle,
  960. __entry->curr_block,
  961. CYCLE_LSN(__entry->tail_lsn),
  962. BLOCK_LSN(__entry->tail_lsn)
  963. )
  964. )
  965. #define DEFINE_LOGGRANT_EVENT(name) \
  966. DEFINE_EVENT(xfs_loggrant_class, name, \
  967. TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
  968. TP_ARGS(log, tic))
  969. DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
  970. DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
  971. DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
  972. DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
  973. DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
  974. DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
  975. DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
  976. DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
  977. DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
  978. DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
  979. DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
  980. DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
  981. DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
  982. DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
  983. DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
  984. DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
  985. DECLARE_EVENT_CLASS(xfs_log_item_class,
  986. TP_PROTO(struct xfs_log_item *lip),
  987. TP_ARGS(lip),
  988. TP_STRUCT__entry(
  989. __field(dev_t, dev)
  990. __field(void *, lip)
  991. __field(uint, type)
  992. __field(uint, flags)
  993. __field(xfs_lsn_t, lsn)
  994. ),
  995. TP_fast_assign(
  996. __entry->dev = lip->li_mountp->m_super->s_dev;
  997. __entry->lip = lip;
  998. __entry->type = lip->li_type;
  999. __entry->flags = lip->li_flags;
  1000. __entry->lsn = lip->li_lsn;
  1001. ),
  1002. TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
  1003. MAJOR(__entry->dev), MINOR(__entry->dev),
  1004. __entry->lip,
  1005. CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
  1006. __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
  1007. __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
  1008. )
  1009. TRACE_EVENT(xfs_log_force,
  1010. TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
  1011. TP_ARGS(mp, lsn),
  1012. TP_STRUCT__entry(
  1013. __field(dev_t, dev)
  1014. __field(xfs_lsn_t, lsn)
  1015. ),
  1016. TP_fast_assign(
  1017. __entry->dev = mp->m_super->s_dev;
  1018. __entry->lsn = lsn;
  1019. ),
  1020. TP_printk("dev %d:%d lsn 0x%llx",
  1021. MAJOR(__entry->dev), MINOR(__entry->dev),
  1022. __entry->lsn)
  1023. )
  1024. #define DEFINE_LOG_ITEM_EVENT(name) \
  1025. DEFINE_EVENT(xfs_log_item_class, name, \
  1026. TP_PROTO(struct xfs_log_item *lip), \
  1027. TP_ARGS(lip))
  1028. DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
  1029. DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
  1030. DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
  1031. DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
  1032. DECLARE_EVENT_CLASS(xfs_ail_class,
  1033. TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
  1034. TP_ARGS(lip, old_lsn, new_lsn),
  1035. TP_STRUCT__entry(
  1036. __field(dev_t, dev)
  1037. __field(void *, lip)
  1038. __field(uint, type)
  1039. __field(uint, flags)
  1040. __field(xfs_lsn_t, old_lsn)
  1041. __field(xfs_lsn_t, new_lsn)
  1042. ),
  1043. TP_fast_assign(
  1044. __entry->dev = lip->li_mountp->m_super->s_dev;
  1045. __entry->lip = lip;
  1046. __entry->type = lip->li_type;
  1047. __entry->flags = lip->li_flags;
  1048. __entry->old_lsn = old_lsn;
  1049. __entry->new_lsn = new_lsn;
  1050. ),
  1051. TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
  1052. MAJOR(__entry->dev), MINOR(__entry->dev),
  1053. __entry->lip,
  1054. CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
  1055. CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
  1056. __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
  1057. __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
  1058. )
  1059. #define DEFINE_AIL_EVENT(name) \
  1060. DEFINE_EVENT(xfs_ail_class, name, \
  1061. TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
  1062. TP_ARGS(lip, old_lsn, new_lsn))
  1063. DEFINE_AIL_EVENT(xfs_ail_insert);
  1064. DEFINE_AIL_EVENT(xfs_ail_move);
  1065. DEFINE_AIL_EVENT(xfs_ail_delete);
  1066. TRACE_EVENT(xfs_log_assign_tail_lsn,
  1067. TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
  1068. TP_ARGS(log, new_lsn),
  1069. TP_STRUCT__entry(
  1070. __field(dev_t, dev)
  1071. __field(xfs_lsn_t, new_lsn)
  1072. __field(xfs_lsn_t, old_lsn)
  1073. __field(xfs_lsn_t, last_sync_lsn)
  1074. ),
  1075. TP_fast_assign(
  1076. __entry->dev = log->l_mp->m_super->s_dev;
  1077. __entry->new_lsn = new_lsn;
  1078. __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
  1079. __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
  1080. ),
  1081. TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
  1082. MAJOR(__entry->dev), MINOR(__entry->dev),
  1083. CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
  1084. CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
  1085. CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
  1086. )
  1087. DECLARE_EVENT_CLASS(xfs_file_class,
  1088. TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
  1089. TP_ARGS(ip, count, offset, flags),
  1090. TP_STRUCT__entry(
  1091. __field(dev_t, dev)
  1092. __field(xfs_ino_t, ino)
  1093. __field(xfs_fsize_t, size)
  1094. __field(loff_t, offset)
  1095. __field(size_t, count)
  1096. __field(int, flags)
  1097. ),
  1098. TP_fast_assign(
  1099. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1100. __entry->ino = ip->i_ino;
  1101. __entry->size = ip->i_d.di_size;
  1102. __entry->offset = offset;
  1103. __entry->count = count;
  1104. __entry->flags = flags;
  1105. ),
  1106. TP_printk("dev %d:%d ino 0x%llx size 0x%llx "
  1107. "offset 0x%llx count 0x%zx ioflags %s",
  1108. MAJOR(__entry->dev), MINOR(__entry->dev),
  1109. __entry->ino,
  1110. __entry->size,
  1111. __entry->offset,
  1112. __entry->count,
  1113. __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
  1114. )
  1115. #define DEFINE_RW_EVENT(name) \
  1116. DEFINE_EVENT(xfs_file_class, name, \
  1117. TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
  1118. TP_ARGS(ip, count, offset, flags))
  1119. DEFINE_RW_EVENT(xfs_file_read);
  1120. DEFINE_RW_EVENT(xfs_file_buffered_write);
  1121. DEFINE_RW_EVENT(xfs_file_direct_write);
  1122. DEFINE_RW_EVENT(xfs_file_splice_read);
  1123. DECLARE_EVENT_CLASS(xfs_page_class,
  1124. TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
  1125. unsigned int len),
  1126. TP_ARGS(inode, page, off, len),
  1127. TP_STRUCT__entry(
  1128. __field(dev_t, dev)
  1129. __field(xfs_ino_t, ino)
  1130. __field(pgoff_t, pgoff)
  1131. __field(loff_t, size)
  1132. __field(unsigned long, offset)
  1133. __field(unsigned int, length)
  1134. __field(int, delalloc)
  1135. __field(int, unwritten)
  1136. ),
  1137. TP_fast_assign(
  1138. int delalloc = -1, unwritten = -1;
  1139. if (page_has_buffers(page))
  1140. xfs_count_page_state(page, &delalloc, &unwritten);
  1141. __entry->dev = inode->i_sb->s_dev;
  1142. __entry->ino = XFS_I(inode)->i_ino;
  1143. __entry->pgoff = page_offset(page);
  1144. __entry->size = i_size_read(inode);
  1145. __entry->offset = off;
  1146. __entry->length = len;
  1147. __entry->delalloc = delalloc;
  1148. __entry->unwritten = unwritten;
  1149. ),
  1150. TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
  1151. "length %x delalloc %d unwritten %d",
  1152. MAJOR(__entry->dev), MINOR(__entry->dev),
  1153. __entry->ino,
  1154. __entry->pgoff,
  1155. __entry->size,
  1156. __entry->offset,
  1157. __entry->length,
  1158. __entry->delalloc,
  1159. __entry->unwritten)
  1160. )
  1161. #define DEFINE_PAGE_EVENT(name) \
  1162. DEFINE_EVENT(xfs_page_class, name, \
  1163. TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
  1164. unsigned int len), \
  1165. TP_ARGS(inode, page, off, len))
  1166. DEFINE_PAGE_EVENT(xfs_writepage);
  1167. DEFINE_PAGE_EVENT(xfs_releasepage);
  1168. DEFINE_PAGE_EVENT(xfs_invalidatepage);
  1169. DECLARE_EVENT_CLASS(xfs_imap_class,
  1170. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
  1171. int type, struct xfs_bmbt_irec *irec),
  1172. TP_ARGS(ip, offset, count, type, irec),
  1173. TP_STRUCT__entry(
  1174. __field(dev_t, dev)
  1175. __field(xfs_ino_t, ino)
  1176. __field(loff_t, size)
  1177. __field(loff_t, offset)
  1178. __field(size_t, count)
  1179. __field(int, type)
  1180. __field(xfs_fileoff_t, startoff)
  1181. __field(xfs_fsblock_t, startblock)
  1182. __field(xfs_filblks_t, blockcount)
  1183. ),
  1184. TP_fast_assign(
  1185. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1186. __entry->ino = ip->i_ino;
  1187. __entry->size = ip->i_d.di_size;
  1188. __entry->offset = offset;
  1189. __entry->count = count;
  1190. __entry->type = type;
  1191. __entry->startoff = irec ? irec->br_startoff : 0;
  1192. __entry->startblock = irec ? irec->br_startblock : 0;
  1193. __entry->blockcount = irec ? irec->br_blockcount : 0;
  1194. ),
  1195. TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
  1196. "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
  1197. MAJOR(__entry->dev), MINOR(__entry->dev),
  1198. __entry->ino,
  1199. __entry->size,
  1200. __entry->offset,
  1201. __entry->count,
  1202. __print_symbolic(__entry->type, XFS_IO_TYPES),
  1203. __entry->startoff,
  1204. (__int64_t)__entry->startblock,
  1205. __entry->blockcount)
  1206. )
  1207. #define DEFINE_IOMAP_EVENT(name) \
  1208. DEFINE_EVENT(xfs_imap_class, name, \
  1209. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
  1210. int type, struct xfs_bmbt_irec *irec), \
  1211. TP_ARGS(ip, offset, count, type, irec))
  1212. DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
  1213. DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
  1214. DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
  1215. DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
  1216. DEFINE_IOMAP_EVENT(xfs_gbmap_direct);
  1217. DEFINE_IOMAP_EVENT(xfs_gbmap_direct_new);
  1218. DEFINE_IOMAP_EVENT(xfs_gbmap_direct_update);
  1219. DEFINE_IOMAP_EVENT(xfs_gbmap_direct_none);
  1220. DEFINE_IOMAP_EVENT(xfs_gbmap_direct_endio);
  1221. DECLARE_EVENT_CLASS(xfs_simple_io_class,
  1222. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
  1223. TP_ARGS(ip, offset, count),
  1224. TP_STRUCT__entry(
  1225. __field(dev_t, dev)
  1226. __field(xfs_ino_t, ino)
  1227. __field(loff_t, isize)
  1228. __field(loff_t, disize)
  1229. __field(loff_t, offset)
  1230. __field(size_t, count)
  1231. ),
  1232. TP_fast_assign(
  1233. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1234. __entry->ino = ip->i_ino;
  1235. __entry->isize = VFS_I(ip)->i_size;
  1236. __entry->disize = ip->i_d.di_size;
  1237. __entry->offset = offset;
  1238. __entry->count = count;
  1239. ),
  1240. TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
  1241. "offset 0x%llx count %zd",
  1242. MAJOR(__entry->dev), MINOR(__entry->dev),
  1243. __entry->ino,
  1244. __entry->isize,
  1245. __entry->disize,
  1246. __entry->offset,
  1247. __entry->count)
  1248. );
  1249. #define DEFINE_SIMPLE_IO_EVENT(name) \
  1250. DEFINE_EVENT(xfs_simple_io_class, name, \
  1251. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
  1252. TP_ARGS(ip, offset, count))
  1253. DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
  1254. DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
  1255. DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
  1256. DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
  1257. DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
  1258. DECLARE_EVENT_CLASS(xfs_itrunc_class,
  1259. TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
  1260. TP_ARGS(ip, new_size),
  1261. TP_STRUCT__entry(
  1262. __field(dev_t, dev)
  1263. __field(xfs_ino_t, ino)
  1264. __field(xfs_fsize_t, size)
  1265. __field(xfs_fsize_t, new_size)
  1266. ),
  1267. TP_fast_assign(
  1268. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1269. __entry->ino = ip->i_ino;
  1270. __entry->size = ip->i_d.di_size;
  1271. __entry->new_size = new_size;
  1272. ),
  1273. TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
  1274. MAJOR(__entry->dev), MINOR(__entry->dev),
  1275. __entry->ino,
  1276. __entry->size,
  1277. __entry->new_size)
  1278. )
  1279. #define DEFINE_ITRUNC_EVENT(name) \
  1280. DEFINE_EVENT(xfs_itrunc_class, name, \
  1281. TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
  1282. TP_ARGS(ip, new_size))
  1283. DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
  1284. DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
  1285. TRACE_EVENT(xfs_pagecache_inval,
  1286. TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
  1287. TP_ARGS(ip, start, finish),
  1288. TP_STRUCT__entry(
  1289. __field(dev_t, dev)
  1290. __field(xfs_ino_t, ino)
  1291. __field(xfs_fsize_t, size)
  1292. __field(xfs_off_t, start)
  1293. __field(xfs_off_t, finish)
  1294. ),
  1295. TP_fast_assign(
  1296. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1297. __entry->ino = ip->i_ino;
  1298. __entry->size = ip->i_d.di_size;
  1299. __entry->start = start;
  1300. __entry->finish = finish;
  1301. ),
  1302. TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
  1303. MAJOR(__entry->dev), MINOR(__entry->dev),
  1304. __entry->ino,
  1305. __entry->size,
  1306. __entry->start,
  1307. __entry->finish)
  1308. );
  1309. TRACE_EVENT(xfs_bunmap,
  1310. TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
  1311. int flags, unsigned long caller_ip),
  1312. TP_ARGS(ip, bno, len, flags, caller_ip),
  1313. TP_STRUCT__entry(
  1314. __field(dev_t, dev)
  1315. __field(xfs_ino_t, ino)
  1316. __field(xfs_fsize_t, size)
  1317. __field(xfs_fileoff_t, bno)
  1318. __field(xfs_filblks_t, len)
  1319. __field(unsigned long, caller_ip)
  1320. __field(int, flags)
  1321. ),
  1322. TP_fast_assign(
  1323. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1324. __entry->ino = ip->i_ino;
  1325. __entry->size = ip->i_d.di_size;
  1326. __entry->bno = bno;
  1327. __entry->len = len;
  1328. __entry->caller_ip = caller_ip;
  1329. __entry->flags = flags;
  1330. ),
  1331. TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
  1332. "flags %s caller %ps",
  1333. MAJOR(__entry->dev), MINOR(__entry->dev),
  1334. __entry->ino,
  1335. __entry->size,
  1336. __entry->bno,
  1337. __entry->len,
  1338. __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
  1339. (void *)__entry->caller_ip)
  1340. );
  1341. DECLARE_EVENT_CLASS(xfs_extent_busy_class,
  1342. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  1343. xfs_agblock_t agbno, xfs_extlen_t len),
  1344. TP_ARGS(mp, agno, agbno, len),
  1345. TP_STRUCT__entry(
  1346. __field(dev_t, dev)
  1347. __field(xfs_agnumber_t, agno)
  1348. __field(xfs_agblock_t, agbno)
  1349. __field(xfs_extlen_t, len)
  1350. ),
  1351. TP_fast_assign(
  1352. __entry->dev = mp->m_super->s_dev;
  1353. __entry->agno = agno;
  1354. __entry->agbno = agbno;
  1355. __entry->len = len;
  1356. ),
  1357. TP_printk("dev %d:%d agno %u agbno %u len %u",
  1358. MAJOR(__entry->dev), MINOR(__entry->dev),
  1359. __entry->agno,
  1360. __entry->agbno,
  1361. __entry->len)
  1362. );
  1363. #define DEFINE_BUSY_EVENT(name) \
  1364. DEFINE_EVENT(xfs_extent_busy_class, name, \
  1365. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  1366. xfs_agblock_t agbno, xfs_extlen_t len), \
  1367. TP_ARGS(mp, agno, agbno, len))
  1368. DEFINE_BUSY_EVENT(xfs_extent_busy);
  1369. DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
  1370. DEFINE_BUSY_EVENT(xfs_extent_busy_force);
  1371. DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
  1372. DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
  1373. TRACE_EVENT(xfs_extent_busy_trim,
  1374. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  1375. xfs_agblock_t agbno, xfs_extlen_t len,
  1376. xfs_agblock_t tbno, xfs_extlen_t tlen),
  1377. TP_ARGS(mp, agno, agbno, len, tbno, tlen),
  1378. TP_STRUCT__entry(
  1379. __field(dev_t, dev)
  1380. __field(xfs_agnumber_t, agno)
  1381. __field(xfs_agblock_t, agbno)
  1382. __field(xfs_extlen_t, len)
  1383. __field(xfs_agblock_t, tbno)
  1384. __field(xfs_extlen_t, tlen)
  1385. ),
  1386. TP_fast_assign(
  1387. __entry->dev = mp->m_super->s_dev;
  1388. __entry->agno = agno;
  1389. __entry->agbno = agbno;
  1390. __entry->len = len;
  1391. __entry->tbno = tbno;
  1392. __entry->tlen = tlen;
  1393. ),
  1394. TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
  1395. MAJOR(__entry->dev), MINOR(__entry->dev),
  1396. __entry->agno,
  1397. __entry->agbno,
  1398. __entry->len,
  1399. __entry->tbno,
  1400. __entry->tlen)
  1401. );
  1402. TRACE_EVENT(xfs_trans_commit_lsn,
  1403. TP_PROTO(struct xfs_trans *trans),
  1404. TP_ARGS(trans),
  1405. TP_STRUCT__entry(
  1406. __field(dev_t, dev)
  1407. __field(struct xfs_trans *, tp)
  1408. __field(xfs_lsn_t, lsn)
  1409. ),
  1410. TP_fast_assign(
  1411. __entry->dev = trans->t_mountp->m_super->s_dev;
  1412. __entry->tp = trans;
  1413. __entry->lsn = trans->t_commit_lsn;
  1414. ),
  1415. TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
  1416. MAJOR(__entry->dev), MINOR(__entry->dev),
  1417. __entry->tp,
  1418. __entry->lsn)
  1419. );
  1420. DECLARE_EVENT_CLASS(xfs_agf_class,
  1421. TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
  1422. unsigned long caller_ip),
  1423. TP_ARGS(mp, agf, flags, caller_ip),
  1424. TP_STRUCT__entry(
  1425. __field(dev_t, dev)
  1426. __field(xfs_agnumber_t, agno)
  1427. __field(int, flags)
  1428. __field(__u32, length)
  1429. __field(__u32, bno_root)
  1430. __field(__u32, cnt_root)
  1431. __field(__u32, bno_level)
  1432. __field(__u32, cnt_level)
  1433. __field(__u32, flfirst)
  1434. __field(__u32, fllast)
  1435. __field(__u32, flcount)
  1436. __field(__u32, freeblks)
  1437. __field(__u32, longest)
  1438. __field(unsigned long, caller_ip)
  1439. ),
  1440. TP_fast_assign(
  1441. __entry->dev = mp->m_super->s_dev;
  1442. __entry->agno = be32_to_cpu(agf->agf_seqno),
  1443. __entry->flags = flags;
  1444. __entry->length = be32_to_cpu(agf->agf_length),
  1445. __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
  1446. __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
  1447. __entry->bno_level =
  1448. be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
  1449. __entry->cnt_level =
  1450. be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
  1451. __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
  1452. __entry->fllast = be32_to_cpu(agf->agf_fllast),
  1453. __entry->flcount = be32_to_cpu(agf->agf_flcount),
  1454. __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
  1455. __entry->longest = be32_to_cpu(agf->agf_longest);
  1456. __entry->caller_ip = caller_ip;
  1457. ),
  1458. TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
  1459. "levels b %u c %u flfirst %u fllast %u flcount %u "
  1460. "freeblks %u longest %u caller %ps",
  1461. MAJOR(__entry->dev), MINOR(__entry->dev),
  1462. __entry->agno,
  1463. __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
  1464. __entry->length,
  1465. __entry->bno_root,
  1466. __entry->cnt_root,
  1467. __entry->bno_level,
  1468. __entry->cnt_level,
  1469. __entry->flfirst,
  1470. __entry->fllast,
  1471. __entry->flcount,
  1472. __entry->freeblks,
  1473. __entry->longest,
  1474. (void *)__entry->caller_ip)
  1475. );
  1476. #define DEFINE_AGF_EVENT(name) \
  1477. DEFINE_EVENT(xfs_agf_class, name, \
  1478. TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
  1479. unsigned long caller_ip), \
  1480. TP_ARGS(mp, agf, flags, caller_ip))
  1481. DEFINE_AGF_EVENT(xfs_agf);
  1482. DEFINE_AGF_EVENT(xfs_agfl_reset);
  1483. TRACE_EVENT(xfs_free_extent,
  1484. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
  1485. xfs_extlen_t len, bool isfl, int haveleft, int haveright),
  1486. TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
  1487. TP_STRUCT__entry(
  1488. __field(dev_t, dev)
  1489. __field(xfs_agnumber_t, agno)
  1490. __field(xfs_agblock_t, agbno)
  1491. __field(xfs_extlen_t, len)
  1492. __field(int, isfl)
  1493. __field(int, haveleft)
  1494. __field(int, haveright)
  1495. ),
  1496. TP_fast_assign(
  1497. __entry->dev = mp->m_super->s_dev;
  1498. __entry->agno = agno;
  1499. __entry->agbno = agbno;
  1500. __entry->len = len;
  1501. __entry->isfl = isfl;
  1502. __entry->haveleft = haveleft;
  1503. __entry->haveright = haveright;
  1504. ),
  1505. TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
  1506. MAJOR(__entry->dev), MINOR(__entry->dev),
  1507. __entry->agno,
  1508. __entry->agbno,
  1509. __entry->len,
  1510. __entry->isfl,
  1511. __entry->haveleft ?
  1512. (__entry->haveright ? "both" : "left") :
  1513. (__entry->haveright ? "right" : "none"))
  1514. );
  1515. DECLARE_EVENT_CLASS(xfs_alloc_class,
  1516. TP_PROTO(struct xfs_alloc_arg *args),
  1517. TP_ARGS(args),
  1518. TP_STRUCT__entry(
  1519. __field(dev_t, dev)
  1520. __field(xfs_agnumber_t, agno)
  1521. __field(xfs_agblock_t, agbno)
  1522. __field(xfs_extlen_t, minlen)
  1523. __field(xfs_extlen_t, maxlen)
  1524. __field(xfs_extlen_t, mod)
  1525. __field(xfs_extlen_t, prod)
  1526. __field(xfs_extlen_t, minleft)
  1527. __field(xfs_extlen_t, total)
  1528. __field(xfs_extlen_t, alignment)
  1529. __field(xfs_extlen_t, minalignslop)
  1530. __field(xfs_extlen_t, len)
  1531. __field(short, type)
  1532. __field(short, otype)
  1533. __field(char, wasdel)
  1534. __field(char, wasfromfl)
  1535. __field(char, isfl)
  1536. __field(char, userdata)
  1537. __field(xfs_fsblock_t, firstblock)
  1538. ),
  1539. TP_fast_assign(
  1540. __entry->dev = args->mp->m_super->s_dev;
  1541. __entry->agno = args->agno;
  1542. __entry->agbno = args->agbno;
  1543. __entry->minlen = args->minlen;
  1544. __entry->maxlen = args->maxlen;
  1545. __entry->mod = args->mod;
  1546. __entry->prod = args->prod;
  1547. __entry->minleft = args->minleft;
  1548. __entry->total = args->total;
  1549. __entry->alignment = args->alignment;
  1550. __entry->minalignslop = args->minalignslop;
  1551. __entry->len = args->len;
  1552. __entry->type = args->type;
  1553. __entry->otype = args->otype;
  1554. __entry->wasdel = args->wasdel;
  1555. __entry->wasfromfl = args->wasfromfl;
  1556. __entry->isfl = args->isfl;
  1557. __entry->userdata = args->userdata;
  1558. __entry->firstblock = args->firstblock;
  1559. ),
  1560. TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
  1561. "prod %u minleft %u total %u alignment %u minalignslop %u "
  1562. "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
  1563. "userdata %d firstblock 0x%llx",
  1564. MAJOR(__entry->dev), MINOR(__entry->dev),
  1565. __entry->agno,
  1566. __entry->agbno,
  1567. __entry->minlen,
  1568. __entry->maxlen,
  1569. __entry->mod,
  1570. __entry->prod,
  1571. __entry->minleft,
  1572. __entry->total,
  1573. __entry->alignment,
  1574. __entry->minalignslop,
  1575. __entry->len,
  1576. __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
  1577. __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
  1578. __entry->wasdel,
  1579. __entry->wasfromfl,
  1580. __entry->isfl,
  1581. __entry->userdata,
  1582. (unsigned long long)__entry->firstblock)
  1583. )
  1584. #define DEFINE_ALLOC_EVENT(name) \
  1585. DEFINE_EVENT(xfs_alloc_class, name, \
  1586. TP_PROTO(struct xfs_alloc_arg *args), \
  1587. TP_ARGS(args))
  1588. DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
  1589. DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
  1590. DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
  1591. DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
  1592. DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
  1593. DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
  1594. DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
  1595. DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
  1596. DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
  1597. DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
  1598. DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
  1599. DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
  1600. DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
  1601. DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
  1602. DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
  1603. DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
  1604. DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
  1605. DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
  1606. DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
  1607. DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
  1608. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
  1609. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
  1610. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
  1611. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
  1612. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
  1613. DECLARE_EVENT_CLASS(xfs_da_class,
  1614. TP_PROTO(struct xfs_da_args *args),
  1615. TP_ARGS(args),
  1616. TP_STRUCT__entry(
  1617. __field(dev_t, dev)
  1618. __field(xfs_ino_t, ino)
  1619. __dynamic_array(char, name, args->namelen)
  1620. __field(int, namelen)
  1621. __field(xfs_dahash_t, hashval)
  1622. __field(xfs_ino_t, inumber)
  1623. __field(int, op_flags)
  1624. ),
  1625. TP_fast_assign(
  1626. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1627. __entry->ino = args->dp->i_ino;
  1628. if (args->namelen)
  1629. memcpy(__get_str(name), args->name, args->namelen);
  1630. __entry->namelen = args->namelen;
  1631. __entry->hashval = args->hashval;
  1632. __entry->inumber = args->inumber;
  1633. __entry->op_flags = args->op_flags;
  1634. ),
  1635. TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
  1636. "inumber 0x%llx op_flags %s",
  1637. MAJOR(__entry->dev), MINOR(__entry->dev),
  1638. __entry->ino,
  1639. __entry->namelen,
  1640. __entry->namelen ? __get_str(name) : NULL,
  1641. __entry->namelen,
  1642. __entry->hashval,
  1643. __entry->inumber,
  1644. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
  1645. )
  1646. #define DEFINE_DIR2_EVENT(name) \
  1647. DEFINE_EVENT(xfs_da_class, name, \
  1648. TP_PROTO(struct xfs_da_args *args), \
  1649. TP_ARGS(args))
  1650. DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
  1651. DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
  1652. DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
  1653. DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
  1654. DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
  1655. DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
  1656. DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
  1657. DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
  1658. DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
  1659. DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
  1660. DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
  1661. DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
  1662. DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
  1663. DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
  1664. DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
  1665. DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
  1666. DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
  1667. DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
  1668. DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
  1669. DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
  1670. DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
  1671. DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
  1672. DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
  1673. DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
  1674. DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
  1675. DECLARE_EVENT_CLASS(xfs_attr_class,
  1676. TP_PROTO(struct xfs_da_args *args),
  1677. TP_ARGS(args),
  1678. TP_STRUCT__entry(
  1679. __field(dev_t, dev)
  1680. __field(xfs_ino_t, ino)
  1681. __dynamic_array(char, name, args->namelen)
  1682. __field(int, namelen)
  1683. __field(int, valuelen)
  1684. __field(xfs_dahash_t, hashval)
  1685. __field(int, op_flags)
  1686. ),
  1687. TP_fast_assign(
  1688. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1689. __entry->ino = args->dp->i_ino;
  1690. if (args->namelen)
  1691. memcpy(__get_str(name), args->name, args->namelen);
  1692. __entry->namelen = args->namelen;
  1693. __entry->valuelen = args->valuelen;
  1694. __entry->hashval = args->hashval;
  1695. __entry->op_flags = args->op_flags;
  1696. ),
  1697. TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
  1698. "hashval 0x%x op_flags %s",
  1699. MAJOR(__entry->dev), MINOR(__entry->dev),
  1700. __entry->ino,
  1701. __entry->namelen,
  1702. __entry->namelen ? __get_str(name) : NULL,
  1703. __entry->namelen,
  1704. __entry->valuelen,
  1705. __entry->hashval,
  1706. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
  1707. )
  1708. #define DEFINE_ATTR_EVENT(name) \
  1709. DEFINE_EVENT(xfs_attr_class, name, \
  1710. TP_PROTO(struct xfs_da_args *args), \
  1711. TP_ARGS(args))
  1712. DEFINE_ATTR_EVENT(xfs_attr_sf_add);
  1713. DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
  1714. DEFINE_ATTR_EVENT(xfs_attr_sf_create);
  1715. DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
  1716. DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
  1717. DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
  1718. DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
  1719. DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
  1720. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
  1721. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
  1722. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
  1723. DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
  1724. DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
  1725. DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
  1726. DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
  1727. DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
  1728. DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
  1729. DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
  1730. DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
  1731. DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
  1732. DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
  1733. DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
  1734. DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
  1735. DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
  1736. DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
  1737. DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
  1738. DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
  1739. DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
  1740. DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
  1741. DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
  1742. DEFINE_ATTR_EVENT(xfs_attr_node_addname);
  1743. DEFINE_ATTR_EVENT(xfs_attr_node_get);
  1744. DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
  1745. DEFINE_ATTR_EVENT(xfs_attr_node_replace);
  1746. DEFINE_ATTR_EVENT(xfs_attr_node_removename);
  1747. DEFINE_ATTR_EVENT(xfs_attr_fillstate);
  1748. DEFINE_ATTR_EVENT(xfs_attr_refillstate);
  1749. DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
  1750. DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
  1751. DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
  1752. #define DEFINE_DA_EVENT(name) \
  1753. DEFINE_EVENT(xfs_da_class, name, \
  1754. TP_PROTO(struct xfs_da_args *args), \
  1755. TP_ARGS(args))
  1756. DEFINE_DA_EVENT(xfs_da_split);
  1757. DEFINE_DA_EVENT(xfs_da_join);
  1758. DEFINE_DA_EVENT(xfs_da_link_before);
  1759. DEFINE_DA_EVENT(xfs_da_link_after);
  1760. DEFINE_DA_EVENT(xfs_da_unlink_back);
  1761. DEFINE_DA_EVENT(xfs_da_unlink_forward);
  1762. DEFINE_DA_EVENT(xfs_da_root_split);
  1763. DEFINE_DA_EVENT(xfs_da_root_join);
  1764. DEFINE_DA_EVENT(xfs_da_node_add);
  1765. DEFINE_DA_EVENT(xfs_da_node_create);
  1766. DEFINE_DA_EVENT(xfs_da_node_split);
  1767. DEFINE_DA_EVENT(xfs_da_node_remove);
  1768. DEFINE_DA_EVENT(xfs_da_node_rebalance);
  1769. DEFINE_DA_EVENT(xfs_da_node_unbalance);
  1770. DEFINE_DA_EVENT(xfs_da_node_toosmall);
  1771. DEFINE_DA_EVENT(xfs_da_swap_lastblock);
  1772. DEFINE_DA_EVENT(xfs_da_grow_inode);
  1773. DEFINE_DA_EVENT(xfs_da_shrink_inode);
  1774. DEFINE_DA_EVENT(xfs_da_fixhashpath);
  1775. DEFINE_DA_EVENT(xfs_da_path_shift);
  1776. DECLARE_EVENT_CLASS(xfs_dir2_space_class,
  1777. TP_PROTO(struct xfs_da_args *args, int idx),
  1778. TP_ARGS(args, idx),
  1779. TP_STRUCT__entry(
  1780. __field(dev_t, dev)
  1781. __field(xfs_ino_t, ino)
  1782. __field(int, op_flags)
  1783. __field(int, idx)
  1784. ),
  1785. TP_fast_assign(
  1786. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1787. __entry->ino = args->dp->i_ino;
  1788. __entry->op_flags = args->op_flags;
  1789. __entry->idx = idx;
  1790. ),
  1791. TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
  1792. MAJOR(__entry->dev), MINOR(__entry->dev),
  1793. __entry->ino,
  1794. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
  1795. __entry->idx)
  1796. )
  1797. #define DEFINE_DIR2_SPACE_EVENT(name) \
  1798. DEFINE_EVENT(xfs_dir2_space_class, name, \
  1799. TP_PROTO(struct xfs_da_args *args, int idx), \
  1800. TP_ARGS(args, idx))
  1801. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
  1802. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
  1803. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
  1804. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
  1805. TRACE_EVENT(xfs_dir2_leafn_moveents,
  1806. TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
  1807. TP_ARGS(args, src_idx, dst_idx, count),
  1808. TP_STRUCT__entry(
  1809. __field(dev_t, dev)
  1810. __field(xfs_ino_t, ino)
  1811. __field(int, op_flags)
  1812. __field(int, src_idx)
  1813. __field(int, dst_idx)
  1814. __field(int, count)
  1815. ),
  1816. TP_fast_assign(
  1817. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1818. __entry->ino = args->dp->i_ino;
  1819. __entry->op_flags = args->op_flags;
  1820. __entry->src_idx = src_idx;
  1821. __entry->dst_idx = dst_idx;
  1822. __entry->count = count;
  1823. ),
  1824. TP_printk("dev %d:%d ino 0x%llx op_flags %s "
  1825. "src_idx %d dst_idx %d count %d",
  1826. MAJOR(__entry->dev), MINOR(__entry->dev),
  1827. __entry->ino,
  1828. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
  1829. __entry->src_idx,
  1830. __entry->dst_idx,
  1831. __entry->count)
  1832. );
  1833. #define XFS_SWAPEXT_INODES \
  1834. { 0, "target" }, \
  1835. { 1, "temp" }
  1836. #define XFS_INODE_FORMAT_STR \
  1837. { 0, "invalid" }, \
  1838. { 1, "local" }, \
  1839. { 2, "extent" }, \
  1840. { 3, "btree" }
  1841. DECLARE_EVENT_CLASS(xfs_swap_extent_class,
  1842. TP_PROTO(struct xfs_inode *ip, int which),
  1843. TP_ARGS(ip, which),
  1844. TP_STRUCT__entry(
  1845. __field(dev_t, dev)
  1846. __field(int, which)
  1847. __field(xfs_ino_t, ino)
  1848. __field(int, format)
  1849. __field(int, nex)
  1850. __field(int, broot_size)
  1851. __field(int, fork_off)
  1852. ),
  1853. TP_fast_assign(
  1854. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1855. __entry->which = which;
  1856. __entry->ino = ip->i_ino;
  1857. __entry->format = ip->i_d.di_format;
  1858. __entry->nex = ip->i_d.di_nextents;
  1859. __entry->broot_size = ip->i_df.if_broot_bytes;
  1860. __entry->fork_off = XFS_IFORK_BOFF(ip);
  1861. ),
  1862. TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
  1863. "broot size %d, fork offset %d",
  1864. MAJOR(__entry->dev), MINOR(__entry->dev),
  1865. __entry->ino,
  1866. __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
  1867. __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
  1868. __entry->nex,
  1869. __entry->broot_size,
  1870. __entry->fork_off)
  1871. )
  1872. #define DEFINE_SWAPEXT_EVENT(name) \
  1873. DEFINE_EVENT(xfs_swap_extent_class, name, \
  1874. TP_PROTO(struct xfs_inode *ip, int which), \
  1875. TP_ARGS(ip, which))
  1876. DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
  1877. DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
  1878. DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
  1879. TP_PROTO(struct xlog *log, struct xlog_recover *trans,
  1880. struct xlog_recover_item *item, int pass),
  1881. TP_ARGS(log, trans, item, pass),
  1882. TP_STRUCT__entry(
  1883. __field(dev_t, dev)
  1884. __field(unsigned long, item)
  1885. __field(xlog_tid_t, tid)
  1886. __field(int, type)
  1887. __field(int, pass)
  1888. __field(int, count)
  1889. __field(int, total)
  1890. ),
  1891. TP_fast_assign(
  1892. __entry->dev = log->l_mp->m_super->s_dev;
  1893. __entry->item = (unsigned long)item;
  1894. __entry->tid = trans->r_log_tid;
  1895. __entry->type = ITEM_TYPE(item);
  1896. __entry->pass = pass;
  1897. __entry->count = item->ri_cnt;
  1898. __entry->total = item->ri_total;
  1899. ),
  1900. TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
  1901. "item region count/total %d/%d",
  1902. MAJOR(__entry->dev), MINOR(__entry->dev),
  1903. __entry->tid,
  1904. __entry->pass,
  1905. (void *)__entry->item,
  1906. __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
  1907. __entry->count,
  1908. __entry->total)
  1909. )
  1910. #define DEFINE_LOG_RECOVER_ITEM(name) \
  1911. DEFINE_EVENT(xfs_log_recover_item_class, name, \
  1912. TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
  1913. struct xlog_recover_item *item, int pass), \
  1914. TP_ARGS(log, trans, item, pass))
  1915. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
  1916. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
  1917. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
  1918. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
  1919. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
  1920. DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
  1921. TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
  1922. TP_ARGS(log, buf_f),
  1923. TP_STRUCT__entry(
  1924. __field(dev_t, dev)
  1925. __field(__int64_t, blkno)
  1926. __field(unsigned short, len)
  1927. __field(unsigned short, flags)
  1928. __field(unsigned short, size)
  1929. __field(unsigned int, map_size)
  1930. ),
  1931. TP_fast_assign(
  1932. __entry->dev = log->l_mp->m_super->s_dev;
  1933. __entry->blkno = buf_f->blf_blkno;
  1934. __entry->len = buf_f->blf_len;
  1935. __entry->flags = buf_f->blf_flags;
  1936. __entry->size = buf_f->blf_size;
  1937. __entry->map_size = buf_f->blf_map_size;
  1938. ),
  1939. TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
  1940. "map_size %d",
  1941. MAJOR(__entry->dev), MINOR(__entry->dev),
  1942. __entry->blkno,
  1943. __entry->len,
  1944. __entry->flags,
  1945. __entry->size,
  1946. __entry->map_size)
  1947. )
  1948. #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
  1949. DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
  1950. TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
  1951. TP_ARGS(log, buf_f))
  1952. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
  1953. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
  1954. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
  1955. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
  1956. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
  1957. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
  1958. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
  1959. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
  1960. DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
  1961. TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
  1962. TP_ARGS(log, in_f),
  1963. TP_STRUCT__entry(
  1964. __field(dev_t, dev)
  1965. __field(xfs_ino_t, ino)
  1966. __field(unsigned short, size)
  1967. __field(int, fields)
  1968. __field(unsigned short, asize)
  1969. __field(unsigned short, dsize)
  1970. __field(__int64_t, blkno)
  1971. __field(int, len)
  1972. __field(int, boffset)
  1973. ),
  1974. TP_fast_assign(
  1975. __entry->dev = log->l_mp->m_super->s_dev;
  1976. __entry->ino = in_f->ilf_ino;
  1977. __entry->size = in_f->ilf_size;
  1978. __entry->fields = in_f->ilf_fields;
  1979. __entry->asize = in_f->ilf_asize;
  1980. __entry->dsize = in_f->ilf_dsize;
  1981. __entry->blkno = in_f->ilf_blkno;
  1982. __entry->len = in_f->ilf_len;
  1983. __entry->boffset = in_f->ilf_boffset;
  1984. ),
  1985. TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
  1986. "dsize %d, blkno 0x%llx, len %d, boffset %d",
  1987. MAJOR(__entry->dev), MINOR(__entry->dev),
  1988. __entry->ino,
  1989. __entry->size,
  1990. __entry->fields,
  1991. __entry->asize,
  1992. __entry->dsize,
  1993. __entry->blkno,
  1994. __entry->len,
  1995. __entry->boffset)
  1996. )
  1997. #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
  1998. DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
  1999. TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
  2000. TP_ARGS(log, in_f))
  2001. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
  2002. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
  2003. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
  2004. DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
  2005. TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
  2006. TP_ARGS(log, in_f),
  2007. TP_STRUCT__entry(
  2008. __field(dev_t, dev)
  2009. __field(xfs_agnumber_t, agno)
  2010. __field(xfs_agblock_t, agbno)
  2011. __field(unsigned int, count)
  2012. __field(unsigned int, isize)
  2013. __field(xfs_agblock_t, length)
  2014. __field(unsigned int, gen)
  2015. ),
  2016. TP_fast_assign(
  2017. __entry->dev = log->l_mp->m_super->s_dev;
  2018. __entry->agno = be32_to_cpu(in_f->icl_ag);
  2019. __entry->agbno = be32_to_cpu(in_f->icl_agbno);
  2020. __entry->count = be32_to_cpu(in_f->icl_count);
  2021. __entry->isize = be32_to_cpu(in_f->icl_isize);
  2022. __entry->length = be32_to_cpu(in_f->icl_length);
  2023. __entry->gen = be32_to_cpu(in_f->icl_gen);
  2024. ),
  2025. TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
  2026. "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
  2027. __entry->agno, __entry->agbno, __entry->count, __entry->isize,
  2028. __entry->length, __entry->gen)
  2029. )
  2030. #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
  2031. DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
  2032. TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
  2033. TP_ARGS(log, in_f))
  2034. DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
  2035. DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
  2036. DECLARE_EVENT_CLASS(xfs_discard_class,
  2037. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2038. xfs_agblock_t agbno, xfs_extlen_t len),
  2039. TP_ARGS(mp, agno, agbno, len),
  2040. TP_STRUCT__entry(
  2041. __field(dev_t, dev)
  2042. __field(xfs_agnumber_t, agno)
  2043. __field(xfs_agblock_t, agbno)
  2044. __field(xfs_extlen_t, len)
  2045. ),
  2046. TP_fast_assign(
  2047. __entry->dev = mp->m_super->s_dev;
  2048. __entry->agno = agno;
  2049. __entry->agbno = agbno;
  2050. __entry->len = len;
  2051. ),
  2052. TP_printk("dev %d:%d agno %u agbno %u len %u\n",
  2053. MAJOR(__entry->dev), MINOR(__entry->dev),
  2054. __entry->agno,
  2055. __entry->agbno,
  2056. __entry->len)
  2057. )
  2058. #define DEFINE_DISCARD_EVENT(name) \
  2059. DEFINE_EVENT(xfs_discard_class, name, \
  2060. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2061. xfs_agblock_t agbno, xfs_extlen_t len), \
  2062. TP_ARGS(mp, agno, agbno, len))
  2063. DEFINE_DISCARD_EVENT(xfs_discard_extent);
  2064. DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
  2065. DEFINE_DISCARD_EVENT(xfs_discard_exclude);
  2066. DEFINE_DISCARD_EVENT(xfs_discard_busy);
  2067. #endif /* _TRACE_XFS_H */
  2068. #undef TRACE_INCLUDE_PATH
  2069. #define TRACE_INCLUDE_PATH .
  2070. #define TRACE_INCLUDE_FILE xfs_trace
  2071. #include <trace/define_trace.h>