afs.h 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* AFS tracepoints
  3. *
  4. * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
  5. * Written by David Howells ([email protected])
  6. */
  7. #undef TRACE_SYSTEM
  8. #define TRACE_SYSTEM afs
  9. #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ)
  10. #define _TRACE_AFS_H
  11. #include <linux/tracepoint.h>
  12. /*
  13. * Define enums for tracing information.
  14. */
  15. #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
  16. #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
  17. enum afs_call_trace {
  18. afs_call_trace_alloc,
  19. afs_call_trace_free,
  20. afs_call_trace_get,
  21. afs_call_trace_put,
  22. afs_call_trace_wake,
  23. afs_call_trace_work,
  24. };
  25. enum afs_server_trace {
  26. afs_server_trace_alloc,
  27. afs_server_trace_callback,
  28. afs_server_trace_destroy,
  29. afs_server_trace_free,
  30. afs_server_trace_gc,
  31. afs_server_trace_get_by_addr,
  32. afs_server_trace_get_by_uuid,
  33. afs_server_trace_get_caps,
  34. afs_server_trace_get_install,
  35. afs_server_trace_get_new_cbi,
  36. afs_server_trace_get_probe,
  37. afs_server_trace_give_up_cb,
  38. afs_server_trace_purging,
  39. afs_server_trace_put_call,
  40. afs_server_trace_put_cbi,
  41. afs_server_trace_put_find_rsq,
  42. afs_server_trace_put_probe,
  43. afs_server_trace_put_slist,
  44. afs_server_trace_put_slist_isort,
  45. afs_server_trace_put_uuid_rsq,
  46. afs_server_trace_update,
  47. };
  48. enum afs_volume_trace {
  49. afs_volume_trace_alloc,
  50. afs_volume_trace_free,
  51. afs_volume_trace_get_alloc_sbi,
  52. afs_volume_trace_get_cell_insert,
  53. afs_volume_trace_get_new_op,
  54. afs_volume_trace_get_query_alias,
  55. afs_volume_trace_put_cell_dup,
  56. afs_volume_trace_put_cell_root,
  57. afs_volume_trace_put_destroy_sbi,
  58. afs_volume_trace_put_free_fc,
  59. afs_volume_trace_put_put_op,
  60. afs_volume_trace_put_query_alias,
  61. afs_volume_trace_put_validate_fc,
  62. afs_volume_trace_remove,
  63. };
  64. enum afs_cell_trace {
  65. afs_cell_trace_alloc,
  66. afs_cell_trace_free,
  67. afs_cell_trace_get_queue_dns,
  68. afs_cell_trace_get_queue_manage,
  69. afs_cell_trace_get_queue_new,
  70. afs_cell_trace_get_vol,
  71. afs_cell_trace_insert,
  72. afs_cell_trace_manage,
  73. afs_cell_trace_put_candidate,
  74. afs_cell_trace_put_destroy,
  75. afs_cell_trace_put_queue_fail,
  76. afs_cell_trace_put_queue_work,
  77. afs_cell_trace_put_vol,
  78. afs_cell_trace_see_source,
  79. afs_cell_trace_see_ws,
  80. afs_cell_trace_unuse_alias,
  81. afs_cell_trace_unuse_check_alias,
  82. afs_cell_trace_unuse_delete,
  83. afs_cell_trace_unuse_fc,
  84. afs_cell_trace_unuse_lookup,
  85. afs_cell_trace_unuse_mntpt,
  86. afs_cell_trace_unuse_no_pin,
  87. afs_cell_trace_unuse_parse,
  88. afs_cell_trace_unuse_pin,
  89. afs_cell_trace_unuse_probe,
  90. afs_cell_trace_unuse_sbi,
  91. afs_cell_trace_unuse_ws,
  92. afs_cell_trace_use_alias,
  93. afs_cell_trace_use_check_alias,
  94. afs_cell_trace_use_fc,
  95. afs_cell_trace_use_fc_alias,
  96. afs_cell_trace_use_lookup,
  97. afs_cell_trace_use_mntpt,
  98. afs_cell_trace_use_pin,
  99. afs_cell_trace_use_probe,
  100. afs_cell_trace_use_sbi,
  101. afs_cell_trace_wait,
  102. };
  103. enum afs_fs_operation {
  104. afs_FS_FetchData = 130, /* AFS Fetch file data */
  105. afs_FS_FetchACL = 131, /* AFS Fetch file ACL */
  106. afs_FS_FetchStatus = 132, /* AFS Fetch file status */
  107. afs_FS_StoreData = 133, /* AFS Store file data */
  108. afs_FS_StoreACL = 134, /* AFS Store file ACL */
  109. afs_FS_StoreStatus = 135, /* AFS Store file status */
  110. afs_FS_RemoveFile = 136, /* AFS Remove a file */
  111. afs_FS_CreateFile = 137, /* AFS Create a file */
  112. afs_FS_Rename = 138, /* AFS Rename or move a file or directory */
  113. afs_FS_Symlink = 139, /* AFS Create a symbolic link */
  114. afs_FS_Link = 140, /* AFS Create a hard link */
  115. afs_FS_MakeDir = 141, /* AFS Create a directory */
  116. afs_FS_RemoveDir = 142, /* AFS Remove a directory */
  117. afs_FS_GetVolumeInfo = 148, /* AFS Get information about a volume */
  118. afs_FS_GetVolumeStatus = 149, /* AFS Get volume status information */
  119. afs_FS_GetRootVolume = 151, /* AFS Get root volume name */
  120. afs_FS_SetLock = 156, /* AFS Request a file lock */
  121. afs_FS_ExtendLock = 157, /* AFS Extend a file lock */
  122. afs_FS_ReleaseLock = 158, /* AFS Release a file lock */
  123. afs_FS_Lookup = 161, /* AFS lookup file in directory */
  124. afs_FS_InlineBulkStatus = 65536, /* AFS Fetch multiple file statuses with errors */
  125. afs_FS_FetchData64 = 65537, /* AFS Fetch file data */
  126. afs_FS_StoreData64 = 65538, /* AFS Store file data */
  127. afs_FS_GiveUpAllCallBacks = 65539, /* AFS Give up all our callbacks on a server */
  128. afs_FS_GetCapabilities = 65540, /* AFS Get FS server capabilities */
  129. yfs_FS_FetchData = 130, /* YFS Fetch file data */
  130. yfs_FS_FetchACL = 64131, /* YFS Fetch file ACL */
  131. yfs_FS_FetchStatus = 64132, /* YFS Fetch file status */
  132. yfs_FS_StoreACL = 64134, /* YFS Store file ACL */
  133. yfs_FS_StoreStatus = 64135, /* YFS Store file status */
  134. yfs_FS_RemoveFile = 64136, /* YFS Remove a file */
  135. yfs_FS_CreateFile = 64137, /* YFS Create a file */
  136. yfs_FS_Rename = 64138, /* YFS Rename or move a file or directory */
  137. yfs_FS_Symlink = 64139, /* YFS Create a symbolic link */
  138. yfs_FS_Link = 64140, /* YFS Create a hard link */
  139. yfs_FS_MakeDir = 64141, /* YFS Create a directory */
  140. yfs_FS_RemoveDir = 64142, /* YFS Remove a directory */
  141. yfs_FS_GetVolumeStatus = 64149, /* YFS Get volume status information */
  142. yfs_FS_SetVolumeStatus = 64150, /* YFS Set volume status information */
  143. yfs_FS_SetLock = 64156, /* YFS Request a file lock */
  144. yfs_FS_ExtendLock = 64157, /* YFS Extend a file lock */
  145. yfs_FS_ReleaseLock = 64158, /* YFS Release a file lock */
  146. yfs_FS_Lookup = 64161, /* YFS lookup file in directory */
  147. yfs_FS_FlushCPS = 64165,
  148. yfs_FS_FetchOpaqueACL = 64168,
  149. yfs_FS_WhoAmI = 64170,
  150. yfs_FS_RemoveACL = 64171,
  151. yfs_FS_RemoveFile2 = 64173,
  152. yfs_FS_StoreOpaqueACL2 = 64174,
  153. yfs_FS_InlineBulkStatus = 64536, /* YFS Fetch multiple file statuses with errors */
  154. yfs_FS_FetchData64 = 64537, /* YFS Fetch file data */
  155. yfs_FS_StoreData64 = 64538, /* YFS Store file data */
  156. yfs_FS_UpdateSymlink = 64540,
  157. };
  158. enum afs_vl_operation {
  159. afs_VL_GetEntryByNameU = 527, /* AFS Get Vol Entry By Name operation ID */
  160. afs_VL_GetAddrsU = 533, /* AFS Get FS server addresses */
  161. afs_YFSVL_GetEndpoints = 64002, /* YFS Get FS & Vol server addresses */
  162. afs_YFSVL_GetCellName = 64014, /* YFS Get actual cell name */
  163. afs_VL_GetCapabilities = 65537, /* AFS Get VL server capabilities */
  164. };
  165. enum afs_cm_operation {
  166. afs_CB_CallBack = 204, /* AFS break callback promises */
  167. afs_CB_InitCallBackState = 205, /* AFS initialise callback state */
  168. afs_CB_Probe = 206, /* AFS probe client */
  169. afs_CB_GetLock = 207, /* AFS get contents of CM lock table */
  170. afs_CB_GetCE = 208, /* AFS get cache file description */
  171. afs_CB_GetXStatsVersion = 209, /* AFS get version of extended statistics */
  172. afs_CB_GetXStats = 210, /* AFS get contents of extended statistics data */
  173. afs_CB_InitCallBackState3 = 213, /* AFS initialise callback state, version 3 */
  174. afs_CB_ProbeUuid = 214, /* AFS check the client hasn't rebooted */
  175. };
  176. enum yfs_cm_operation {
  177. yfs_CB_Probe = 206, /* YFS probe client */
  178. yfs_CB_GetLock = 207, /* YFS get contents of CM lock table */
  179. yfs_CB_XStatsVersion = 209, /* YFS get version of extended statistics */
  180. yfs_CB_GetXStats = 210, /* YFS get contents of extended statistics data */
  181. yfs_CB_InitCallBackState3 = 213, /* YFS initialise callback state, version 3 */
  182. yfs_CB_ProbeUuid = 214, /* YFS check the client hasn't rebooted */
  183. yfs_CB_GetServerPrefs = 215,
  184. yfs_CB_GetCellServDV = 216,
  185. yfs_CB_GetLocalCell = 217,
  186. yfs_CB_GetCacheConfig = 218,
  187. yfs_CB_GetCellByNum = 65537,
  188. yfs_CB_TellMeAboutYourself = 65538, /* get client capabilities */
  189. yfs_CB_CallBack = 64204,
  190. };
  191. enum afs_edit_dir_op {
  192. afs_edit_dir_create,
  193. afs_edit_dir_create_error,
  194. afs_edit_dir_create_inval,
  195. afs_edit_dir_create_nospc,
  196. afs_edit_dir_delete,
  197. afs_edit_dir_delete_error,
  198. afs_edit_dir_delete_inval,
  199. afs_edit_dir_delete_noent,
  200. };
  201. enum afs_edit_dir_reason {
  202. afs_edit_dir_for_create,
  203. afs_edit_dir_for_link,
  204. afs_edit_dir_for_mkdir,
  205. afs_edit_dir_for_rename_0,
  206. afs_edit_dir_for_rename_1,
  207. afs_edit_dir_for_rename_2,
  208. afs_edit_dir_for_rmdir,
  209. afs_edit_dir_for_silly_0,
  210. afs_edit_dir_for_silly_1,
  211. afs_edit_dir_for_symlink,
  212. afs_edit_dir_for_unlink,
  213. };
  214. enum afs_eproto_cause {
  215. afs_eproto_bad_status,
  216. afs_eproto_cb_count,
  217. afs_eproto_cb_fid_count,
  218. afs_eproto_cellname_len,
  219. afs_eproto_file_type,
  220. afs_eproto_ibulkst_cb_count,
  221. afs_eproto_ibulkst_count,
  222. afs_eproto_motd_len,
  223. afs_eproto_offline_msg_len,
  224. afs_eproto_volname_len,
  225. afs_eproto_yvl_fsendpt4_len,
  226. afs_eproto_yvl_fsendpt6_len,
  227. afs_eproto_yvl_fsendpt_num,
  228. afs_eproto_yvl_fsendpt_type,
  229. afs_eproto_yvl_vlendpt4_len,
  230. afs_eproto_yvl_vlendpt6_len,
  231. afs_eproto_yvl_vlendpt_type,
  232. };
  233. enum afs_io_error {
  234. afs_io_error_cm_reply,
  235. afs_io_error_extract,
  236. afs_io_error_fs_probe_fail,
  237. afs_io_error_vl_lookup_fail,
  238. afs_io_error_vl_probe_fail,
  239. };
  240. enum afs_file_error {
  241. afs_file_error_dir_bad_magic,
  242. afs_file_error_dir_big,
  243. afs_file_error_dir_missing_page,
  244. afs_file_error_dir_name_too_long,
  245. afs_file_error_dir_over_end,
  246. afs_file_error_dir_small,
  247. afs_file_error_dir_unmarked_ext,
  248. afs_file_error_mntpt,
  249. afs_file_error_writeback_fail,
  250. };
  251. enum afs_flock_event {
  252. afs_flock_acquired,
  253. afs_flock_callback_break,
  254. afs_flock_defer_unlock,
  255. afs_flock_extend_fail,
  256. afs_flock_fail_other,
  257. afs_flock_fail_perm,
  258. afs_flock_no_lockers,
  259. afs_flock_release_fail,
  260. afs_flock_silly_delete,
  261. afs_flock_timestamp,
  262. afs_flock_try_to_lock,
  263. afs_flock_vfs_lock,
  264. afs_flock_vfs_locking,
  265. afs_flock_waited,
  266. afs_flock_waiting,
  267. afs_flock_work_extending,
  268. afs_flock_work_retry,
  269. afs_flock_work_unlocking,
  270. afs_flock_would_block,
  271. };
  272. enum afs_flock_operation {
  273. afs_flock_op_copy_lock,
  274. afs_flock_op_flock,
  275. afs_flock_op_grant,
  276. afs_flock_op_lock,
  277. afs_flock_op_release_lock,
  278. afs_flock_op_return_ok,
  279. afs_flock_op_return_eagain,
  280. afs_flock_op_return_edeadlk,
  281. afs_flock_op_return_error,
  282. afs_flock_op_set_lock,
  283. afs_flock_op_unlock,
  284. afs_flock_op_wake,
  285. };
  286. enum afs_cb_break_reason {
  287. afs_cb_break_no_break,
  288. afs_cb_break_no_promise,
  289. afs_cb_break_for_callback,
  290. afs_cb_break_for_deleted,
  291. afs_cb_break_for_lapsed,
  292. afs_cb_break_for_s_reinit,
  293. afs_cb_break_for_unlink,
  294. afs_cb_break_for_v_break,
  295. afs_cb_break_for_volume_callback,
  296. afs_cb_break_for_zap,
  297. };
  298. #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */
  299. /*
  300. * Declare tracing information enums and their string mappings for display.
  301. */
  302. #define afs_call_traces \
  303. EM(afs_call_trace_alloc, "ALLOC") \
  304. EM(afs_call_trace_free, "FREE ") \
  305. EM(afs_call_trace_get, "GET ") \
  306. EM(afs_call_trace_put, "PUT ") \
  307. EM(afs_call_trace_wake, "WAKE ") \
  308. E_(afs_call_trace_work, "QUEUE")
  309. #define afs_server_traces \
  310. EM(afs_server_trace_alloc, "ALLOC ") \
  311. EM(afs_server_trace_callback, "CALLBACK ") \
  312. EM(afs_server_trace_destroy, "DESTROY ") \
  313. EM(afs_server_trace_free, "FREE ") \
  314. EM(afs_server_trace_gc, "GC ") \
  315. EM(afs_server_trace_get_by_addr, "GET addr ") \
  316. EM(afs_server_trace_get_by_uuid, "GET uuid ") \
  317. EM(afs_server_trace_get_caps, "GET caps ") \
  318. EM(afs_server_trace_get_install, "GET inst ") \
  319. EM(afs_server_trace_get_new_cbi, "GET cbi ") \
  320. EM(afs_server_trace_get_probe, "GET probe") \
  321. EM(afs_server_trace_give_up_cb, "giveup-cb") \
  322. EM(afs_server_trace_purging, "PURGE ") \
  323. EM(afs_server_trace_put_call, "PUT call ") \
  324. EM(afs_server_trace_put_cbi, "PUT cbi ") \
  325. EM(afs_server_trace_put_find_rsq, "PUT f-rsq") \
  326. EM(afs_server_trace_put_probe, "PUT probe") \
  327. EM(afs_server_trace_put_slist, "PUT slist") \
  328. EM(afs_server_trace_put_slist_isort, "PUT isort") \
  329. EM(afs_server_trace_put_uuid_rsq, "PUT u-req") \
  330. E_(afs_server_trace_update, "UPDATE")
  331. #define afs_volume_traces \
  332. EM(afs_volume_trace_alloc, "ALLOC ") \
  333. EM(afs_volume_trace_free, "FREE ") \
  334. EM(afs_volume_trace_get_alloc_sbi, "GET sbi-alloc ") \
  335. EM(afs_volume_trace_get_cell_insert, "GET cell-insrt") \
  336. EM(afs_volume_trace_get_new_op, "GET op-new ") \
  337. EM(afs_volume_trace_get_query_alias, "GET cell-alias") \
  338. EM(afs_volume_trace_put_cell_dup, "PUT cell-dup ") \
  339. EM(afs_volume_trace_put_cell_root, "PUT cell-root ") \
  340. EM(afs_volume_trace_put_destroy_sbi, "PUT sbi-destry") \
  341. EM(afs_volume_trace_put_free_fc, "PUT fc-free ") \
  342. EM(afs_volume_trace_put_put_op, "PUT op-put ") \
  343. EM(afs_volume_trace_put_query_alias, "PUT cell-alias") \
  344. EM(afs_volume_trace_put_validate_fc, "PUT fc-validat") \
  345. E_(afs_volume_trace_remove, "REMOVE ")
  346. #define afs_cell_traces \
  347. EM(afs_cell_trace_alloc, "ALLOC ") \
  348. EM(afs_cell_trace_free, "FREE ") \
  349. EM(afs_cell_trace_get_queue_dns, "GET q-dns ") \
  350. EM(afs_cell_trace_get_queue_manage, "GET q-mng ") \
  351. EM(afs_cell_trace_get_queue_new, "GET q-new ") \
  352. EM(afs_cell_trace_get_vol, "GET vol ") \
  353. EM(afs_cell_trace_insert, "INSERT ") \
  354. EM(afs_cell_trace_manage, "MANAGE ") \
  355. EM(afs_cell_trace_put_candidate, "PUT candid") \
  356. EM(afs_cell_trace_put_destroy, "PUT destry") \
  357. EM(afs_cell_trace_put_queue_work, "PUT q-work") \
  358. EM(afs_cell_trace_put_queue_fail, "PUT q-fail") \
  359. EM(afs_cell_trace_put_vol, "PUT vol ") \
  360. EM(afs_cell_trace_see_source, "SEE source") \
  361. EM(afs_cell_trace_see_ws, "SEE ws ") \
  362. EM(afs_cell_trace_unuse_alias, "UNU alias ") \
  363. EM(afs_cell_trace_unuse_check_alias, "UNU chk-al") \
  364. EM(afs_cell_trace_unuse_delete, "UNU delete") \
  365. EM(afs_cell_trace_unuse_fc, "UNU fc ") \
  366. EM(afs_cell_trace_unuse_lookup, "UNU lookup") \
  367. EM(afs_cell_trace_unuse_mntpt, "UNU mntpt ") \
  368. EM(afs_cell_trace_unuse_parse, "UNU parse ") \
  369. EM(afs_cell_trace_unuse_pin, "UNU pin ") \
  370. EM(afs_cell_trace_unuse_probe, "UNU probe ") \
  371. EM(afs_cell_trace_unuse_sbi, "UNU sbi ") \
  372. EM(afs_cell_trace_unuse_ws, "UNU ws ") \
  373. EM(afs_cell_trace_use_alias, "USE alias ") \
  374. EM(afs_cell_trace_use_check_alias, "USE chk-al") \
  375. EM(afs_cell_trace_use_fc, "USE fc ") \
  376. EM(afs_cell_trace_use_fc_alias, "USE fc-al ") \
  377. EM(afs_cell_trace_use_lookup, "USE lookup") \
  378. EM(afs_cell_trace_use_mntpt, "USE mntpt ") \
  379. EM(afs_cell_trace_use_pin, "USE pin ") \
  380. EM(afs_cell_trace_use_probe, "USE probe ") \
  381. EM(afs_cell_trace_use_sbi, "USE sbi ") \
  382. E_(afs_cell_trace_wait, "WAIT ")
  383. #define afs_fs_operations \
  384. EM(afs_FS_FetchData, "FS.FetchData") \
  385. EM(afs_FS_FetchStatus, "FS.FetchStatus") \
  386. EM(afs_FS_StoreData, "FS.StoreData") \
  387. EM(afs_FS_StoreStatus, "FS.StoreStatus") \
  388. EM(afs_FS_RemoveFile, "FS.RemoveFile") \
  389. EM(afs_FS_CreateFile, "FS.CreateFile") \
  390. EM(afs_FS_Rename, "FS.Rename") \
  391. EM(afs_FS_Symlink, "FS.Symlink") \
  392. EM(afs_FS_Link, "FS.Link") \
  393. EM(afs_FS_MakeDir, "FS.MakeDir") \
  394. EM(afs_FS_RemoveDir, "FS.RemoveDir") \
  395. EM(afs_FS_GetVolumeInfo, "FS.GetVolumeInfo") \
  396. EM(afs_FS_GetVolumeStatus, "FS.GetVolumeStatus") \
  397. EM(afs_FS_GetRootVolume, "FS.GetRootVolume") \
  398. EM(afs_FS_SetLock, "FS.SetLock") \
  399. EM(afs_FS_ExtendLock, "FS.ExtendLock") \
  400. EM(afs_FS_ReleaseLock, "FS.ReleaseLock") \
  401. EM(afs_FS_Lookup, "FS.Lookup") \
  402. EM(afs_FS_InlineBulkStatus, "FS.InlineBulkStatus") \
  403. EM(afs_FS_FetchData64, "FS.FetchData64") \
  404. EM(afs_FS_StoreData64, "FS.StoreData64") \
  405. EM(afs_FS_GiveUpAllCallBacks, "FS.GiveUpAllCallBacks") \
  406. EM(afs_FS_GetCapabilities, "FS.GetCapabilities") \
  407. EM(yfs_FS_FetchACL, "YFS.FetchACL") \
  408. EM(yfs_FS_FetchStatus, "YFS.FetchStatus") \
  409. EM(yfs_FS_StoreACL, "YFS.StoreACL") \
  410. EM(yfs_FS_StoreStatus, "YFS.StoreStatus") \
  411. EM(yfs_FS_RemoveFile, "YFS.RemoveFile") \
  412. EM(yfs_FS_CreateFile, "YFS.CreateFile") \
  413. EM(yfs_FS_Rename, "YFS.Rename") \
  414. EM(yfs_FS_Symlink, "YFS.Symlink") \
  415. EM(yfs_FS_Link, "YFS.Link") \
  416. EM(yfs_FS_MakeDir, "YFS.MakeDir") \
  417. EM(yfs_FS_RemoveDir, "YFS.RemoveDir") \
  418. EM(yfs_FS_GetVolumeStatus, "YFS.GetVolumeStatus") \
  419. EM(yfs_FS_SetVolumeStatus, "YFS.SetVolumeStatus") \
  420. EM(yfs_FS_SetLock, "YFS.SetLock") \
  421. EM(yfs_FS_ExtendLock, "YFS.ExtendLock") \
  422. EM(yfs_FS_ReleaseLock, "YFS.ReleaseLock") \
  423. EM(yfs_FS_Lookup, "YFS.Lookup") \
  424. EM(yfs_FS_FlushCPS, "YFS.FlushCPS") \
  425. EM(yfs_FS_FetchOpaqueACL, "YFS.FetchOpaqueACL") \
  426. EM(yfs_FS_WhoAmI, "YFS.WhoAmI") \
  427. EM(yfs_FS_RemoveACL, "YFS.RemoveACL") \
  428. EM(yfs_FS_RemoveFile2, "YFS.RemoveFile2") \
  429. EM(yfs_FS_StoreOpaqueACL2, "YFS.StoreOpaqueACL2") \
  430. EM(yfs_FS_InlineBulkStatus, "YFS.InlineBulkStatus") \
  431. EM(yfs_FS_FetchData64, "YFS.FetchData64") \
  432. EM(yfs_FS_StoreData64, "YFS.StoreData64") \
  433. E_(yfs_FS_UpdateSymlink, "YFS.UpdateSymlink")
  434. #define afs_vl_operations \
  435. EM(afs_VL_GetEntryByNameU, "VL.GetEntryByNameU") \
  436. EM(afs_VL_GetAddrsU, "VL.GetAddrsU") \
  437. EM(afs_YFSVL_GetEndpoints, "YFSVL.GetEndpoints") \
  438. EM(afs_YFSVL_GetCellName, "YFSVL.GetCellName") \
  439. E_(afs_VL_GetCapabilities, "VL.GetCapabilities")
  440. #define afs_cm_operations \
  441. EM(afs_CB_CallBack, "CB.CallBack") \
  442. EM(afs_CB_InitCallBackState, "CB.InitCallBackState") \
  443. EM(afs_CB_Probe, "CB.Probe") \
  444. EM(afs_CB_GetLock, "CB.GetLock") \
  445. EM(afs_CB_GetCE, "CB.GetCE") \
  446. EM(afs_CB_GetXStatsVersion, "CB.GetXStatsVersion") \
  447. EM(afs_CB_GetXStats, "CB.GetXStats") \
  448. EM(afs_CB_InitCallBackState3, "CB.InitCallBackState3") \
  449. E_(afs_CB_ProbeUuid, "CB.ProbeUuid")
  450. #define yfs_cm_operations \
  451. EM(yfs_CB_Probe, "YFSCB.Probe") \
  452. EM(yfs_CB_GetLock, "YFSCB.GetLock") \
  453. EM(yfs_CB_XStatsVersion, "YFSCB.XStatsVersion") \
  454. EM(yfs_CB_GetXStats, "YFSCB.GetXStats") \
  455. EM(yfs_CB_InitCallBackState3, "YFSCB.InitCallBackState3") \
  456. EM(yfs_CB_ProbeUuid, "YFSCB.ProbeUuid") \
  457. EM(yfs_CB_GetServerPrefs, "YFSCB.GetServerPrefs") \
  458. EM(yfs_CB_GetCellServDV, "YFSCB.GetCellServDV") \
  459. EM(yfs_CB_GetLocalCell, "YFSCB.GetLocalCell") \
  460. EM(yfs_CB_GetCacheConfig, "YFSCB.GetCacheConfig") \
  461. EM(yfs_CB_GetCellByNum, "YFSCB.GetCellByNum") \
  462. EM(yfs_CB_TellMeAboutYourself, "YFSCB.TellMeAboutYourself") \
  463. E_(yfs_CB_CallBack, "YFSCB.CallBack")
  464. #define afs_edit_dir_ops \
  465. EM(afs_edit_dir_create, "create") \
  466. EM(afs_edit_dir_create_error, "c_fail") \
  467. EM(afs_edit_dir_create_inval, "c_invl") \
  468. EM(afs_edit_dir_create_nospc, "c_nspc") \
  469. EM(afs_edit_dir_delete, "delete") \
  470. EM(afs_edit_dir_delete_error, "d_err ") \
  471. EM(afs_edit_dir_delete_inval, "d_invl") \
  472. E_(afs_edit_dir_delete_noent, "d_nent")
  473. #define afs_edit_dir_reasons \
  474. EM(afs_edit_dir_for_create, "Create") \
  475. EM(afs_edit_dir_for_link, "Link ") \
  476. EM(afs_edit_dir_for_mkdir, "MkDir ") \
  477. EM(afs_edit_dir_for_rename_0, "Renam0") \
  478. EM(afs_edit_dir_for_rename_1, "Renam1") \
  479. EM(afs_edit_dir_for_rename_2, "Renam2") \
  480. EM(afs_edit_dir_for_rmdir, "RmDir ") \
  481. EM(afs_edit_dir_for_silly_0, "S_Ren0") \
  482. EM(afs_edit_dir_for_silly_1, "S_Ren1") \
  483. EM(afs_edit_dir_for_symlink, "Symlnk") \
  484. E_(afs_edit_dir_for_unlink, "Unlink")
  485. #define afs_eproto_causes \
  486. EM(afs_eproto_bad_status, "BadStatus") \
  487. EM(afs_eproto_cb_count, "CbCount") \
  488. EM(afs_eproto_cb_fid_count, "CbFidCount") \
  489. EM(afs_eproto_cellname_len, "CellNameLen") \
  490. EM(afs_eproto_file_type, "FileTYpe") \
  491. EM(afs_eproto_ibulkst_cb_count, "IBS.CbCount") \
  492. EM(afs_eproto_ibulkst_count, "IBS.FidCount") \
  493. EM(afs_eproto_motd_len, "MotdLen") \
  494. EM(afs_eproto_offline_msg_len, "OfflineMsgLen") \
  495. EM(afs_eproto_volname_len, "VolNameLen") \
  496. EM(afs_eproto_yvl_fsendpt4_len, "YVL.FsEnd4Len") \
  497. EM(afs_eproto_yvl_fsendpt6_len, "YVL.FsEnd6Len") \
  498. EM(afs_eproto_yvl_fsendpt_num, "YVL.FsEndCount") \
  499. EM(afs_eproto_yvl_fsendpt_type, "YVL.FsEndType") \
  500. EM(afs_eproto_yvl_vlendpt4_len, "YVL.VlEnd4Len") \
  501. EM(afs_eproto_yvl_vlendpt6_len, "YVL.VlEnd6Len") \
  502. E_(afs_eproto_yvl_vlendpt_type, "YVL.VlEndType")
  503. #define afs_io_errors \
  504. EM(afs_io_error_cm_reply, "CM_REPLY") \
  505. EM(afs_io_error_extract, "EXTRACT") \
  506. EM(afs_io_error_fs_probe_fail, "FS_PROBE_FAIL") \
  507. EM(afs_io_error_vl_lookup_fail, "VL_LOOKUP_FAIL") \
  508. E_(afs_io_error_vl_probe_fail, "VL_PROBE_FAIL")
  509. #define afs_file_errors \
  510. EM(afs_file_error_dir_bad_magic, "DIR_BAD_MAGIC") \
  511. EM(afs_file_error_dir_big, "DIR_BIG") \
  512. EM(afs_file_error_dir_missing_page, "DIR_MISSING_PAGE") \
  513. EM(afs_file_error_dir_name_too_long, "DIR_NAME_TOO_LONG") \
  514. EM(afs_file_error_dir_over_end, "DIR_ENT_OVER_END") \
  515. EM(afs_file_error_dir_small, "DIR_SMALL") \
  516. EM(afs_file_error_dir_unmarked_ext, "DIR_UNMARKED_EXT") \
  517. EM(afs_file_error_mntpt, "MNTPT_READ_FAILED") \
  518. E_(afs_file_error_writeback_fail, "WRITEBACK_FAILED")
  519. #define afs_flock_types \
  520. EM(F_RDLCK, "RDLCK") \
  521. EM(F_WRLCK, "WRLCK") \
  522. E_(F_UNLCK, "UNLCK")
  523. #define afs_flock_states \
  524. EM(AFS_VNODE_LOCK_NONE, "NONE") \
  525. EM(AFS_VNODE_LOCK_WAITING_FOR_CB, "WAIT_FOR_CB") \
  526. EM(AFS_VNODE_LOCK_SETTING, "SETTING") \
  527. EM(AFS_VNODE_LOCK_GRANTED, "GRANTED") \
  528. EM(AFS_VNODE_LOCK_EXTENDING, "EXTENDING") \
  529. EM(AFS_VNODE_LOCK_NEED_UNLOCK, "NEED_UNLOCK") \
  530. EM(AFS_VNODE_LOCK_UNLOCKING, "UNLOCKING") \
  531. E_(AFS_VNODE_LOCK_DELETED, "DELETED")
  532. #define afs_flock_events \
  533. EM(afs_flock_acquired, "Acquired") \
  534. EM(afs_flock_callback_break, "Callback") \
  535. EM(afs_flock_defer_unlock, "D-Unlock") \
  536. EM(afs_flock_extend_fail, "Ext_Fail") \
  537. EM(afs_flock_fail_other, "ErrOther") \
  538. EM(afs_flock_fail_perm, "ErrPerm ") \
  539. EM(afs_flock_no_lockers, "NoLocker") \
  540. EM(afs_flock_release_fail, "Rel_Fail") \
  541. EM(afs_flock_silly_delete, "SillyDel") \
  542. EM(afs_flock_timestamp, "Timestmp") \
  543. EM(afs_flock_try_to_lock, "TryToLck") \
  544. EM(afs_flock_vfs_lock, "VFSLock ") \
  545. EM(afs_flock_vfs_locking, "VFSLking") \
  546. EM(afs_flock_waited, "Waited ") \
  547. EM(afs_flock_waiting, "Waiting ") \
  548. EM(afs_flock_work_extending, "Extendng") \
  549. EM(afs_flock_work_retry, "Retry ") \
  550. EM(afs_flock_work_unlocking, "Unlcking") \
  551. E_(afs_flock_would_block, "EWOULDBL")
  552. #define afs_flock_operations \
  553. EM(afs_flock_op_copy_lock, "COPY ") \
  554. EM(afs_flock_op_flock, "->flock ") \
  555. EM(afs_flock_op_grant, "GRANT ") \
  556. EM(afs_flock_op_lock, "->lock ") \
  557. EM(afs_flock_op_release_lock, "RELEASE ") \
  558. EM(afs_flock_op_return_ok, "<-OK ") \
  559. EM(afs_flock_op_return_edeadlk, "<-EDEADL") \
  560. EM(afs_flock_op_return_eagain, "<-EAGAIN") \
  561. EM(afs_flock_op_return_error, "<-ERROR ") \
  562. EM(afs_flock_op_set_lock, "SET ") \
  563. EM(afs_flock_op_unlock, "UNLOCK ") \
  564. E_(afs_flock_op_wake, "WAKE ")
  565. #define afs_cb_break_reasons \
  566. EM(afs_cb_break_no_break, "no-break") \
  567. EM(afs_cb_break_no_promise, "no-promise") \
  568. EM(afs_cb_break_for_callback, "break-cb") \
  569. EM(afs_cb_break_for_deleted, "break-del") \
  570. EM(afs_cb_break_for_lapsed, "break-lapsed") \
  571. EM(afs_cb_break_for_s_reinit, "s-reinit") \
  572. EM(afs_cb_break_for_unlink, "break-unlink") \
  573. EM(afs_cb_break_for_v_break, "break-v") \
  574. EM(afs_cb_break_for_volume_callback, "break-v-cb") \
  575. E_(afs_cb_break_for_zap, "break-zap")
  576. /*
  577. * Export enum symbols via userspace.
  578. */
  579. #undef EM
  580. #undef E_
  581. #define EM(a, b) TRACE_DEFINE_ENUM(a);
  582. #define E_(a, b) TRACE_DEFINE_ENUM(a);
  583. afs_call_traces;
  584. afs_server_traces;
  585. afs_cell_traces;
  586. afs_fs_operations;
  587. afs_vl_operations;
  588. afs_cm_operations;
  589. yfs_cm_operations;
  590. afs_edit_dir_ops;
  591. afs_edit_dir_reasons;
  592. afs_eproto_causes;
  593. afs_io_errors;
  594. afs_file_errors;
  595. afs_flock_types;
  596. afs_flock_operations;
  597. afs_cb_break_reasons;
  598. /*
  599. * Now redefine the EM() and E_() macros to map the enums to the strings that
  600. * will be printed in the output.
  601. */
  602. #undef EM
  603. #undef E_
  604. #define EM(a, b) { a, b },
  605. #define E_(a, b) { a, b }
  606. TRACE_EVENT(afs_receive_data,
  607. TP_PROTO(struct afs_call *call, struct iov_iter *iter,
  608. bool want_more, int ret),
  609. TP_ARGS(call, iter, want_more, ret),
  610. TP_STRUCT__entry(
  611. __field(loff_t, remain )
  612. __field(unsigned int, call )
  613. __field(enum afs_call_state, state )
  614. __field(unsigned short, unmarshall )
  615. __field(bool, want_more )
  616. __field(int, ret )
  617. ),
  618. TP_fast_assign(
  619. __entry->call = call->debug_id;
  620. __entry->state = call->state;
  621. __entry->unmarshall = call->unmarshall;
  622. __entry->remain = iov_iter_count(iter);
  623. __entry->want_more = want_more;
  624. __entry->ret = ret;
  625. ),
  626. TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
  627. __entry->call,
  628. __entry->remain,
  629. __entry->unmarshall,
  630. __entry->want_more,
  631. __entry->state,
  632. __entry->ret)
  633. );
  634. TRACE_EVENT(afs_notify_call,
  635. TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call),
  636. TP_ARGS(rxcall, call),
  637. TP_STRUCT__entry(
  638. __field(unsigned int, call )
  639. __field(enum afs_call_state, state )
  640. __field(unsigned short, unmarshall )
  641. ),
  642. TP_fast_assign(
  643. __entry->call = call->debug_id;
  644. __entry->state = call->state;
  645. __entry->unmarshall = call->unmarshall;
  646. ),
  647. TP_printk("c=%08x s=%u u=%u",
  648. __entry->call,
  649. __entry->state, __entry->unmarshall)
  650. );
  651. TRACE_EVENT(afs_cb_call,
  652. TP_PROTO(struct afs_call *call),
  653. TP_ARGS(call),
  654. TP_STRUCT__entry(
  655. __field(unsigned int, call )
  656. __field(u32, op )
  657. __field(u16, service_id )
  658. ),
  659. TP_fast_assign(
  660. __entry->call = call->debug_id;
  661. __entry->op = call->operation_ID;
  662. __entry->service_id = call->service_id;
  663. ),
  664. TP_printk("c=%08x %s",
  665. __entry->call,
  666. __entry->service_id == 2501 ?
  667. __print_symbolic(__entry->op, yfs_cm_operations) :
  668. __print_symbolic(__entry->op, afs_cm_operations))
  669. );
  670. TRACE_EVENT(afs_call,
  671. TP_PROTO(unsigned int call_debug_id, enum afs_call_trace op,
  672. int ref, int outstanding, const void *where),
  673. TP_ARGS(call_debug_id, op, ref, outstanding, where),
  674. TP_STRUCT__entry(
  675. __field(unsigned int, call )
  676. __field(int, op )
  677. __field(int, ref )
  678. __field(int, outstanding )
  679. __field(const void *, where )
  680. ),
  681. TP_fast_assign(
  682. __entry->call = call_debug_id;
  683. __entry->op = op;
  684. __entry->ref = ref;
  685. __entry->outstanding = outstanding;
  686. __entry->where = where;
  687. ),
  688. TP_printk("c=%08x %s r=%d o=%d sp=%pSR",
  689. __entry->call,
  690. __print_symbolic(__entry->op, afs_call_traces),
  691. __entry->ref,
  692. __entry->outstanding,
  693. __entry->where)
  694. );
  695. TRACE_EVENT(afs_make_fs_call,
  696. TP_PROTO(struct afs_call *call, const struct afs_fid *fid),
  697. TP_ARGS(call, fid),
  698. TP_STRUCT__entry(
  699. __field(unsigned int, call )
  700. __field(enum afs_fs_operation, op )
  701. __field_struct(struct afs_fid, fid )
  702. ),
  703. TP_fast_assign(
  704. __entry->call = call->debug_id;
  705. __entry->op = call->operation_ID;
  706. if (fid) {
  707. __entry->fid = *fid;
  708. } else {
  709. __entry->fid.vid = 0;
  710. __entry->fid.vnode = 0;
  711. __entry->fid.unique = 0;
  712. }
  713. ),
  714. TP_printk("c=%08x %06llx:%06llx:%06x %s",
  715. __entry->call,
  716. __entry->fid.vid,
  717. __entry->fid.vnode,
  718. __entry->fid.unique,
  719. __print_symbolic(__entry->op, afs_fs_operations))
  720. );
  721. TRACE_EVENT(afs_make_fs_calli,
  722. TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
  723. unsigned int i),
  724. TP_ARGS(call, fid, i),
  725. TP_STRUCT__entry(
  726. __field(unsigned int, call )
  727. __field(unsigned int, i )
  728. __field(enum afs_fs_operation, op )
  729. __field_struct(struct afs_fid, fid )
  730. ),
  731. TP_fast_assign(
  732. __entry->call = call->debug_id;
  733. __entry->i = i;
  734. __entry->op = call->operation_ID;
  735. if (fid) {
  736. __entry->fid = *fid;
  737. } else {
  738. __entry->fid.vid = 0;
  739. __entry->fid.vnode = 0;
  740. __entry->fid.unique = 0;
  741. }
  742. ),
  743. TP_printk("c=%08x %06llx:%06llx:%06x %s i=%u",
  744. __entry->call,
  745. __entry->fid.vid,
  746. __entry->fid.vnode,
  747. __entry->fid.unique,
  748. __print_symbolic(__entry->op, afs_fs_operations),
  749. __entry->i)
  750. );
  751. TRACE_EVENT(afs_make_fs_call1,
  752. TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
  753. const struct qstr *name),
  754. TP_ARGS(call, fid, name),
  755. TP_STRUCT__entry(
  756. __field(unsigned int, call )
  757. __field(enum afs_fs_operation, op )
  758. __field_struct(struct afs_fid, fid )
  759. __array(char, name, 24 )
  760. ),
  761. TP_fast_assign(
  762. unsigned int __len = min_t(unsigned int, name->len, 23);
  763. __entry->call = call->debug_id;
  764. __entry->op = call->operation_ID;
  765. if (fid) {
  766. __entry->fid = *fid;
  767. } else {
  768. __entry->fid.vid = 0;
  769. __entry->fid.vnode = 0;
  770. __entry->fid.unique = 0;
  771. }
  772. memcpy(__entry->name, name->name, __len);
  773. __entry->name[__len] = 0;
  774. ),
  775. TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\"",
  776. __entry->call,
  777. __entry->fid.vid,
  778. __entry->fid.vnode,
  779. __entry->fid.unique,
  780. __print_symbolic(__entry->op, afs_fs_operations),
  781. __entry->name)
  782. );
  783. TRACE_EVENT(afs_make_fs_call2,
  784. TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
  785. const struct qstr *name, const struct qstr *name2),
  786. TP_ARGS(call, fid, name, name2),
  787. TP_STRUCT__entry(
  788. __field(unsigned int, call )
  789. __field(enum afs_fs_operation, op )
  790. __field_struct(struct afs_fid, fid )
  791. __array(char, name, 24 )
  792. __array(char, name2, 24 )
  793. ),
  794. TP_fast_assign(
  795. unsigned int __len = min_t(unsigned int, name->len, 23);
  796. unsigned int __len2 = min_t(unsigned int, name2->len, 23);
  797. __entry->call = call->debug_id;
  798. __entry->op = call->operation_ID;
  799. if (fid) {
  800. __entry->fid = *fid;
  801. } else {
  802. __entry->fid.vid = 0;
  803. __entry->fid.vnode = 0;
  804. __entry->fid.unique = 0;
  805. }
  806. memcpy(__entry->name, name->name, __len);
  807. __entry->name[__len] = 0;
  808. memcpy(__entry->name2, name2->name, __len2);
  809. __entry->name2[__len2] = 0;
  810. ),
  811. TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\" \"%s\"",
  812. __entry->call,
  813. __entry->fid.vid,
  814. __entry->fid.vnode,
  815. __entry->fid.unique,
  816. __print_symbolic(__entry->op, afs_fs_operations),
  817. __entry->name,
  818. __entry->name2)
  819. );
  820. TRACE_EVENT(afs_make_vl_call,
  821. TP_PROTO(struct afs_call *call),
  822. TP_ARGS(call),
  823. TP_STRUCT__entry(
  824. __field(unsigned int, call )
  825. __field(enum afs_vl_operation, op )
  826. ),
  827. TP_fast_assign(
  828. __entry->call = call->debug_id;
  829. __entry->op = call->operation_ID;
  830. ),
  831. TP_printk("c=%08x %s",
  832. __entry->call,
  833. __print_symbolic(__entry->op, afs_vl_operations))
  834. );
  835. TRACE_EVENT(afs_call_done,
  836. TP_PROTO(struct afs_call *call),
  837. TP_ARGS(call),
  838. TP_STRUCT__entry(
  839. __field(unsigned int, call )
  840. __field(struct rxrpc_call *, rx_call )
  841. __field(int, ret )
  842. __field(u32, abort_code )
  843. ),
  844. TP_fast_assign(
  845. __entry->call = call->debug_id;
  846. __entry->rx_call = call->rxcall;
  847. __entry->ret = call->error;
  848. __entry->abort_code = call->abort_code;
  849. ),
  850. TP_printk(" c=%08x ret=%d ab=%d [%p]",
  851. __entry->call,
  852. __entry->ret,
  853. __entry->abort_code,
  854. __entry->rx_call)
  855. );
  856. TRACE_EVENT(afs_send_data,
  857. TP_PROTO(struct afs_call *call, struct msghdr *msg),
  858. TP_ARGS(call, msg),
  859. TP_STRUCT__entry(
  860. __field(unsigned int, call )
  861. __field(unsigned int, flags )
  862. __field(loff_t, offset )
  863. __field(loff_t, count )
  864. ),
  865. TP_fast_assign(
  866. __entry->call = call->debug_id;
  867. __entry->flags = msg->msg_flags;
  868. __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
  869. __entry->count = iov_iter_count(&msg->msg_iter);
  870. ),
  871. TP_printk(" c=%08x o=%llx n=%llx f=%x",
  872. __entry->call, __entry->offset, __entry->count,
  873. __entry->flags)
  874. );
  875. TRACE_EVENT(afs_sent_data,
  876. TP_PROTO(struct afs_call *call, struct msghdr *msg, int ret),
  877. TP_ARGS(call, msg, ret),
  878. TP_STRUCT__entry(
  879. __field(unsigned int, call )
  880. __field(int, ret )
  881. __field(loff_t, offset )
  882. __field(loff_t, count )
  883. ),
  884. TP_fast_assign(
  885. __entry->call = call->debug_id;
  886. __entry->ret = ret;
  887. __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
  888. __entry->count = iov_iter_count(&msg->msg_iter);
  889. ),
  890. TP_printk(" c=%08x o=%llx n=%llx r=%x",
  891. __entry->call, __entry->offset, __entry->count,
  892. __entry->ret)
  893. );
  894. TRACE_EVENT(afs_dir_check_failed,
  895. TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size),
  896. TP_ARGS(vnode, off, i_size),
  897. TP_STRUCT__entry(
  898. __field(struct afs_vnode *, vnode )
  899. __field(loff_t, off )
  900. __field(loff_t, i_size )
  901. ),
  902. TP_fast_assign(
  903. __entry->vnode = vnode;
  904. __entry->off = off;
  905. __entry->i_size = i_size;
  906. ),
  907. TP_printk("vn=%p %llx/%llx",
  908. __entry->vnode, __entry->off, __entry->i_size)
  909. );
  910. TRACE_EVENT(afs_folio_dirty,
  911. TP_PROTO(struct afs_vnode *vnode, const char *where, struct folio *folio),
  912. TP_ARGS(vnode, where, folio),
  913. TP_STRUCT__entry(
  914. __field(struct afs_vnode *, vnode )
  915. __field(const char *, where )
  916. __field(pgoff_t, index )
  917. __field(unsigned long, from )
  918. __field(unsigned long, to )
  919. ),
  920. TP_fast_assign(
  921. unsigned long priv = (unsigned long)folio_get_private(folio);
  922. __entry->vnode = vnode;
  923. __entry->where = where;
  924. __entry->index = folio_index(folio);
  925. __entry->from = afs_folio_dirty_from(folio, priv);
  926. __entry->to = afs_folio_dirty_to(folio, priv);
  927. __entry->to |= (afs_is_folio_dirty_mmapped(priv) ?
  928. (1UL << (BITS_PER_LONG - 1)) : 0);
  929. ),
  930. TP_printk("vn=%p %lx %s %lx-%lx%s",
  931. __entry->vnode, __entry->index, __entry->where,
  932. __entry->from,
  933. __entry->to & ~(1UL << (BITS_PER_LONG - 1)),
  934. __entry->to & (1UL << (BITS_PER_LONG - 1)) ? " M" : "")
  935. );
  936. TRACE_EVENT(afs_call_state,
  937. TP_PROTO(struct afs_call *call,
  938. enum afs_call_state from,
  939. enum afs_call_state to,
  940. int ret, u32 remote_abort),
  941. TP_ARGS(call, from, to, ret, remote_abort),
  942. TP_STRUCT__entry(
  943. __field(unsigned int, call )
  944. __field(enum afs_call_state, from )
  945. __field(enum afs_call_state, to )
  946. __field(int, ret )
  947. __field(u32, abort )
  948. ),
  949. TP_fast_assign(
  950. __entry->call = call->debug_id;
  951. __entry->from = from;
  952. __entry->to = to;
  953. __entry->ret = ret;
  954. __entry->abort = remote_abort;
  955. ),
  956. TP_printk("c=%08x %u->%u r=%d ab=%d",
  957. __entry->call,
  958. __entry->from, __entry->to,
  959. __entry->ret, __entry->abort)
  960. );
  961. TRACE_EVENT(afs_lookup,
  962. TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
  963. struct afs_fid *fid),
  964. TP_ARGS(dvnode, name, fid),
  965. TP_STRUCT__entry(
  966. __field_struct(struct afs_fid, dfid )
  967. __field_struct(struct afs_fid, fid )
  968. __array(char, name, 24 )
  969. ),
  970. TP_fast_assign(
  971. int __len = min_t(int, name->len, 23);
  972. __entry->dfid = dvnode->fid;
  973. __entry->fid = *fid;
  974. memcpy(__entry->name, name->name, __len);
  975. __entry->name[__len] = 0;
  976. ),
  977. TP_printk("d=%llx:%llx:%x \"%s\" f=%llx:%x",
  978. __entry->dfid.vid, __entry->dfid.vnode, __entry->dfid.unique,
  979. __entry->name,
  980. __entry->fid.vnode, __entry->fid.unique)
  981. );
  982. TRACE_EVENT(afs_edit_dir,
  983. TP_PROTO(struct afs_vnode *dvnode,
  984. enum afs_edit_dir_reason why,
  985. enum afs_edit_dir_op op,
  986. unsigned int block,
  987. unsigned int slot,
  988. unsigned int f_vnode,
  989. unsigned int f_unique,
  990. const char *name),
  991. TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name),
  992. TP_STRUCT__entry(
  993. __field(unsigned int, vnode )
  994. __field(unsigned int, unique )
  995. __field(enum afs_edit_dir_reason, why )
  996. __field(enum afs_edit_dir_op, op )
  997. __field(unsigned int, block )
  998. __field(unsigned short, slot )
  999. __field(unsigned int, f_vnode )
  1000. __field(unsigned int, f_unique )
  1001. __array(char, name, 24 )
  1002. ),
  1003. TP_fast_assign(
  1004. int __len = strlen(name);
  1005. __len = min(__len, 23);
  1006. __entry->vnode = dvnode->fid.vnode;
  1007. __entry->unique = dvnode->fid.unique;
  1008. __entry->why = why;
  1009. __entry->op = op;
  1010. __entry->block = block;
  1011. __entry->slot = slot;
  1012. __entry->f_vnode = f_vnode;
  1013. __entry->f_unique = f_unique;
  1014. memcpy(__entry->name, name, __len);
  1015. __entry->name[__len] = 0;
  1016. ),
  1017. TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x \"%s\"",
  1018. __entry->vnode, __entry->unique,
  1019. __print_symbolic(__entry->why, afs_edit_dir_reasons),
  1020. __print_symbolic(__entry->op, afs_edit_dir_ops),
  1021. __entry->block, __entry->slot,
  1022. __entry->f_vnode, __entry->f_unique,
  1023. __entry->name)
  1024. );
  1025. TRACE_EVENT(afs_protocol_error,
  1026. TP_PROTO(struct afs_call *call, enum afs_eproto_cause cause),
  1027. TP_ARGS(call, cause),
  1028. TP_STRUCT__entry(
  1029. __field(unsigned int, call )
  1030. __field(enum afs_eproto_cause, cause )
  1031. ),
  1032. TP_fast_assign(
  1033. __entry->call = call ? call->debug_id : 0;
  1034. __entry->cause = cause;
  1035. ),
  1036. TP_printk("c=%08x %s",
  1037. __entry->call,
  1038. __print_symbolic(__entry->cause, afs_eproto_causes))
  1039. );
  1040. TRACE_EVENT(afs_io_error,
  1041. TP_PROTO(unsigned int call, int error, enum afs_io_error where),
  1042. TP_ARGS(call, error, where),
  1043. TP_STRUCT__entry(
  1044. __field(unsigned int, call )
  1045. __field(int, error )
  1046. __field(enum afs_io_error, where )
  1047. ),
  1048. TP_fast_assign(
  1049. __entry->call = call;
  1050. __entry->error = error;
  1051. __entry->where = where;
  1052. ),
  1053. TP_printk("c=%08x r=%d %s",
  1054. __entry->call, __entry->error,
  1055. __print_symbolic(__entry->where, afs_io_errors))
  1056. );
  1057. TRACE_EVENT(afs_file_error,
  1058. TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where),
  1059. TP_ARGS(vnode, error, where),
  1060. TP_STRUCT__entry(
  1061. __field_struct(struct afs_fid, fid )
  1062. __field(int, error )
  1063. __field(enum afs_file_error, where )
  1064. ),
  1065. TP_fast_assign(
  1066. __entry->fid = vnode->fid;
  1067. __entry->error = error;
  1068. __entry->where = where;
  1069. ),
  1070. TP_printk("%llx:%llx:%x r=%d %s",
  1071. __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
  1072. __entry->error,
  1073. __print_symbolic(__entry->where, afs_file_errors))
  1074. );
  1075. TRACE_EVENT(afs_cm_no_server,
  1076. TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
  1077. TP_ARGS(call, srx),
  1078. TP_STRUCT__entry(
  1079. __field(unsigned int, call )
  1080. __field(unsigned int, op_id )
  1081. __field_struct(struct sockaddr_rxrpc, srx )
  1082. ),
  1083. TP_fast_assign(
  1084. __entry->call = call->debug_id;
  1085. __entry->op_id = call->operation_ID;
  1086. memcpy(&__entry->srx, srx, sizeof(__entry->srx));
  1087. ),
  1088. TP_printk("c=%08x op=%u %pISpc",
  1089. __entry->call, __entry->op_id, &__entry->srx.transport)
  1090. );
  1091. TRACE_EVENT(afs_cm_no_server_u,
  1092. TP_PROTO(struct afs_call *call, const uuid_t *uuid),
  1093. TP_ARGS(call, uuid),
  1094. TP_STRUCT__entry(
  1095. __field(unsigned int, call )
  1096. __field(unsigned int, op_id )
  1097. __field_struct(uuid_t, uuid )
  1098. ),
  1099. TP_fast_assign(
  1100. __entry->call = call->debug_id;
  1101. __entry->op_id = call->operation_ID;
  1102. memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
  1103. ),
  1104. TP_printk("c=%08x op=%u %pU",
  1105. __entry->call, __entry->op_id, &__entry->uuid)
  1106. );
  1107. TRACE_EVENT(afs_flock_ev,
  1108. TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
  1109. enum afs_flock_event event, int error),
  1110. TP_ARGS(vnode, fl, event, error),
  1111. TP_STRUCT__entry(
  1112. __field_struct(struct afs_fid, fid )
  1113. __field(enum afs_flock_event, event )
  1114. __field(enum afs_lock_state, state )
  1115. __field(int, error )
  1116. __field(unsigned int, debug_id )
  1117. ),
  1118. TP_fast_assign(
  1119. __entry->fid = vnode->fid;
  1120. __entry->event = event;
  1121. __entry->state = vnode->lock_state;
  1122. __entry->error = error;
  1123. __entry->debug_id = fl ? fl->fl_u.afs.debug_id : 0;
  1124. ),
  1125. TP_printk("%llx:%llx:%x %04x %s s=%s e=%d",
  1126. __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
  1127. __entry->debug_id,
  1128. __print_symbolic(__entry->event, afs_flock_events),
  1129. __print_symbolic(__entry->state, afs_flock_states),
  1130. __entry->error)
  1131. );
  1132. TRACE_EVENT(afs_flock_op,
  1133. TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
  1134. enum afs_flock_operation op),
  1135. TP_ARGS(vnode, fl, op),
  1136. TP_STRUCT__entry(
  1137. __field_struct(struct afs_fid, fid )
  1138. __field(loff_t, from )
  1139. __field(loff_t, len )
  1140. __field(enum afs_flock_operation, op )
  1141. __field(unsigned char, type )
  1142. __field(unsigned int, flags )
  1143. __field(unsigned int, debug_id )
  1144. ),
  1145. TP_fast_assign(
  1146. __entry->fid = vnode->fid;
  1147. __entry->from = fl->fl_start;
  1148. __entry->len = fl->fl_end - fl->fl_start + 1;
  1149. __entry->op = op;
  1150. __entry->type = fl->fl_type;
  1151. __entry->flags = fl->fl_flags;
  1152. __entry->debug_id = fl->fl_u.afs.debug_id;
  1153. ),
  1154. TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x",
  1155. __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
  1156. __entry->debug_id,
  1157. __print_symbolic(__entry->op, afs_flock_operations),
  1158. __print_symbolic(__entry->type, afs_flock_types),
  1159. __entry->from, __entry->len, __entry->flags)
  1160. );
  1161. TRACE_EVENT(afs_reload_dir,
  1162. TP_PROTO(struct afs_vnode *vnode),
  1163. TP_ARGS(vnode),
  1164. TP_STRUCT__entry(
  1165. __field_struct(struct afs_fid, fid )
  1166. ),
  1167. TP_fast_assign(
  1168. __entry->fid = vnode->fid;
  1169. ),
  1170. TP_printk("%llx:%llx:%x",
  1171. __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique)
  1172. );
  1173. TRACE_EVENT(afs_silly_rename,
  1174. TP_PROTO(struct afs_vnode *vnode, bool done),
  1175. TP_ARGS(vnode, done),
  1176. TP_STRUCT__entry(
  1177. __field_struct(struct afs_fid, fid )
  1178. __field(bool, done )
  1179. ),
  1180. TP_fast_assign(
  1181. __entry->fid = vnode->fid;
  1182. __entry->done = done;
  1183. ),
  1184. TP_printk("%llx:%llx:%x done=%u",
  1185. __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
  1186. __entry->done)
  1187. );
  1188. TRACE_EVENT(afs_get_tree,
  1189. TP_PROTO(struct afs_cell *cell, struct afs_volume *volume),
  1190. TP_ARGS(cell, volume),
  1191. TP_STRUCT__entry(
  1192. __field(u64, vid )
  1193. __array(char, cell, 24 )
  1194. __array(char, volume, 24 )
  1195. ),
  1196. TP_fast_assign(
  1197. int __len;
  1198. __entry->vid = volume->vid;
  1199. __len = min_t(int, cell->name_len, 23);
  1200. memcpy(__entry->cell, cell->name, __len);
  1201. __entry->cell[__len] = 0;
  1202. __len = min_t(int, volume->name_len, 23);
  1203. memcpy(__entry->volume, volume->name, __len);
  1204. __entry->volume[__len] = 0;
  1205. ),
  1206. TP_printk("--- MOUNT %s:%s %llx",
  1207. __entry->cell, __entry->volume, __entry->vid)
  1208. );
  1209. TRACE_EVENT(afs_cb_break,
  1210. TP_PROTO(struct afs_fid *fid, unsigned int cb_break,
  1211. enum afs_cb_break_reason reason, bool skipped),
  1212. TP_ARGS(fid, cb_break, reason, skipped),
  1213. TP_STRUCT__entry(
  1214. __field_struct(struct afs_fid, fid )
  1215. __field(unsigned int, cb_break )
  1216. __field(enum afs_cb_break_reason, reason )
  1217. __field(bool, skipped )
  1218. ),
  1219. TP_fast_assign(
  1220. __entry->fid = *fid;
  1221. __entry->cb_break = cb_break;
  1222. __entry->reason = reason;
  1223. __entry->skipped = skipped;
  1224. ),
  1225. TP_printk("%llx:%llx:%x b=%x s=%u %s",
  1226. __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
  1227. __entry->cb_break,
  1228. __entry->skipped,
  1229. __print_symbolic(__entry->reason, afs_cb_break_reasons))
  1230. );
  1231. TRACE_EVENT(afs_cb_miss,
  1232. TP_PROTO(struct afs_fid *fid, enum afs_cb_break_reason reason),
  1233. TP_ARGS(fid, reason),
  1234. TP_STRUCT__entry(
  1235. __field_struct(struct afs_fid, fid )
  1236. __field(enum afs_cb_break_reason, reason )
  1237. ),
  1238. TP_fast_assign(
  1239. __entry->fid = *fid;
  1240. __entry->reason = reason;
  1241. ),
  1242. TP_printk(" %llx:%llx:%x %s",
  1243. __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
  1244. __print_symbolic(__entry->reason, afs_cb_break_reasons))
  1245. );
  1246. TRACE_EVENT(afs_server,
  1247. TP_PROTO(unsigned int server_debug_id, int ref, int active,
  1248. enum afs_server_trace reason),
  1249. TP_ARGS(server_debug_id, ref, active, reason),
  1250. TP_STRUCT__entry(
  1251. __field(unsigned int, server )
  1252. __field(int, ref )
  1253. __field(int, active )
  1254. __field(int, reason )
  1255. ),
  1256. TP_fast_assign(
  1257. __entry->server = server_debug_id;
  1258. __entry->ref = ref;
  1259. __entry->active = active;
  1260. __entry->reason = reason;
  1261. ),
  1262. TP_printk("s=%08x %s u=%d a=%d",
  1263. __entry->server,
  1264. __print_symbolic(__entry->reason, afs_server_traces),
  1265. __entry->ref,
  1266. __entry->active)
  1267. );
  1268. TRACE_EVENT(afs_volume,
  1269. TP_PROTO(afs_volid_t vid, int ref, enum afs_volume_trace reason),
  1270. TP_ARGS(vid, ref, reason),
  1271. TP_STRUCT__entry(
  1272. __field(afs_volid_t, vid )
  1273. __field(int, ref )
  1274. __field(enum afs_volume_trace, reason )
  1275. ),
  1276. TP_fast_assign(
  1277. __entry->vid = vid;
  1278. __entry->ref = ref;
  1279. __entry->reason = reason;
  1280. ),
  1281. TP_printk("V=%llx %s ur=%d",
  1282. __entry->vid,
  1283. __print_symbolic(__entry->reason, afs_volume_traces),
  1284. __entry->ref)
  1285. );
  1286. TRACE_EVENT(afs_cell,
  1287. TP_PROTO(unsigned int cell_debug_id, int ref, int active,
  1288. enum afs_cell_trace reason),
  1289. TP_ARGS(cell_debug_id, ref, active, reason),
  1290. TP_STRUCT__entry(
  1291. __field(unsigned int, cell )
  1292. __field(int, ref )
  1293. __field(int, active )
  1294. __field(int, reason )
  1295. ),
  1296. TP_fast_assign(
  1297. __entry->cell = cell_debug_id;
  1298. __entry->ref = ref;
  1299. __entry->active = active;
  1300. __entry->reason = reason;
  1301. ),
  1302. TP_printk("L=%08x %s r=%d a=%d",
  1303. __entry->cell,
  1304. __print_symbolic(__entry->reason, afs_cell_traces),
  1305. __entry->ref,
  1306. __entry->active)
  1307. );
  1308. #endif /* _TRACE_AFS_H */
  1309. /* This part must be outside protection */
  1310. #include <trace/define_trace.h>