xfs_trace.h 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193
  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_readpage_class,
  1170. TP_PROTO(struct inode *inode, int nr_pages),
  1171. TP_ARGS(inode, nr_pages),
  1172. TP_STRUCT__entry(
  1173. __field(dev_t, dev)
  1174. __field(xfs_ino_t, ino)
  1175. __field(int, nr_pages)
  1176. ),
  1177. TP_fast_assign(
  1178. __entry->dev = inode->i_sb->s_dev;
  1179. __entry->ino = inode->i_ino;
  1180. __entry->nr_pages = nr_pages;
  1181. ),
  1182. TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
  1183. MAJOR(__entry->dev), MINOR(__entry->dev),
  1184. __entry->ino,
  1185. __entry->nr_pages)
  1186. )
  1187. #define DEFINE_READPAGE_EVENT(name) \
  1188. DEFINE_EVENT(xfs_readpage_class, name, \
  1189. TP_PROTO(struct inode *inode, int nr_pages), \
  1190. TP_ARGS(inode, nr_pages))
  1191. DEFINE_READPAGE_EVENT(xfs_vm_readpage);
  1192. DEFINE_READPAGE_EVENT(xfs_vm_readpages);
  1193. DECLARE_EVENT_CLASS(xfs_imap_class,
  1194. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
  1195. int type, struct xfs_bmbt_irec *irec),
  1196. TP_ARGS(ip, offset, count, type, irec),
  1197. TP_STRUCT__entry(
  1198. __field(dev_t, dev)
  1199. __field(xfs_ino_t, ino)
  1200. __field(loff_t, size)
  1201. __field(loff_t, offset)
  1202. __field(size_t, count)
  1203. __field(int, type)
  1204. __field(xfs_fileoff_t, startoff)
  1205. __field(xfs_fsblock_t, startblock)
  1206. __field(xfs_filblks_t, blockcount)
  1207. ),
  1208. TP_fast_assign(
  1209. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1210. __entry->ino = ip->i_ino;
  1211. __entry->size = ip->i_d.di_size;
  1212. __entry->offset = offset;
  1213. __entry->count = count;
  1214. __entry->type = type;
  1215. __entry->startoff = irec ? irec->br_startoff : 0;
  1216. __entry->startblock = irec ? irec->br_startblock : 0;
  1217. __entry->blockcount = irec ? irec->br_blockcount : 0;
  1218. ),
  1219. TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
  1220. "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
  1221. MAJOR(__entry->dev), MINOR(__entry->dev),
  1222. __entry->ino,
  1223. __entry->size,
  1224. __entry->offset,
  1225. __entry->count,
  1226. __print_symbolic(__entry->type, XFS_IO_TYPES),
  1227. __entry->startoff,
  1228. (__int64_t)__entry->startblock,
  1229. __entry->blockcount)
  1230. )
  1231. #define DEFINE_IOMAP_EVENT(name) \
  1232. DEFINE_EVENT(xfs_imap_class, name, \
  1233. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
  1234. int type, struct xfs_bmbt_irec *irec), \
  1235. TP_ARGS(ip, offset, count, type, irec))
  1236. DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
  1237. DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
  1238. DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
  1239. DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
  1240. DEFINE_IOMAP_EVENT(xfs_gbmap_direct);
  1241. DEFINE_IOMAP_EVENT(xfs_gbmap_direct_new);
  1242. DEFINE_IOMAP_EVENT(xfs_gbmap_direct_update);
  1243. DEFINE_IOMAP_EVENT(xfs_gbmap_direct_none);
  1244. DEFINE_IOMAP_EVENT(xfs_gbmap_direct_endio);
  1245. DECLARE_EVENT_CLASS(xfs_simple_io_class,
  1246. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
  1247. TP_ARGS(ip, offset, count),
  1248. TP_STRUCT__entry(
  1249. __field(dev_t, dev)
  1250. __field(xfs_ino_t, ino)
  1251. __field(loff_t, isize)
  1252. __field(loff_t, disize)
  1253. __field(loff_t, offset)
  1254. __field(size_t, count)
  1255. ),
  1256. TP_fast_assign(
  1257. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1258. __entry->ino = ip->i_ino;
  1259. __entry->isize = VFS_I(ip)->i_size;
  1260. __entry->disize = ip->i_d.di_size;
  1261. __entry->offset = offset;
  1262. __entry->count = count;
  1263. ),
  1264. TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
  1265. "offset 0x%llx count %zd",
  1266. MAJOR(__entry->dev), MINOR(__entry->dev),
  1267. __entry->ino,
  1268. __entry->isize,
  1269. __entry->disize,
  1270. __entry->offset,
  1271. __entry->count)
  1272. );
  1273. #define DEFINE_SIMPLE_IO_EVENT(name) \
  1274. DEFINE_EVENT(xfs_simple_io_class, name, \
  1275. TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
  1276. TP_ARGS(ip, offset, count))
  1277. DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
  1278. DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
  1279. DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
  1280. DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
  1281. DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
  1282. DECLARE_EVENT_CLASS(xfs_itrunc_class,
  1283. TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
  1284. TP_ARGS(ip, new_size),
  1285. TP_STRUCT__entry(
  1286. __field(dev_t, dev)
  1287. __field(xfs_ino_t, ino)
  1288. __field(xfs_fsize_t, size)
  1289. __field(xfs_fsize_t, new_size)
  1290. ),
  1291. TP_fast_assign(
  1292. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1293. __entry->ino = ip->i_ino;
  1294. __entry->size = ip->i_d.di_size;
  1295. __entry->new_size = new_size;
  1296. ),
  1297. TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
  1298. MAJOR(__entry->dev), MINOR(__entry->dev),
  1299. __entry->ino,
  1300. __entry->size,
  1301. __entry->new_size)
  1302. )
  1303. #define DEFINE_ITRUNC_EVENT(name) \
  1304. DEFINE_EVENT(xfs_itrunc_class, name, \
  1305. TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
  1306. TP_ARGS(ip, new_size))
  1307. DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
  1308. DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
  1309. TRACE_EVENT(xfs_pagecache_inval,
  1310. TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
  1311. TP_ARGS(ip, start, finish),
  1312. TP_STRUCT__entry(
  1313. __field(dev_t, dev)
  1314. __field(xfs_ino_t, ino)
  1315. __field(xfs_fsize_t, size)
  1316. __field(xfs_off_t, start)
  1317. __field(xfs_off_t, finish)
  1318. ),
  1319. TP_fast_assign(
  1320. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1321. __entry->ino = ip->i_ino;
  1322. __entry->size = ip->i_d.di_size;
  1323. __entry->start = start;
  1324. __entry->finish = finish;
  1325. ),
  1326. TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
  1327. MAJOR(__entry->dev), MINOR(__entry->dev),
  1328. __entry->ino,
  1329. __entry->size,
  1330. __entry->start,
  1331. __entry->finish)
  1332. );
  1333. TRACE_EVENT(xfs_bunmap,
  1334. TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
  1335. int flags, unsigned long caller_ip),
  1336. TP_ARGS(ip, bno, len, flags, caller_ip),
  1337. TP_STRUCT__entry(
  1338. __field(dev_t, dev)
  1339. __field(xfs_ino_t, ino)
  1340. __field(xfs_fsize_t, size)
  1341. __field(xfs_fileoff_t, bno)
  1342. __field(xfs_filblks_t, len)
  1343. __field(unsigned long, caller_ip)
  1344. __field(int, flags)
  1345. ),
  1346. TP_fast_assign(
  1347. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1348. __entry->ino = ip->i_ino;
  1349. __entry->size = ip->i_d.di_size;
  1350. __entry->bno = bno;
  1351. __entry->len = len;
  1352. __entry->caller_ip = caller_ip;
  1353. __entry->flags = flags;
  1354. ),
  1355. TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
  1356. "flags %s caller %ps",
  1357. MAJOR(__entry->dev), MINOR(__entry->dev),
  1358. __entry->ino,
  1359. __entry->size,
  1360. __entry->bno,
  1361. __entry->len,
  1362. __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
  1363. (void *)__entry->caller_ip)
  1364. );
  1365. DECLARE_EVENT_CLASS(xfs_extent_busy_class,
  1366. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  1367. xfs_agblock_t agbno, xfs_extlen_t len),
  1368. TP_ARGS(mp, agno, agbno, len),
  1369. TP_STRUCT__entry(
  1370. __field(dev_t, dev)
  1371. __field(xfs_agnumber_t, agno)
  1372. __field(xfs_agblock_t, agbno)
  1373. __field(xfs_extlen_t, len)
  1374. ),
  1375. TP_fast_assign(
  1376. __entry->dev = mp->m_super->s_dev;
  1377. __entry->agno = agno;
  1378. __entry->agbno = agbno;
  1379. __entry->len = len;
  1380. ),
  1381. TP_printk("dev %d:%d agno %u agbno %u len %u",
  1382. MAJOR(__entry->dev), MINOR(__entry->dev),
  1383. __entry->agno,
  1384. __entry->agbno,
  1385. __entry->len)
  1386. );
  1387. #define DEFINE_BUSY_EVENT(name) \
  1388. DEFINE_EVENT(xfs_extent_busy_class, name, \
  1389. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  1390. xfs_agblock_t agbno, xfs_extlen_t len), \
  1391. TP_ARGS(mp, agno, agbno, len))
  1392. DEFINE_BUSY_EVENT(xfs_extent_busy);
  1393. DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
  1394. DEFINE_BUSY_EVENT(xfs_extent_busy_force);
  1395. DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
  1396. DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
  1397. TRACE_EVENT(xfs_extent_busy_trim,
  1398. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  1399. xfs_agblock_t agbno, xfs_extlen_t len,
  1400. xfs_agblock_t tbno, xfs_extlen_t tlen),
  1401. TP_ARGS(mp, agno, agbno, len, tbno, tlen),
  1402. TP_STRUCT__entry(
  1403. __field(dev_t, dev)
  1404. __field(xfs_agnumber_t, agno)
  1405. __field(xfs_agblock_t, agbno)
  1406. __field(xfs_extlen_t, len)
  1407. __field(xfs_agblock_t, tbno)
  1408. __field(xfs_extlen_t, tlen)
  1409. ),
  1410. TP_fast_assign(
  1411. __entry->dev = mp->m_super->s_dev;
  1412. __entry->agno = agno;
  1413. __entry->agbno = agbno;
  1414. __entry->len = len;
  1415. __entry->tbno = tbno;
  1416. __entry->tlen = tlen;
  1417. ),
  1418. TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
  1419. MAJOR(__entry->dev), MINOR(__entry->dev),
  1420. __entry->agno,
  1421. __entry->agbno,
  1422. __entry->len,
  1423. __entry->tbno,
  1424. __entry->tlen)
  1425. );
  1426. TRACE_EVENT(xfs_trans_commit_lsn,
  1427. TP_PROTO(struct xfs_trans *trans),
  1428. TP_ARGS(trans),
  1429. TP_STRUCT__entry(
  1430. __field(dev_t, dev)
  1431. __field(struct xfs_trans *, tp)
  1432. __field(xfs_lsn_t, lsn)
  1433. ),
  1434. TP_fast_assign(
  1435. __entry->dev = trans->t_mountp->m_super->s_dev;
  1436. __entry->tp = trans;
  1437. __entry->lsn = trans->t_commit_lsn;
  1438. ),
  1439. TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
  1440. MAJOR(__entry->dev), MINOR(__entry->dev),
  1441. __entry->tp,
  1442. __entry->lsn)
  1443. );
  1444. TRACE_EVENT(xfs_agf,
  1445. TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
  1446. unsigned long caller_ip),
  1447. TP_ARGS(mp, agf, flags, caller_ip),
  1448. TP_STRUCT__entry(
  1449. __field(dev_t, dev)
  1450. __field(xfs_agnumber_t, agno)
  1451. __field(int, flags)
  1452. __field(__u32, length)
  1453. __field(__u32, bno_root)
  1454. __field(__u32, cnt_root)
  1455. __field(__u32, bno_level)
  1456. __field(__u32, cnt_level)
  1457. __field(__u32, flfirst)
  1458. __field(__u32, fllast)
  1459. __field(__u32, flcount)
  1460. __field(__u32, freeblks)
  1461. __field(__u32, longest)
  1462. __field(unsigned long, caller_ip)
  1463. ),
  1464. TP_fast_assign(
  1465. __entry->dev = mp->m_super->s_dev;
  1466. __entry->agno = be32_to_cpu(agf->agf_seqno),
  1467. __entry->flags = flags;
  1468. __entry->length = be32_to_cpu(agf->agf_length),
  1469. __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
  1470. __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
  1471. __entry->bno_level =
  1472. be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
  1473. __entry->cnt_level =
  1474. be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
  1475. __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
  1476. __entry->fllast = be32_to_cpu(agf->agf_fllast),
  1477. __entry->flcount = be32_to_cpu(agf->agf_flcount),
  1478. __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
  1479. __entry->longest = be32_to_cpu(agf->agf_longest);
  1480. __entry->caller_ip = caller_ip;
  1481. ),
  1482. TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
  1483. "levels b %u c %u flfirst %u fllast %u flcount %u "
  1484. "freeblks %u longest %u caller %ps",
  1485. MAJOR(__entry->dev), MINOR(__entry->dev),
  1486. __entry->agno,
  1487. __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
  1488. __entry->length,
  1489. __entry->bno_root,
  1490. __entry->cnt_root,
  1491. __entry->bno_level,
  1492. __entry->cnt_level,
  1493. __entry->flfirst,
  1494. __entry->fllast,
  1495. __entry->flcount,
  1496. __entry->freeblks,
  1497. __entry->longest,
  1498. (void *)__entry->caller_ip)
  1499. );
  1500. TRACE_EVENT(xfs_free_extent,
  1501. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
  1502. xfs_extlen_t len, bool isfl, int haveleft, int haveright),
  1503. TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
  1504. TP_STRUCT__entry(
  1505. __field(dev_t, dev)
  1506. __field(xfs_agnumber_t, agno)
  1507. __field(xfs_agblock_t, agbno)
  1508. __field(xfs_extlen_t, len)
  1509. __field(int, isfl)
  1510. __field(int, haveleft)
  1511. __field(int, haveright)
  1512. ),
  1513. TP_fast_assign(
  1514. __entry->dev = mp->m_super->s_dev;
  1515. __entry->agno = agno;
  1516. __entry->agbno = agbno;
  1517. __entry->len = len;
  1518. __entry->isfl = isfl;
  1519. __entry->haveleft = haveleft;
  1520. __entry->haveright = haveright;
  1521. ),
  1522. TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
  1523. MAJOR(__entry->dev), MINOR(__entry->dev),
  1524. __entry->agno,
  1525. __entry->agbno,
  1526. __entry->len,
  1527. __entry->isfl,
  1528. __entry->haveleft ?
  1529. (__entry->haveright ? "both" : "left") :
  1530. (__entry->haveright ? "right" : "none"))
  1531. );
  1532. DECLARE_EVENT_CLASS(xfs_alloc_class,
  1533. TP_PROTO(struct xfs_alloc_arg *args),
  1534. TP_ARGS(args),
  1535. TP_STRUCT__entry(
  1536. __field(dev_t, dev)
  1537. __field(xfs_agnumber_t, agno)
  1538. __field(xfs_agblock_t, agbno)
  1539. __field(xfs_extlen_t, minlen)
  1540. __field(xfs_extlen_t, maxlen)
  1541. __field(xfs_extlen_t, mod)
  1542. __field(xfs_extlen_t, prod)
  1543. __field(xfs_extlen_t, minleft)
  1544. __field(xfs_extlen_t, total)
  1545. __field(xfs_extlen_t, alignment)
  1546. __field(xfs_extlen_t, minalignslop)
  1547. __field(xfs_extlen_t, len)
  1548. __field(short, type)
  1549. __field(short, otype)
  1550. __field(char, wasdel)
  1551. __field(char, wasfromfl)
  1552. __field(char, isfl)
  1553. __field(char, userdata)
  1554. __field(xfs_fsblock_t, firstblock)
  1555. ),
  1556. TP_fast_assign(
  1557. __entry->dev = args->mp->m_super->s_dev;
  1558. __entry->agno = args->agno;
  1559. __entry->agbno = args->agbno;
  1560. __entry->minlen = args->minlen;
  1561. __entry->maxlen = args->maxlen;
  1562. __entry->mod = args->mod;
  1563. __entry->prod = args->prod;
  1564. __entry->minleft = args->minleft;
  1565. __entry->total = args->total;
  1566. __entry->alignment = args->alignment;
  1567. __entry->minalignslop = args->minalignslop;
  1568. __entry->len = args->len;
  1569. __entry->type = args->type;
  1570. __entry->otype = args->otype;
  1571. __entry->wasdel = args->wasdel;
  1572. __entry->wasfromfl = args->wasfromfl;
  1573. __entry->isfl = args->isfl;
  1574. __entry->userdata = args->userdata;
  1575. __entry->firstblock = args->firstblock;
  1576. ),
  1577. TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
  1578. "prod %u minleft %u total %u alignment %u minalignslop %u "
  1579. "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
  1580. "userdata %d firstblock 0x%llx",
  1581. MAJOR(__entry->dev), MINOR(__entry->dev),
  1582. __entry->agno,
  1583. __entry->agbno,
  1584. __entry->minlen,
  1585. __entry->maxlen,
  1586. __entry->mod,
  1587. __entry->prod,
  1588. __entry->minleft,
  1589. __entry->total,
  1590. __entry->alignment,
  1591. __entry->minalignslop,
  1592. __entry->len,
  1593. __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
  1594. __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
  1595. __entry->wasdel,
  1596. __entry->wasfromfl,
  1597. __entry->isfl,
  1598. __entry->userdata,
  1599. (unsigned long long)__entry->firstblock)
  1600. )
  1601. #define DEFINE_ALLOC_EVENT(name) \
  1602. DEFINE_EVENT(xfs_alloc_class, name, \
  1603. TP_PROTO(struct xfs_alloc_arg *args), \
  1604. TP_ARGS(args))
  1605. DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
  1606. DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
  1607. DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
  1608. DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
  1609. DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
  1610. DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
  1611. DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
  1612. DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
  1613. DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
  1614. DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
  1615. DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
  1616. DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
  1617. DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
  1618. DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
  1619. DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
  1620. DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
  1621. DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
  1622. DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
  1623. DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
  1624. DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
  1625. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
  1626. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
  1627. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
  1628. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
  1629. DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
  1630. DECLARE_EVENT_CLASS(xfs_da_class,
  1631. TP_PROTO(struct xfs_da_args *args),
  1632. TP_ARGS(args),
  1633. TP_STRUCT__entry(
  1634. __field(dev_t, dev)
  1635. __field(xfs_ino_t, ino)
  1636. __dynamic_array(char, name, args->namelen)
  1637. __field(int, namelen)
  1638. __field(xfs_dahash_t, hashval)
  1639. __field(xfs_ino_t, inumber)
  1640. __field(int, op_flags)
  1641. ),
  1642. TP_fast_assign(
  1643. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1644. __entry->ino = args->dp->i_ino;
  1645. if (args->namelen)
  1646. memcpy(__get_str(name), args->name, args->namelen);
  1647. __entry->namelen = args->namelen;
  1648. __entry->hashval = args->hashval;
  1649. __entry->inumber = args->inumber;
  1650. __entry->op_flags = args->op_flags;
  1651. ),
  1652. TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
  1653. "inumber 0x%llx op_flags %s",
  1654. MAJOR(__entry->dev), MINOR(__entry->dev),
  1655. __entry->ino,
  1656. __entry->namelen,
  1657. __entry->namelen ? __get_str(name) : NULL,
  1658. __entry->namelen,
  1659. __entry->hashval,
  1660. __entry->inumber,
  1661. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
  1662. )
  1663. #define DEFINE_DIR2_EVENT(name) \
  1664. DEFINE_EVENT(xfs_da_class, name, \
  1665. TP_PROTO(struct xfs_da_args *args), \
  1666. TP_ARGS(args))
  1667. DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
  1668. DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
  1669. DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
  1670. DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
  1671. DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
  1672. DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
  1673. DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
  1674. DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
  1675. DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
  1676. DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
  1677. DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
  1678. DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
  1679. DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
  1680. DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
  1681. DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
  1682. DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
  1683. DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
  1684. DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
  1685. DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
  1686. DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
  1687. DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
  1688. DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
  1689. DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
  1690. DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
  1691. DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
  1692. DECLARE_EVENT_CLASS(xfs_attr_class,
  1693. TP_PROTO(struct xfs_da_args *args),
  1694. TP_ARGS(args),
  1695. TP_STRUCT__entry(
  1696. __field(dev_t, dev)
  1697. __field(xfs_ino_t, ino)
  1698. __dynamic_array(char, name, args->namelen)
  1699. __field(int, namelen)
  1700. __field(int, valuelen)
  1701. __field(xfs_dahash_t, hashval)
  1702. __field(int, op_flags)
  1703. ),
  1704. TP_fast_assign(
  1705. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1706. __entry->ino = args->dp->i_ino;
  1707. if (args->namelen)
  1708. memcpy(__get_str(name), args->name, args->namelen);
  1709. __entry->namelen = args->namelen;
  1710. __entry->valuelen = args->valuelen;
  1711. __entry->hashval = args->hashval;
  1712. __entry->op_flags = args->op_flags;
  1713. ),
  1714. TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
  1715. "hashval 0x%x op_flags %s",
  1716. MAJOR(__entry->dev), MINOR(__entry->dev),
  1717. __entry->ino,
  1718. __entry->namelen,
  1719. __entry->namelen ? __get_str(name) : NULL,
  1720. __entry->namelen,
  1721. __entry->valuelen,
  1722. __entry->hashval,
  1723. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
  1724. )
  1725. #define DEFINE_ATTR_EVENT(name) \
  1726. DEFINE_EVENT(xfs_attr_class, name, \
  1727. TP_PROTO(struct xfs_da_args *args), \
  1728. TP_ARGS(args))
  1729. DEFINE_ATTR_EVENT(xfs_attr_sf_add);
  1730. DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
  1731. DEFINE_ATTR_EVENT(xfs_attr_sf_create);
  1732. DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
  1733. DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
  1734. DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
  1735. DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
  1736. DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
  1737. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
  1738. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
  1739. DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
  1740. DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
  1741. DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
  1742. DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
  1743. DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
  1744. DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
  1745. DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
  1746. DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
  1747. DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
  1748. DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
  1749. DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
  1750. DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
  1751. DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
  1752. DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
  1753. DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
  1754. DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
  1755. DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
  1756. DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
  1757. DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
  1758. DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
  1759. DEFINE_ATTR_EVENT(xfs_attr_node_addname);
  1760. DEFINE_ATTR_EVENT(xfs_attr_node_get);
  1761. DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
  1762. DEFINE_ATTR_EVENT(xfs_attr_node_replace);
  1763. DEFINE_ATTR_EVENT(xfs_attr_node_removename);
  1764. DEFINE_ATTR_EVENT(xfs_attr_fillstate);
  1765. DEFINE_ATTR_EVENT(xfs_attr_refillstate);
  1766. DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
  1767. DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
  1768. DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
  1769. #define DEFINE_DA_EVENT(name) \
  1770. DEFINE_EVENT(xfs_da_class, name, \
  1771. TP_PROTO(struct xfs_da_args *args), \
  1772. TP_ARGS(args))
  1773. DEFINE_DA_EVENT(xfs_da_split);
  1774. DEFINE_DA_EVENT(xfs_da_join);
  1775. DEFINE_DA_EVENT(xfs_da_link_before);
  1776. DEFINE_DA_EVENT(xfs_da_link_after);
  1777. DEFINE_DA_EVENT(xfs_da_unlink_back);
  1778. DEFINE_DA_EVENT(xfs_da_unlink_forward);
  1779. DEFINE_DA_EVENT(xfs_da_root_split);
  1780. DEFINE_DA_EVENT(xfs_da_root_join);
  1781. DEFINE_DA_EVENT(xfs_da_node_add);
  1782. DEFINE_DA_EVENT(xfs_da_node_create);
  1783. DEFINE_DA_EVENT(xfs_da_node_split);
  1784. DEFINE_DA_EVENT(xfs_da_node_remove);
  1785. DEFINE_DA_EVENT(xfs_da_node_rebalance);
  1786. DEFINE_DA_EVENT(xfs_da_node_unbalance);
  1787. DEFINE_DA_EVENT(xfs_da_node_toosmall);
  1788. DEFINE_DA_EVENT(xfs_da_swap_lastblock);
  1789. DEFINE_DA_EVENT(xfs_da_grow_inode);
  1790. DEFINE_DA_EVENT(xfs_da_shrink_inode);
  1791. DEFINE_DA_EVENT(xfs_da_fixhashpath);
  1792. DEFINE_DA_EVENT(xfs_da_path_shift);
  1793. DECLARE_EVENT_CLASS(xfs_dir2_space_class,
  1794. TP_PROTO(struct xfs_da_args *args, int idx),
  1795. TP_ARGS(args, idx),
  1796. TP_STRUCT__entry(
  1797. __field(dev_t, dev)
  1798. __field(xfs_ino_t, ino)
  1799. __field(int, op_flags)
  1800. __field(int, idx)
  1801. ),
  1802. TP_fast_assign(
  1803. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1804. __entry->ino = args->dp->i_ino;
  1805. __entry->op_flags = args->op_flags;
  1806. __entry->idx = idx;
  1807. ),
  1808. TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
  1809. MAJOR(__entry->dev), MINOR(__entry->dev),
  1810. __entry->ino,
  1811. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
  1812. __entry->idx)
  1813. )
  1814. #define DEFINE_DIR2_SPACE_EVENT(name) \
  1815. DEFINE_EVENT(xfs_dir2_space_class, name, \
  1816. TP_PROTO(struct xfs_da_args *args, int idx), \
  1817. TP_ARGS(args, idx))
  1818. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
  1819. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
  1820. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
  1821. DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
  1822. TRACE_EVENT(xfs_dir2_leafn_moveents,
  1823. TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
  1824. TP_ARGS(args, src_idx, dst_idx, count),
  1825. TP_STRUCT__entry(
  1826. __field(dev_t, dev)
  1827. __field(xfs_ino_t, ino)
  1828. __field(int, op_flags)
  1829. __field(int, src_idx)
  1830. __field(int, dst_idx)
  1831. __field(int, count)
  1832. ),
  1833. TP_fast_assign(
  1834. __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
  1835. __entry->ino = args->dp->i_ino;
  1836. __entry->op_flags = args->op_flags;
  1837. __entry->src_idx = src_idx;
  1838. __entry->dst_idx = dst_idx;
  1839. __entry->count = count;
  1840. ),
  1841. TP_printk("dev %d:%d ino 0x%llx op_flags %s "
  1842. "src_idx %d dst_idx %d count %d",
  1843. MAJOR(__entry->dev), MINOR(__entry->dev),
  1844. __entry->ino,
  1845. __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
  1846. __entry->src_idx,
  1847. __entry->dst_idx,
  1848. __entry->count)
  1849. );
  1850. #define XFS_SWAPEXT_INODES \
  1851. { 0, "target" }, \
  1852. { 1, "temp" }
  1853. #define XFS_INODE_FORMAT_STR \
  1854. { 0, "invalid" }, \
  1855. { 1, "local" }, \
  1856. { 2, "extent" }, \
  1857. { 3, "btree" }
  1858. DECLARE_EVENT_CLASS(xfs_swap_extent_class,
  1859. TP_PROTO(struct xfs_inode *ip, int which),
  1860. TP_ARGS(ip, which),
  1861. TP_STRUCT__entry(
  1862. __field(dev_t, dev)
  1863. __field(int, which)
  1864. __field(xfs_ino_t, ino)
  1865. __field(int, format)
  1866. __field(int, nex)
  1867. __field(int, broot_size)
  1868. __field(int, fork_off)
  1869. ),
  1870. TP_fast_assign(
  1871. __entry->dev = VFS_I(ip)->i_sb->s_dev;
  1872. __entry->which = which;
  1873. __entry->ino = ip->i_ino;
  1874. __entry->format = ip->i_d.di_format;
  1875. __entry->nex = ip->i_d.di_nextents;
  1876. __entry->broot_size = ip->i_df.if_broot_bytes;
  1877. __entry->fork_off = XFS_IFORK_BOFF(ip);
  1878. ),
  1879. TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
  1880. "broot size %d, fork offset %d",
  1881. MAJOR(__entry->dev), MINOR(__entry->dev),
  1882. __entry->ino,
  1883. __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
  1884. __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
  1885. __entry->nex,
  1886. __entry->broot_size,
  1887. __entry->fork_off)
  1888. )
  1889. #define DEFINE_SWAPEXT_EVENT(name) \
  1890. DEFINE_EVENT(xfs_swap_extent_class, name, \
  1891. TP_PROTO(struct xfs_inode *ip, int which), \
  1892. TP_ARGS(ip, which))
  1893. DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
  1894. DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
  1895. DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
  1896. TP_PROTO(struct xlog *log, struct xlog_recover *trans,
  1897. struct xlog_recover_item *item, int pass),
  1898. TP_ARGS(log, trans, item, pass),
  1899. TP_STRUCT__entry(
  1900. __field(dev_t, dev)
  1901. __field(unsigned long, item)
  1902. __field(xlog_tid_t, tid)
  1903. __field(int, type)
  1904. __field(int, pass)
  1905. __field(int, count)
  1906. __field(int, total)
  1907. ),
  1908. TP_fast_assign(
  1909. __entry->dev = log->l_mp->m_super->s_dev;
  1910. __entry->item = (unsigned long)item;
  1911. __entry->tid = trans->r_log_tid;
  1912. __entry->type = ITEM_TYPE(item);
  1913. __entry->pass = pass;
  1914. __entry->count = item->ri_cnt;
  1915. __entry->total = item->ri_total;
  1916. ),
  1917. TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
  1918. "item region count/total %d/%d",
  1919. MAJOR(__entry->dev), MINOR(__entry->dev),
  1920. __entry->tid,
  1921. __entry->pass,
  1922. (void *)__entry->item,
  1923. __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
  1924. __entry->count,
  1925. __entry->total)
  1926. )
  1927. #define DEFINE_LOG_RECOVER_ITEM(name) \
  1928. DEFINE_EVENT(xfs_log_recover_item_class, name, \
  1929. TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
  1930. struct xlog_recover_item *item, int pass), \
  1931. TP_ARGS(log, trans, item, pass))
  1932. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
  1933. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
  1934. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
  1935. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
  1936. DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
  1937. DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
  1938. TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
  1939. TP_ARGS(log, buf_f),
  1940. TP_STRUCT__entry(
  1941. __field(dev_t, dev)
  1942. __field(__int64_t, blkno)
  1943. __field(unsigned short, len)
  1944. __field(unsigned short, flags)
  1945. __field(unsigned short, size)
  1946. __field(unsigned int, map_size)
  1947. ),
  1948. TP_fast_assign(
  1949. __entry->dev = log->l_mp->m_super->s_dev;
  1950. __entry->blkno = buf_f->blf_blkno;
  1951. __entry->len = buf_f->blf_len;
  1952. __entry->flags = buf_f->blf_flags;
  1953. __entry->size = buf_f->blf_size;
  1954. __entry->map_size = buf_f->blf_map_size;
  1955. ),
  1956. TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
  1957. "map_size %d",
  1958. MAJOR(__entry->dev), MINOR(__entry->dev),
  1959. __entry->blkno,
  1960. __entry->len,
  1961. __entry->flags,
  1962. __entry->size,
  1963. __entry->map_size)
  1964. )
  1965. #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
  1966. DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
  1967. TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
  1968. TP_ARGS(log, buf_f))
  1969. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
  1970. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
  1971. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
  1972. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
  1973. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
  1974. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
  1975. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
  1976. DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
  1977. DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
  1978. TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
  1979. TP_ARGS(log, in_f),
  1980. TP_STRUCT__entry(
  1981. __field(dev_t, dev)
  1982. __field(xfs_ino_t, ino)
  1983. __field(unsigned short, size)
  1984. __field(int, fields)
  1985. __field(unsigned short, asize)
  1986. __field(unsigned short, dsize)
  1987. __field(__int64_t, blkno)
  1988. __field(int, len)
  1989. __field(int, boffset)
  1990. ),
  1991. TP_fast_assign(
  1992. __entry->dev = log->l_mp->m_super->s_dev;
  1993. __entry->ino = in_f->ilf_ino;
  1994. __entry->size = in_f->ilf_size;
  1995. __entry->fields = in_f->ilf_fields;
  1996. __entry->asize = in_f->ilf_asize;
  1997. __entry->dsize = in_f->ilf_dsize;
  1998. __entry->blkno = in_f->ilf_blkno;
  1999. __entry->len = in_f->ilf_len;
  2000. __entry->boffset = in_f->ilf_boffset;
  2001. ),
  2002. TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
  2003. "dsize %d, blkno 0x%llx, len %d, boffset %d",
  2004. MAJOR(__entry->dev), MINOR(__entry->dev),
  2005. __entry->ino,
  2006. __entry->size,
  2007. __entry->fields,
  2008. __entry->asize,
  2009. __entry->dsize,
  2010. __entry->blkno,
  2011. __entry->len,
  2012. __entry->boffset)
  2013. )
  2014. #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
  2015. DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
  2016. TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
  2017. TP_ARGS(log, in_f))
  2018. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
  2019. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
  2020. DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
  2021. DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
  2022. TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
  2023. TP_ARGS(log, in_f),
  2024. TP_STRUCT__entry(
  2025. __field(dev_t, dev)
  2026. __field(xfs_agnumber_t, agno)
  2027. __field(xfs_agblock_t, agbno)
  2028. __field(unsigned int, count)
  2029. __field(unsigned int, isize)
  2030. __field(xfs_agblock_t, length)
  2031. __field(unsigned int, gen)
  2032. ),
  2033. TP_fast_assign(
  2034. __entry->dev = log->l_mp->m_super->s_dev;
  2035. __entry->agno = be32_to_cpu(in_f->icl_ag);
  2036. __entry->agbno = be32_to_cpu(in_f->icl_agbno);
  2037. __entry->count = be32_to_cpu(in_f->icl_count);
  2038. __entry->isize = be32_to_cpu(in_f->icl_isize);
  2039. __entry->length = be32_to_cpu(in_f->icl_length);
  2040. __entry->gen = be32_to_cpu(in_f->icl_gen);
  2041. ),
  2042. TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
  2043. "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
  2044. __entry->agno, __entry->agbno, __entry->count, __entry->isize,
  2045. __entry->length, __entry->gen)
  2046. )
  2047. #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
  2048. DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
  2049. TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
  2050. TP_ARGS(log, in_f))
  2051. DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
  2052. DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
  2053. DECLARE_EVENT_CLASS(xfs_discard_class,
  2054. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
  2055. xfs_agblock_t agbno, xfs_extlen_t len),
  2056. TP_ARGS(mp, agno, agbno, len),
  2057. TP_STRUCT__entry(
  2058. __field(dev_t, dev)
  2059. __field(xfs_agnumber_t, agno)
  2060. __field(xfs_agblock_t, agbno)
  2061. __field(xfs_extlen_t, len)
  2062. ),
  2063. TP_fast_assign(
  2064. __entry->dev = mp->m_super->s_dev;
  2065. __entry->agno = agno;
  2066. __entry->agbno = agbno;
  2067. __entry->len = len;
  2068. ),
  2069. TP_printk("dev %d:%d agno %u agbno %u len %u\n",
  2070. MAJOR(__entry->dev), MINOR(__entry->dev),
  2071. __entry->agno,
  2072. __entry->agbno,
  2073. __entry->len)
  2074. )
  2075. #define DEFINE_DISCARD_EVENT(name) \
  2076. DEFINE_EVENT(xfs_discard_class, name, \
  2077. TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
  2078. xfs_agblock_t agbno, xfs_extlen_t len), \
  2079. TP_ARGS(mp, agno, agbno, len))
  2080. DEFINE_DISCARD_EVENT(xfs_discard_extent);
  2081. DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
  2082. DEFINE_DISCARD_EVENT(xfs_discard_exclude);
  2083. DEFINE_DISCARD_EVENT(xfs_discard_busy);
  2084. #endif /* _TRACE_XFS_H */
  2085. #undef TRACE_INCLUDE_PATH
  2086. #define TRACE_INCLUDE_PATH .
  2087. #define TRACE_INCLUDE_FILE xfs_trace
  2088. #include <trace/define_trace.h>