rxrpc.h 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556
  1. /* AF_RXRPC tracepoints
  2. *
  3. * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #undef TRACE_SYSTEM
  12. #define TRACE_SYSTEM rxrpc
  13. #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
  14. #define _TRACE_RXRPC_H
  15. #include <linux/tracepoint.h>
  16. #include <linux/errqueue.h>
  17. /*
  18. * Define enums for tracing information.
  19. *
  20. * These should all be kept sorted, making it easier to match the string
  21. * mapping tables further on.
  22. */
  23. #ifndef __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
  24. #define __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
  25. enum rxrpc_skb_trace {
  26. rxrpc_skb_rx_cleaned,
  27. rxrpc_skb_rx_freed,
  28. rxrpc_skb_rx_got,
  29. rxrpc_skb_rx_lost,
  30. rxrpc_skb_rx_purged,
  31. rxrpc_skb_rx_received,
  32. rxrpc_skb_rx_rotated,
  33. rxrpc_skb_rx_seen,
  34. rxrpc_skb_tx_cleaned,
  35. rxrpc_skb_tx_freed,
  36. rxrpc_skb_tx_got,
  37. rxrpc_skb_tx_new,
  38. rxrpc_skb_tx_rotated,
  39. rxrpc_skb_tx_seen,
  40. };
  41. enum rxrpc_local_trace {
  42. rxrpc_local_got,
  43. rxrpc_local_new,
  44. rxrpc_local_processing,
  45. rxrpc_local_put,
  46. rxrpc_local_queued,
  47. };
  48. enum rxrpc_peer_trace {
  49. rxrpc_peer_got,
  50. rxrpc_peer_new,
  51. rxrpc_peer_processing,
  52. rxrpc_peer_put,
  53. };
  54. enum rxrpc_conn_trace {
  55. rxrpc_conn_got,
  56. rxrpc_conn_new_client,
  57. rxrpc_conn_new_service,
  58. rxrpc_conn_put_client,
  59. rxrpc_conn_put_service,
  60. rxrpc_conn_queued,
  61. rxrpc_conn_reap_service,
  62. rxrpc_conn_seen,
  63. };
  64. enum rxrpc_client_trace {
  65. rxrpc_client_activate_chans,
  66. rxrpc_client_alloc,
  67. rxrpc_client_chan_activate,
  68. rxrpc_client_chan_disconnect,
  69. rxrpc_client_chan_pass,
  70. rxrpc_client_chan_unstarted,
  71. rxrpc_client_chan_wait_failed,
  72. rxrpc_client_cleanup,
  73. rxrpc_client_count,
  74. rxrpc_client_discard,
  75. rxrpc_client_duplicate,
  76. rxrpc_client_exposed,
  77. rxrpc_client_replace,
  78. rxrpc_client_to_active,
  79. rxrpc_client_to_culled,
  80. rxrpc_client_to_idle,
  81. rxrpc_client_to_inactive,
  82. rxrpc_client_to_upgrade,
  83. rxrpc_client_to_waiting,
  84. rxrpc_client_uncount,
  85. };
  86. enum rxrpc_call_trace {
  87. rxrpc_call_connected,
  88. rxrpc_call_error,
  89. rxrpc_call_got,
  90. rxrpc_call_got_kernel,
  91. rxrpc_call_got_userid,
  92. rxrpc_call_new_client,
  93. rxrpc_call_new_service,
  94. rxrpc_call_put,
  95. rxrpc_call_put_kernel,
  96. rxrpc_call_put_noqueue,
  97. rxrpc_call_put_userid,
  98. rxrpc_call_queued,
  99. rxrpc_call_queued_ref,
  100. rxrpc_call_release,
  101. rxrpc_call_seen,
  102. };
  103. enum rxrpc_transmit_trace {
  104. rxrpc_transmit_await_reply,
  105. rxrpc_transmit_end,
  106. rxrpc_transmit_queue,
  107. rxrpc_transmit_queue_last,
  108. rxrpc_transmit_rotate,
  109. rxrpc_transmit_rotate_last,
  110. rxrpc_transmit_wait,
  111. };
  112. enum rxrpc_receive_trace {
  113. rxrpc_receive_end,
  114. rxrpc_receive_front,
  115. rxrpc_receive_incoming,
  116. rxrpc_receive_queue,
  117. rxrpc_receive_queue_last,
  118. rxrpc_receive_rotate,
  119. };
  120. enum rxrpc_recvmsg_trace {
  121. rxrpc_recvmsg_cont,
  122. rxrpc_recvmsg_data_return,
  123. rxrpc_recvmsg_dequeue,
  124. rxrpc_recvmsg_enter,
  125. rxrpc_recvmsg_full,
  126. rxrpc_recvmsg_hole,
  127. rxrpc_recvmsg_next,
  128. rxrpc_recvmsg_requeue,
  129. rxrpc_recvmsg_return,
  130. rxrpc_recvmsg_terminal,
  131. rxrpc_recvmsg_to_be_accepted,
  132. rxrpc_recvmsg_wait,
  133. };
  134. enum rxrpc_rtt_tx_trace {
  135. rxrpc_rtt_tx_data,
  136. rxrpc_rtt_tx_ping,
  137. };
  138. enum rxrpc_rtt_rx_trace {
  139. rxrpc_rtt_rx_ping_response,
  140. rxrpc_rtt_rx_requested_ack,
  141. };
  142. enum rxrpc_timer_trace {
  143. rxrpc_timer_begin,
  144. rxrpc_timer_exp_ack,
  145. rxrpc_timer_exp_hard,
  146. rxrpc_timer_exp_idle,
  147. rxrpc_timer_exp_keepalive,
  148. rxrpc_timer_exp_lost_ack,
  149. rxrpc_timer_exp_normal,
  150. rxrpc_timer_exp_ping,
  151. rxrpc_timer_exp_resend,
  152. rxrpc_timer_expired,
  153. rxrpc_timer_init_for_reply,
  154. rxrpc_timer_init_for_send_reply,
  155. rxrpc_timer_restart,
  156. rxrpc_timer_set_for_ack,
  157. rxrpc_timer_set_for_hard,
  158. rxrpc_timer_set_for_idle,
  159. rxrpc_timer_set_for_keepalive,
  160. rxrpc_timer_set_for_lost_ack,
  161. rxrpc_timer_set_for_normal,
  162. rxrpc_timer_set_for_ping,
  163. rxrpc_timer_set_for_resend,
  164. rxrpc_timer_set_for_send,
  165. };
  166. enum rxrpc_propose_ack_trace {
  167. rxrpc_propose_ack_client_tx_end,
  168. rxrpc_propose_ack_input_data,
  169. rxrpc_propose_ack_ping_for_keepalive,
  170. rxrpc_propose_ack_ping_for_lost_ack,
  171. rxrpc_propose_ack_ping_for_lost_reply,
  172. rxrpc_propose_ack_ping_for_params,
  173. rxrpc_propose_ack_processing_op,
  174. rxrpc_propose_ack_respond_to_ack,
  175. rxrpc_propose_ack_respond_to_ping,
  176. rxrpc_propose_ack_retry_tx,
  177. rxrpc_propose_ack_rotate_rx,
  178. rxrpc_propose_ack_terminal_ack,
  179. };
  180. enum rxrpc_propose_ack_outcome {
  181. rxrpc_propose_ack_subsume,
  182. rxrpc_propose_ack_update,
  183. rxrpc_propose_ack_use,
  184. };
  185. enum rxrpc_congest_change {
  186. rxrpc_cong_begin_retransmission,
  187. rxrpc_cong_cleared_nacks,
  188. rxrpc_cong_new_low_nack,
  189. rxrpc_cong_no_change,
  190. rxrpc_cong_progress,
  191. rxrpc_cong_retransmit_again,
  192. rxrpc_cong_rtt_window_end,
  193. rxrpc_cong_saw_nack,
  194. };
  195. enum rxrpc_tx_point {
  196. rxrpc_tx_point_call_abort,
  197. rxrpc_tx_point_call_ack,
  198. rxrpc_tx_point_call_data_frag,
  199. rxrpc_tx_point_call_data_nofrag,
  200. rxrpc_tx_point_call_final_resend,
  201. rxrpc_tx_point_conn_abort,
  202. rxrpc_tx_point_rxkad_challenge,
  203. rxrpc_tx_point_rxkad_response,
  204. rxrpc_tx_point_reject,
  205. rxrpc_tx_point_version_keepalive,
  206. rxrpc_tx_point_version_reply,
  207. };
  208. #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
  209. /*
  210. * Declare tracing information enums and their string mappings for display.
  211. */
  212. #define rxrpc_skb_traces \
  213. EM(rxrpc_skb_rx_cleaned, "Rx CLN") \
  214. EM(rxrpc_skb_rx_freed, "Rx FRE") \
  215. EM(rxrpc_skb_rx_got, "Rx GOT") \
  216. EM(rxrpc_skb_rx_lost, "Rx *L*") \
  217. EM(rxrpc_skb_rx_purged, "Rx PUR") \
  218. EM(rxrpc_skb_rx_received, "Rx RCV") \
  219. EM(rxrpc_skb_rx_rotated, "Rx ROT") \
  220. EM(rxrpc_skb_rx_seen, "Rx SEE") \
  221. EM(rxrpc_skb_tx_cleaned, "Tx CLN") \
  222. EM(rxrpc_skb_tx_freed, "Tx FRE") \
  223. EM(rxrpc_skb_tx_got, "Tx GOT") \
  224. EM(rxrpc_skb_tx_new, "Tx NEW") \
  225. EM(rxrpc_skb_tx_rotated, "Tx ROT") \
  226. E_(rxrpc_skb_tx_seen, "Tx SEE")
  227. #define rxrpc_local_traces \
  228. EM(rxrpc_local_got, "GOT") \
  229. EM(rxrpc_local_new, "NEW") \
  230. EM(rxrpc_local_processing, "PRO") \
  231. EM(rxrpc_local_put, "PUT") \
  232. E_(rxrpc_local_queued, "QUE")
  233. #define rxrpc_peer_traces \
  234. EM(rxrpc_peer_got, "GOT") \
  235. EM(rxrpc_peer_new, "NEW") \
  236. EM(rxrpc_peer_processing, "PRO") \
  237. E_(rxrpc_peer_put, "PUT")
  238. #define rxrpc_conn_traces \
  239. EM(rxrpc_conn_got, "GOT") \
  240. EM(rxrpc_conn_new_client, "NWc") \
  241. EM(rxrpc_conn_new_service, "NWs") \
  242. EM(rxrpc_conn_put_client, "PTc") \
  243. EM(rxrpc_conn_put_service, "PTs") \
  244. EM(rxrpc_conn_queued, "QUE") \
  245. EM(rxrpc_conn_reap_service, "RPs") \
  246. E_(rxrpc_conn_seen, "SEE")
  247. #define rxrpc_client_traces \
  248. EM(rxrpc_client_activate_chans, "Activa") \
  249. EM(rxrpc_client_alloc, "Alloc ") \
  250. EM(rxrpc_client_chan_activate, "ChActv") \
  251. EM(rxrpc_client_chan_disconnect, "ChDisc") \
  252. EM(rxrpc_client_chan_pass, "ChPass") \
  253. EM(rxrpc_client_chan_unstarted, "ChUnst") \
  254. EM(rxrpc_client_chan_wait_failed, "ChWtFl") \
  255. EM(rxrpc_client_cleanup, "Clean ") \
  256. EM(rxrpc_client_count, "Count ") \
  257. EM(rxrpc_client_discard, "Discar") \
  258. EM(rxrpc_client_duplicate, "Duplic") \
  259. EM(rxrpc_client_exposed, "Expose") \
  260. EM(rxrpc_client_replace, "Replac") \
  261. EM(rxrpc_client_to_active, "->Actv") \
  262. EM(rxrpc_client_to_culled, "->Cull") \
  263. EM(rxrpc_client_to_idle, "->Idle") \
  264. EM(rxrpc_client_to_inactive, "->Inac") \
  265. EM(rxrpc_client_to_upgrade, "->Upgd") \
  266. EM(rxrpc_client_to_waiting, "->Wait") \
  267. E_(rxrpc_client_uncount, "Uncoun")
  268. #define rxrpc_conn_cache_states \
  269. EM(RXRPC_CONN_CLIENT_INACTIVE, "Inac") \
  270. EM(RXRPC_CONN_CLIENT_WAITING, "Wait") \
  271. EM(RXRPC_CONN_CLIENT_ACTIVE, "Actv") \
  272. EM(RXRPC_CONN_CLIENT_UPGRADE, "Upgd") \
  273. EM(RXRPC_CONN_CLIENT_CULLED, "Cull") \
  274. E_(RXRPC_CONN_CLIENT_IDLE, "Idle") \
  275. #define rxrpc_call_traces \
  276. EM(rxrpc_call_connected, "CON") \
  277. EM(rxrpc_call_error, "*E*") \
  278. EM(rxrpc_call_got, "GOT") \
  279. EM(rxrpc_call_got_kernel, "Gke") \
  280. EM(rxrpc_call_got_userid, "Gus") \
  281. EM(rxrpc_call_new_client, "NWc") \
  282. EM(rxrpc_call_new_service, "NWs") \
  283. EM(rxrpc_call_put, "PUT") \
  284. EM(rxrpc_call_put_kernel, "Pke") \
  285. EM(rxrpc_call_put_noqueue, "PNQ") \
  286. EM(rxrpc_call_put_userid, "Pus") \
  287. EM(rxrpc_call_queued, "QUE") \
  288. EM(rxrpc_call_queued_ref, "QUR") \
  289. EM(rxrpc_call_release, "RLS") \
  290. E_(rxrpc_call_seen, "SEE")
  291. #define rxrpc_transmit_traces \
  292. EM(rxrpc_transmit_await_reply, "AWR") \
  293. EM(rxrpc_transmit_end, "END") \
  294. EM(rxrpc_transmit_queue, "QUE") \
  295. EM(rxrpc_transmit_queue_last, "QLS") \
  296. EM(rxrpc_transmit_rotate, "ROT") \
  297. EM(rxrpc_transmit_rotate_last, "RLS") \
  298. E_(rxrpc_transmit_wait, "WAI")
  299. #define rxrpc_receive_traces \
  300. EM(rxrpc_receive_end, "END") \
  301. EM(rxrpc_receive_front, "FRN") \
  302. EM(rxrpc_receive_incoming, "INC") \
  303. EM(rxrpc_receive_queue, "QUE") \
  304. EM(rxrpc_receive_queue_last, "QLS") \
  305. E_(rxrpc_receive_rotate, "ROT")
  306. #define rxrpc_recvmsg_traces \
  307. EM(rxrpc_recvmsg_cont, "CONT") \
  308. EM(rxrpc_recvmsg_data_return, "DATA") \
  309. EM(rxrpc_recvmsg_dequeue, "DEQU") \
  310. EM(rxrpc_recvmsg_enter, "ENTR") \
  311. EM(rxrpc_recvmsg_full, "FULL") \
  312. EM(rxrpc_recvmsg_hole, "HOLE") \
  313. EM(rxrpc_recvmsg_next, "NEXT") \
  314. EM(rxrpc_recvmsg_requeue, "REQU") \
  315. EM(rxrpc_recvmsg_return, "RETN") \
  316. EM(rxrpc_recvmsg_terminal, "TERM") \
  317. EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \
  318. E_(rxrpc_recvmsg_wait, "WAIT")
  319. #define rxrpc_rtt_tx_traces \
  320. EM(rxrpc_rtt_tx_data, "DATA") \
  321. E_(rxrpc_rtt_tx_ping, "PING")
  322. #define rxrpc_rtt_rx_traces \
  323. EM(rxrpc_rtt_rx_ping_response, "PONG") \
  324. E_(rxrpc_rtt_rx_requested_ack, "RACK")
  325. #define rxrpc_timer_traces \
  326. EM(rxrpc_timer_begin, "Begin ") \
  327. EM(rxrpc_timer_expired, "*EXPR*") \
  328. EM(rxrpc_timer_exp_ack, "ExpAck") \
  329. EM(rxrpc_timer_exp_hard, "ExpHrd") \
  330. EM(rxrpc_timer_exp_idle, "ExpIdl") \
  331. EM(rxrpc_timer_exp_keepalive, "ExpKA ") \
  332. EM(rxrpc_timer_exp_lost_ack, "ExpLoA") \
  333. EM(rxrpc_timer_exp_normal, "ExpNml") \
  334. EM(rxrpc_timer_exp_ping, "ExpPng") \
  335. EM(rxrpc_timer_exp_resend, "ExpRsn") \
  336. EM(rxrpc_timer_init_for_reply, "IniRpl") \
  337. EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
  338. EM(rxrpc_timer_restart, "Restrt") \
  339. EM(rxrpc_timer_set_for_ack, "SetAck") \
  340. EM(rxrpc_timer_set_for_hard, "SetHrd") \
  341. EM(rxrpc_timer_set_for_idle, "SetIdl") \
  342. EM(rxrpc_timer_set_for_keepalive, "KeepAl") \
  343. EM(rxrpc_timer_set_for_lost_ack, "SetLoA") \
  344. EM(rxrpc_timer_set_for_normal, "SetNml") \
  345. EM(rxrpc_timer_set_for_ping, "SetPng") \
  346. EM(rxrpc_timer_set_for_resend, "SetRTx") \
  347. E_(rxrpc_timer_set_for_send, "SetSnd")
  348. #define rxrpc_propose_ack_traces \
  349. EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
  350. EM(rxrpc_propose_ack_input_data, "DataIn ") \
  351. EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \
  352. EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
  353. EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
  354. EM(rxrpc_propose_ack_ping_for_params, "Params ") \
  355. EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
  356. EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
  357. EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
  358. EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
  359. EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
  360. E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
  361. #define rxrpc_propose_ack_outcomes \
  362. EM(rxrpc_propose_ack_subsume, " Subsume") \
  363. EM(rxrpc_propose_ack_update, " Update") \
  364. E_(rxrpc_propose_ack_use, " New")
  365. #define rxrpc_congest_modes \
  366. EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
  367. EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
  368. EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
  369. E_(RXRPC_CALL_SLOW_START, "SlowStart")
  370. #define rxrpc_congest_changes \
  371. EM(rxrpc_cong_begin_retransmission, " Retrans") \
  372. EM(rxrpc_cong_cleared_nacks, " Cleared") \
  373. EM(rxrpc_cong_new_low_nack, " NewLowN") \
  374. EM(rxrpc_cong_no_change, "") \
  375. EM(rxrpc_cong_progress, " Progres") \
  376. EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
  377. EM(rxrpc_cong_rtt_window_end, " RttWinE") \
  378. E_(rxrpc_cong_saw_nack, " SawNack")
  379. #define rxrpc_pkts \
  380. EM(0, "?00") \
  381. EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
  382. EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
  383. EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
  384. EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
  385. EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
  386. EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
  387. EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
  388. EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
  389. EM(9, "?09") \
  390. EM(10, "?10") \
  391. EM(11, "?11") \
  392. EM(12, "?12") \
  393. EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
  394. EM(14, "?14") \
  395. E_(15, "?15")
  396. #define rxrpc_ack_names \
  397. EM(0, "-0-") \
  398. EM(RXRPC_ACK_REQUESTED, "REQ") \
  399. EM(RXRPC_ACK_DUPLICATE, "DUP") \
  400. EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
  401. EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
  402. EM(RXRPC_ACK_NOSPACE, "MEM") \
  403. EM(RXRPC_ACK_PING, "PNG") \
  404. EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
  405. EM(RXRPC_ACK_DELAY, "DLY") \
  406. EM(RXRPC_ACK_IDLE, "IDL") \
  407. E_(RXRPC_ACK__INVALID, "-?-")
  408. #define rxrpc_completions \
  409. EM(RXRPC_CALL_SUCCEEDED, "Succeeded") \
  410. EM(RXRPC_CALL_REMOTELY_ABORTED, "RemoteAbort") \
  411. EM(RXRPC_CALL_LOCALLY_ABORTED, "LocalAbort") \
  412. EM(RXRPC_CALL_LOCAL_ERROR, "LocalError") \
  413. E_(RXRPC_CALL_NETWORK_ERROR, "NetError")
  414. #define rxrpc_tx_points \
  415. EM(rxrpc_tx_point_call_abort, "CallAbort") \
  416. EM(rxrpc_tx_point_call_ack, "CallAck") \
  417. EM(rxrpc_tx_point_call_data_frag, "CallDataFrag") \
  418. EM(rxrpc_tx_point_call_data_nofrag, "CallDataNofrag") \
  419. EM(rxrpc_tx_point_call_final_resend, "CallFinalResend") \
  420. EM(rxrpc_tx_point_conn_abort, "ConnAbort") \
  421. EM(rxrpc_tx_point_reject, "Reject") \
  422. EM(rxrpc_tx_point_rxkad_challenge, "RxkadChall") \
  423. EM(rxrpc_tx_point_rxkad_response, "RxkadResp") \
  424. EM(rxrpc_tx_point_version_keepalive, "VerKeepalive") \
  425. E_(rxrpc_tx_point_version_reply, "VerReply")
  426. /*
  427. * Export enum symbols via userspace.
  428. */
  429. #undef EM
  430. #undef E_
  431. #define EM(a, b) TRACE_DEFINE_ENUM(a);
  432. #define E_(a, b) TRACE_DEFINE_ENUM(a);
  433. rxrpc_skb_traces;
  434. rxrpc_local_traces;
  435. rxrpc_conn_traces;
  436. rxrpc_client_traces;
  437. rxrpc_call_traces;
  438. rxrpc_transmit_traces;
  439. rxrpc_receive_traces;
  440. rxrpc_recvmsg_traces;
  441. rxrpc_rtt_tx_traces;
  442. rxrpc_rtt_rx_traces;
  443. rxrpc_timer_traces;
  444. rxrpc_propose_ack_traces;
  445. rxrpc_propose_ack_outcomes;
  446. rxrpc_congest_modes;
  447. rxrpc_congest_changes;
  448. rxrpc_tx_points;
  449. /*
  450. * Now redefine the EM() and E_() macros to map the enums to the strings that
  451. * will be printed in the output.
  452. */
  453. #undef EM
  454. #undef E_
  455. #define EM(a, b) { a, b },
  456. #define E_(a, b) { a, b }
  457. TRACE_EVENT(rxrpc_local,
  458. TP_PROTO(unsigned int local_debug_id, enum rxrpc_local_trace op,
  459. int usage, const void *where),
  460. TP_ARGS(local_debug_id, op, usage, where),
  461. TP_STRUCT__entry(
  462. __field(unsigned int, local )
  463. __field(int, op )
  464. __field(int, usage )
  465. __field(const void *, where )
  466. ),
  467. TP_fast_assign(
  468. __entry->local = local_debug_id;
  469. __entry->op = op;
  470. __entry->usage = usage;
  471. __entry->where = where;
  472. ),
  473. TP_printk("L=%08x %s u=%d sp=%pSR",
  474. __entry->local,
  475. __print_symbolic(__entry->op, rxrpc_local_traces),
  476. __entry->usage,
  477. __entry->where)
  478. );
  479. TRACE_EVENT(rxrpc_peer,
  480. TP_PROTO(unsigned int peer_debug_id, enum rxrpc_peer_trace op,
  481. int usage, const void *where),
  482. TP_ARGS(peer_debug_id, op, usage, where),
  483. TP_STRUCT__entry(
  484. __field(unsigned int, peer )
  485. __field(int, op )
  486. __field(int, usage )
  487. __field(const void *, where )
  488. ),
  489. TP_fast_assign(
  490. __entry->peer = peer_debug_id;
  491. __entry->op = op;
  492. __entry->usage = usage;
  493. __entry->where = where;
  494. ),
  495. TP_printk("P=%08x %s u=%d sp=%pSR",
  496. __entry->peer,
  497. __print_symbolic(__entry->op, rxrpc_peer_traces),
  498. __entry->usage,
  499. __entry->where)
  500. );
  501. TRACE_EVENT(rxrpc_conn,
  502. TP_PROTO(unsigned int conn_debug_id, enum rxrpc_conn_trace op,
  503. int usage, const void *where),
  504. TP_ARGS(conn_debug_id, op, usage, where),
  505. TP_STRUCT__entry(
  506. __field(unsigned int, conn )
  507. __field(int, op )
  508. __field(int, usage )
  509. __field(const void *, where )
  510. ),
  511. TP_fast_assign(
  512. __entry->conn = conn_debug_id;
  513. __entry->op = op;
  514. __entry->usage = usage;
  515. __entry->where = where;
  516. ),
  517. TP_printk("C=%08x %s u=%d sp=%pSR",
  518. __entry->conn,
  519. __print_symbolic(__entry->op, rxrpc_conn_traces),
  520. __entry->usage,
  521. __entry->where)
  522. );
  523. TRACE_EVENT(rxrpc_client,
  524. TP_PROTO(struct rxrpc_connection *conn, int channel,
  525. enum rxrpc_client_trace op),
  526. TP_ARGS(conn, channel, op),
  527. TP_STRUCT__entry(
  528. __field(unsigned int, conn )
  529. __field(u32, cid )
  530. __field(int, channel )
  531. __field(int, usage )
  532. __field(enum rxrpc_client_trace, op )
  533. __field(enum rxrpc_conn_cache_state, cs )
  534. ),
  535. TP_fast_assign(
  536. __entry->conn = conn->debug_id;
  537. __entry->channel = channel;
  538. __entry->usage = atomic_read(&conn->usage);
  539. __entry->op = op;
  540. __entry->cid = conn->proto.cid;
  541. __entry->cs = conn->cache_state;
  542. ),
  543. TP_printk("C=%08x h=%2d %s %s i=%08x u=%d",
  544. __entry->conn,
  545. __entry->channel,
  546. __print_symbolic(__entry->op, rxrpc_client_traces),
  547. __print_symbolic(__entry->cs, rxrpc_conn_cache_states),
  548. __entry->cid,
  549. __entry->usage)
  550. );
  551. TRACE_EVENT(rxrpc_call,
  552. TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
  553. int usage, const void *where, const void *aux),
  554. TP_ARGS(call, op, usage, where, aux),
  555. TP_STRUCT__entry(
  556. __field(unsigned int, call )
  557. __field(int, op )
  558. __field(int, usage )
  559. __field(const void *, where )
  560. __field(const void *, aux )
  561. ),
  562. TP_fast_assign(
  563. __entry->call = call->debug_id;
  564. __entry->op = op;
  565. __entry->usage = usage;
  566. __entry->where = where;
  567. __entry->aux = aux;
  568. ),
  569. TP_printk("c=%08x %s u=%d sp=%pSR a=%p",
  570. __entry->call,
  571. __print_symbolic(__entry->op, rxrpc_call_traces),
  572. __entry->usage,
  573. __entry->where,
  574. __entry->aux)
  575. );
  576. TRACE_EVENT(rxrpc_skb,
  577. TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
  578. int usage, int mod_count, const void *where),
  579. TP_ARGS(skb, op, usage, mod_count, where),
  580. TP_STRUCT__entry(
  581. __field(struct sk_buff *, skb )
  582. __field(enum rxrpc_skb_trace, op )
  583. __field(int, usage )
  584. __field(int, mod_count )
  585. __field(const void *, where )
  586. ),
  587. TP_fast_assign(
  588. __entry->skb = skb;
  589. __entry->op = op;
  590. __entry->usage = usage;
  591. __entry->mod_count = mod_count;
  592. __entry->where = where;
  593. ),
  594. TP_printk("s=%p %s u=%d m=%d p=%pSR",
  595. __entry->skb,
  596. __print_symbolic(__entry->op, rxrpc_skb_traces),
  597. __entry->usage,
  598. __entry->mod_count,
  599. __entry->where)
  600. );
  601. TRACE_EVENT(rxrpc_rx_packet,
  602. TP_PROTO(struct rxrpc_skb_priv *sp),
  603. TP_ARGS(sp),
  604. TP_STRUCT__entry(
  605. __field_struct(struct rxrpc_host_header, hdr )
  606. ),
  607. TP_fast_assign(
  608. memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
  609. ),
  610. TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
  611. __entry->hdr.epoch, __entry->hdr.cid,
  612. __entry->hdr.callNumber, __entry->hdr.serviceId,
  613. __entry->hdr.serial, __entry->hdr.seq,
  614. __entry->hdr.type, __entry->hdr.flags,
  615. __entry->hdr.type <= 15 ?
  616. __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
  617. );
  618. TRACE_EVENT(rxrpc_rx_done,
  619. TP_PROTO(int result, int abort_code),
  620. TP_ARGS(result, abort_code),
  621. TP_STRUCT__entry(
  622. __field(int, result )
  623. __field(int, abort_code )
  624. ),
  625. TP_fast_assign(
  626. __entry->result = result;
  627. __entry->abort_code = abort_code;
  628. ),
  629. TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
  630. );
  631. TRACE_EVENT(rxrpc_abort,
  632. TP_PROTO(unsigned int call_nr, const char *why, u32 cid, u32 call_id,
  633. rxrpc_seq_t seq, int abort_code, int error),
  634. TP_ARGS(call_nr, why, cid, call_id, seq, abort_code, error),
  635. TP_STRUCT__entry(
  636. __field(unsigned int, call_nr )
  637. __array(char, why, 4 )
  638. __field(u32, cid )
  639. __field(u32, call_id )
  640. __field(rxrpc_seq_t, seq )
  641. __field(int, abort_code )
  642. __field(int, error )
  643. ),
  644. TP_fast_assign(
  645. memcpy(__entry->why, why, 4);
  646. __entry->call_nr = call_nr;
  647. __entry->cid = cid;
  648. __entry->call_id = call_id;
  649. __entry->abort_code = abort_code;
  650. __entry->error = error;
  651. __entry->seq = seq;
  652. ),
  653. TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
  654. __entry->call_nr,
  655. __entry->cid, __entry->call_id, __entry->seq,
  656. __entry->abort_code, __entry->error, __entry->why)
  657. );
  658. TRACE_EVENT(rxrpc_call_complete,
  659. TP_PROTO(struct rxrpc_call *call),
  660. TP_ARGS(call),
  661. TP_STRUCT__entry(
  662. __field(unsigned int, call )
  663. __field(enum rxrpc_call_completion, compl )
  664. __field(int, error )
  665. __field(u32, abort_code )
  666. ),
  667. TP_fast_assign(
  668. __entry->call = call->debug_id;
  669. __entry->compl = call->completion;
  670. __entry->error = call->error;
  671. __entry->abort_code = call->abort_code;
  672. ),
  673. TP_printk("c=%08x %s r=%d ac=%d",
  674. __entry->call,
  675. __print_symbolic(__entry->compl, rxrpc_completions),
  676. __entry->error,
  677. __entry->abort_code)
  678. );
  679. TRACE_EVENT(rxrpc_transmit,
  680. TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
  681. TP_ARGS(call, why),
  682. TP_STRUCT__entry(
  683. __field(unsigned int, call )
  684. __field(enum rxrpc_transmit_trace, why )
  685. __field(rxrpc_seq_t, tx_hard_ack )
  686. __field(rxrpc_seq_t, tx_top )
  687. __field(int, tx_winsize )
  688. ),
  689. TP_fast_assign(
  690. __entry->call = call->debug_id;
  691. __entry->why = why;
  692. __entry->tx_hard_ack = call->tx_hard_ack;
  693. __entry->tx_top = call->tx_top;
  694. __entry->tx_winsize = call->tx_winsize;
  695. ),
  696. TP_printk("c=%08x %s f=%08x n=%u/%u",
  697. __entry->call,
  698. __print_symbolic(__entry->why, rxrpc_transmit_traces),
  699. __entry->tx_hard_ack + 1,
  700. __entry->tx_top - __entry->tx_hard_ack,
  701. __entry->tx_winsize)
  702. );
  703. TRACE_EVENT(rxrpc_rx_data,
  704. TP_PROTO(unsigned int call, rxrpc_seq_t seq,
  705. rxrpc_serial_t serial, u8 flags, u8 anno),
  706. TP_ARGS(call, seq, serial, flags, anno),
  707. TP_STRUCT__entry(
  708. __field(unsigned int, call )
  709. __field(rxrpc_seq_t, seq )
  710. __field(rxrpc_serial_t, serial )
  711. __field(u8, flags )
  712. __field(u8, anno )
  713. ),
  714. TP_fast_assign(
  715. __entry->call = call;
  716. __entry->seq = seq;
  717. __entry->serial = serial;
  718. __entry->flags = flags;
  719. __entry->anno = anno;
  720. ),
  721. TP_printk("c=%08x DATA %08x q=%08x fl=%02x a=%02x",
  722. __entry->call,
  723. __entry->serial,
  724. __entry->seq,
  725. __entry->flags,
  726. __entry->anno)
  727. );
  728. TRACE_EVENT(rxrpc_rx_ack,
  729. TP_PROTO(struct rxrpc_call *call,
  730. rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
  731. rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
  732. TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
  733. TP_STRUCT__entry(
  734. __field(unsigned int, call )
  735. __field(rxrpc_serial_t, serial )
  736. __field(rxrpc_serial_t, ack_serial )
  737. __field(rxrpc_seq_t, first )
  738. __field(rxrpc_seq_t, prev )
  739. __field(u8, reason )
  740. __field(u8, n_acks )
  741. ),
  742. TP_fast_assign(
  743. __entry->call = call->debug_id;
  744. __entry->serial = serial;
  745. __entry->ack_serial = ack_serial;
  746. __entry->first = first;
  747. __entry->prev = prev;
  748. __entry->reason = reason;
  749. __entry->n_acks = n_acks;
  750. ),
  751. TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
  752. __entry->call,
  753. __entry->serial,
  754. __print_symbolic(__entry->reason, rxrpc_ack_names),
  755. __entry->ack_serial,
  756. __entry->first,
  757. __entry->prev,
  758. __entry->n_acks)
  759. );
  760. TRACE_EVENT(rxrpc_rx_abort,
  761. TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
  762. u32 abort_code),
  763. TP_ARGS(call, serial, abort_code),
  764. TP_STRUCT__entry(
  765. __field(unsigned int, call )
  766. __field(rxrpc_serial_t, serial )
  767. __field(u32, abort_code )
  768. ),
  769. TP_fast_assign(
  770. __entry->call = call->debug_id;
  771. __entry->serial = serial;
  772. __entry->abort_code = abort_code;
  773. ),
  774. TP_printk("c=%08x ABORT %08x ac=%d",
  775. __entry->call,
  776. __entry->serial,
  777. __entry->abort_code)
  778. );
  779. TRACE_EVENT(rxrpc_rx_rwind_change,
  780. TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
  781. u32 rwind, bool wake),
  782. TP_ARGS(call, serial, rwind, wake),
  783. TP_STRUCT__entry(
  784. __field(unsigned int, call )
  785. __field(rxrpc_serial_t, serial )
  786. __field(u32, rwind )
  787. __field(bool, wake )
  788. ),
  789. TP_fast_assign(
  790. __entry->call = call->debug_id;
  791. __entry->serial = serial;
  792. __entry->rwind = rwind;
  793. __entry->wake = wake;
  794. ),
  795. TP_printk("c=%08x %08x rw=%u%s",
  796. __entry->call,
  797. __entry->serial,
  798. __entry->rwind,
  799. __entry->wake ? " wake" : "")
  800. );
  801. TRACE_EVENT(rxrpc_tx_packet,
  802. TP_PROTO(unsigned int call_id, struct rxrpc_wire_header *whdr,
  803. enum rxrpc_tx_point where),
  804. TP_ARGS(call_id, whdr, where),
  805. TP_STRUCT__entry(
  806. __field(unsigned int, call )
  807. __field(enum rxrpc_tx_point, where )
  808. __field_struct(struct rxrpc_wire_header, whdr )
  809. ),
  810. TP_fast_assign(
  811. __entry->call = call_id;
  812. memcpy(&__entry->whdr, whdr, sizeof(__entry->whdr));
  813. __entry->where = where;
  814. ),
  815. TP_printk("c=%08x %08x:%08x:%08x:%04x %08x %08x %02x %02x %s %s",
  816. __entry->call,
  817. ntohl(__entry->whdr.epoch),
  818. ntohl(__entry->whdr.cid),
  819. ntohl(__entry->whdr.callNumber),
  820. ntohs(__entry->whdr.serviceId),
  821. ntohl(__entry->whdr.serial),
  822. ntohl(__entry->whdr.seq),
  823. __entry->whdr.type, __entry->whdr.flags,
  824. __entry->whdr.type <= 15 ?
  825. __print_symbolic(__entry->whdr.type, rxrpc_pkts) : "?UNK",
  826. __print_symbolic(__entry->where, rxrpc_tx_points))
  827. );
  828. TRACE_EVENT(rxrpc_tx_data,
  829. TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
  830. rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
  831. TP_ARGS(call, seq, serial, flags, retrans, lose),
  832. TP_STRUCT__entry(
  833. __field(unsigned int, call )
  834. __field(rxrpc_seq_t, seq )
  835. __field(rxrpc_serial_t, serial )
  836. __field(u32, cid )
  837. __field(u32, call_id )
  838. __field(u8, flags )
  839. __field(bool, retrans )
  840. __field(bool, lose )
  841. ),
  842. TP_fast_assign(
  843. __entry->call = call->debug_id;
  844. __entry->cid = call->cid;
  845. __entry->call_id = call->call_id;
  846. __entry->seq = seq;
  847. __entry->serial = serial;
  848. __entry->flags = flags;
  849. __entry->retrans = retrans;
  850. __entry->lose = lose;
  851. ),
  852. TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
  853. __entry->call,
  854. __entry->cid,
  855. __entry->call_id,
  856. __entry->serial,
  857. __entry->seq,
  858. __entry->flags,
  859. __entry->retrans ? " *RETRANS*" : "",
  860. __entry->lose ? " *LOSE*" : "")
  861. );
  862. TRACE_EVENT(rxrpc_tx_ack,
  863. TP_PROTO(unsigned int call, rxrpc_serial_t serial,
  864. rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
  865. u8 reason, u8 n_acks),
  866. TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
  867. TP_STRUCT__entry(
  868. __field(unsigned int, call )
  869. __field(rxrpc_serial_t, serial )
  870. __field(rxrpc_seq_t, ack_first )
  871. __field(rxrpc_serial_t, ack_serial )
  872. __field(u8, reason )
  873. __field(u8, n_acks )
  874. ),
  875. TP_fast_assign(
  876. __entry->call = call;
  877. __entry->serial = serial;
  878. __entry->ack_first = ack_first;
  879. __entry->ack_serial = ack_serial;
  880. __entry->reason = reason;
  881. __entry->n_acks = n_acks;
  882. ),
  883. TP_printk(" c=%08x ACK %08x %s f=%08x r=%08x n=%u",
  884. __entry->call,
  885. __entry->serial,
  886. __print_symbolic(__entry->reason, rxrpc_ack_names),
  887. __entry->ack_first,
  888. __entry->ack_serial,
  889. __entry->n_acks)
  890. );
  891. TRACE_EVENT(rxrpc_receive,
  892. TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
  893. rxrpc_serial_t serial, rxrpc_seq_t seq),
  894. TP_ARGS(call, why, serial, seq),
  895. TP_STRUCT__entry(
  896. __field(unsigned int, call )
  897. __field(enum rxrpc_receive_trace, why )
  898. __field(rxrpc_serial_t, serial )
  899. __field(rxrpc_seq_t, seq )
  900. __field(rxrpc_seq_t, hard_ack )
  901. __field(rxrpc_seq_t, top )
  902. ),
  903. TP_fast_assign(
  904. __entry->call = call->debug_id;
  905. __entry->why = why;
  906. __entry->serial = serial;
  907. __entry->seq = seq;
  908. __entry->hard_ack = call->rx_hard_ack;
  909. __entry->top = call->rx_top;
  910. ),
  911. TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
  912. __entry->call,
  913. __print_symbolic(__entry->why, rxrpc_receive_traces),
  914. __entry->serial,
  915. __entry->seq,
  916. __entry->hard_ack,
  917. __entry->top)
  918. );
  919. TRACE_EVENT(rxrpc_recvmsg,
  920. TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
  921. rxrpc_seq_t seq, unsigned int offset, unsigned int len,
  922. int ret),
  923. TP_ARGS(call, why, seq, offset, len, ret),
  924. TP_STRUCT__entry(
  925. __field(unsigned int, call )
  926. __field(enum rxrpc_recvmsg_trace, why )
  927. __field(rxrpc_seq_t, seq )
  928. __field(unsigned int, offset )
  929. __field(unsigned int, len )
  930. __field(int, ret )
  931. ),
  932. TP_fast_assign(
  933. __entry->call = call ? call->debug_id : 0;
  934. __entry->why = why;
  935. __entry->seq = seq;
  936. __entry->offset = offset;
  937. __entry->len = len;
  938. __entry->ret = ret;
  939. ),
  940. TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
  941. __entry->call,
  942. __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
  943. __entry->seq,
  944. __entry->offset,
  945. __entry->len,
  946. __entry->ret)
  947. );
  948. TRACE_EVENT(rxrpc_rtt_tx,
  949. TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
  950. rxrpc_serial_t send_serial),
  951. TP_ARGS(call, why, send_serial),
  952. TP_STRUCT__entry(
  953. __field(unsigned int, call )
  954. __field(enum rxrpc_rtt_tx_trace, why )
  955. __field(rxrpc_serial_t, send_serial )
  956. ),
  957. TP_fast_assign(
  958. __entry->call = call->debug_id;
  959. __entry->why = why;
  960. __entry->send_serial = send_serial;
  961. ),
  962. TP_printk("c=%08x %s sr=%08x",
  963. __entry->call,
  964. __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
  965. __entry->send_serial)
  966. );
  967. TRACE_EVENT(rxrpc_rtt_rx,
  968. TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
  969. rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
  970. s64 rtt, u8 nr, s64 avg),
  971. TP_ARGS(call, why, send_serial, resp_serial, rtt, nr, avg),
  972. TP_STRUCT__entry(
  973. __field(unsigned int, call )
  974. __field(enum rxrpc_rtt_rx_trace, why )
  975. __field(u8, nr )
  976. __field(rxrpc_serial_t, send_serial )
  977. __field(rxrpc_serial_t, resp_serial )
  978. __field(s64, rtt )
  979. __field(u64, avg )
  980. ),
  981. TP_fast_assign(
  982. __entry->call = call->debug_id;
  983. __entry->why = why;
  984. __entry->send_serial = send_serial;
  985. __entry->resp_serial = resp_serial;
  986. __entry->rtt = rtt;
  987. __entry->nr = nr;
  988. __entry->avg = avg;
  989. ),
  990. TP_printk("c=%08x %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
  991. __entry->call,
  992. __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
  993. __entry->send_serial,
  994. __entry->resp_serial,
  995. __entry->rtt,
  996. __entry->nr,
  997. __entry->avg)
  998. );
  999. TRACE_EVENT(rxrpc_timer,
  1000. TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
  1001. unsigned long now),
  1002. TP_ARGS(call, why, now),
  1003. TP_STRUCT__entry(
  1004. __field(unsigned int, call )
  1005. __field(enum rxrpc_timer_trace, why )
  1006. __field(long, now )
  1007. __field(long, ack_at )
  1008. __field(long, ack_lost_at )
  1009. __field(long, resend_at )
  1010. __field(long, ping_at )
  1011. __field(long, expect_rx_by )
  1012. __field(long, expect_req_by )
  1013. __field(long, expect_term_by )
  1014. __field(long, timer )
  1015. ),
  1016. TP_fast_assign(
  1017. __entry->call = call->debug_id;
  1018. __entry->why = why;
  1019. __entry->now = now;
  1020. __entry->ack_at = call->ack_at;
  1021. __entry->ack_lost_at = call->ack_lost_at;
  1022. __entry->resend_at = call->resend_at;
  1023. __entry->expect_rx_by = call->expect_rx_by;
  1024. __entry->expect_req_by = call->expect_req_by;
  1025. __entry->expect_term_by = call->expect_term_by;
  1026. __entry->timer = call->timer.expires;
  1027. ),
  1028. TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
  1029. __entry->call,
  1030. __print_symbolic(__entry->why, rxrpc_timer_traces),
  1031. __entry->ack_at - __entry->now,
  1032. __entry->ack_lost_at - __entry->now,
  1033. __entry->resend_at - __entry->now,
  1034. __entry->expect_rx_by - __entry->now,
  1035. __entry->expect_req_by - __entry->now,
  1036. __entry->expect_term_by - __entry->now,
  1037. __entry->timer - __entry->now)
  1038. );
  1039. TRACE_EVENT(rxrpc_rx_lose,
  1040. TP_PROTO(struct rxrpc_skb_priv *sp),
  1041. TP_ARGS(sp),
  1042. TP_STRUCT__entry(
  1043. __field_struct(struct rxrpc_host_header, hdr )
  1044. ),
  1045. TP_fast_assign(
  1046. memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
  1047. ),
  1048. TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
  1049. __entry->hdr.epoch, __entry->hdr.cid,
  1050. __entry->hdr.callNumber, __entry->hdr.serviceId,
  1051. __entry->hdr.serial, __entry->hdr.seq,
  1052. __entry->hdr.type, __entry->hdr.flags,
  1053. __entry->hdr.type <= 15 ?
  1054. __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
  1055. );
  1056. TRACE_EVENT(rxrpc_propose_ack,
  1057. TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
  1058. u8 ack_reason, rxrpc_serial_t serial, bool immediate,
  1059. bool background, enum rxrpc_propose_ack_outcome outcome),
  1060. TP_ARGS(call, why, ack_reason, serial, immediate, background,
  1061. outcome),
  1062. TP_STRUCT__entry(
  1063. __field(unsigned int, call )
  1064. __field(enum rxrpc_propose_ack_trace, why )
  1065. __field(rxrpc_serial_t, serial )
  1066. __field(u8, ack_reason )
  1067. __field(bool, immediate )
  1068. __field(bool, background )
  1069. __field(enum rxrpc_propose_ack_outcome, outcome )
  1070. ),
  1071. TP_fast_assign(
  1072. __entry->call = call->debug_id;
  1073. __entry->why = why;
  1074. __entry->serial = serial;
  1075. __entry->ack_reason = ack_reason;
  1076. __entry->immediate = immediate;
  1077. __entry->background = background;
  1078. __entry->outcome = outcome;
  1079. ),
  1080. TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
  1081. __entry->call,
  1082. __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
  1083. __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
  1084. __entry->serial,
  1085. __entry->immediate,
  1086. __entry->background,
  1087. __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
  1088. );
  1089. TRACE_EVENT(rxrpc_retransmit,
  1090. TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
  1091. s64 expiry),
  1092. TP_ARGS(call, seq, annotation, expiry),
  1093. TP_STRUCT__entry(
  1094. __field(unsigned int, call )
  1095. __field(rxrpc_seq_t, seq )
  1096. __field(u8, annotation )
  1097. __field(s64, expiry )
  1098. ),
  1099. TP_fast_assign(
  1100. __entry->call = call->debug_id;
  1101. __entry->seq = seq;
  1102. __entry->annotation = annotation;
  1103. __entry->expiry = expiry;
  1104. ),
  1105. TP_printk("c=%08x q=%x a=%02x xp=%lld",
  1106. __entry->call,
  1107. __entry->seq,
  1108. __entry->annotation,
  1109. __entry->expiry)
  1110. );
  1111. TRACE_EVENT(rxrpc_congest,
  1112. TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
  1113. rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
  1114. TP_ARGS(call, summary, ack_serial, change),
  1115. TP_STRUCT__entry(
  1116. __field(unsigned int, call )
  1117. __field(enum rxrpc_congest_change, change )
  1118. __field(rxrpc_seq_t, hard_ack )
  1119. __field(rxrpc_seq_t, top )
  1120. __field(rxrpc_seq_t, lowest_nak )
  1121. __field(rxrpc_serial_t, ack_serial )
  1122. __field_struct(struct rxrpc_ack_summary, sum )
  1123. ),
  1124. TP_fast_assign(
  1125. __entry->call = call->debug_id;
  1126. __entry->change = change;
  1127. __entry->hard_ack = call->tx_hard_ack;
  1128. __entry->top = call->tx_top;
  1129. __entry->lowest_nak = call->acks_lowest_nak;
  1130. __entry->ack_serial = ack_serial;
  1131. memcpy(&__entry->sum, summary, sizeof(__entry->sum));
  1132. ),
  1133. TP_printk("c=%08x r=%08x %s q=%08x %s cw=%u ss=%u nr=%u,%u nw=%u,%u r=%u b=%u u=%u d=%u l=%x%s%s%s",
  1134. __entry->call,
  1135. __entry->ack_serial,
  1136. __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
  1137. __entry->hard_ack,
  1138. __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
  1139. __entry->sum.cwnd,
  1140. __entry->sum.ssthresh,
  1141. __entry->sum.nr_acks, __entry->sum.nr_nacks,
  1142. __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
  1143. __entry->sum.nr_rot_new_acks,
  1144. __entry->top - __entry->hard_ack,
  1145. __entry->sum.cumulative_acks,
  1146. __entry->sum.dup_acks,
  1147. __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
  1148. __print_symbolic(__entry->change, rxrpc_congest_changes),
  1149. __entry->sum.retrans_timeo ? " rTxTo" : "")
  1150. );
  1151. TRACE_EVENT(rxrpc_disconnect_call,
  1152. TP_PROTO(struct rxrpc_call *call),
  1153. TP_ARGS(call),
  1154. TP_STRUCT__entry(
  1155. __field(unsigned int, call )
  1156. __field(u32, abort_code )
  1157. ),
  1158. TP_fast_assign(
  1159. __entry->call = call->debug_id;
  1160. __entry->abort_code = call->abort_code;
  1161. ),
  1162. TP_printk("c=%08x ab=%08x",
  1163. __entry->call,
  1164. __entry->abort_code)
  1165. );
  1166. TRACE_EVENT(rxrpc_improper_term,
  1167. TP_PROTO(struct rxrpc_call *call),
  1168. TP_ARGS(call),
  1169. TP_STRUCT__entry(
  1170. __field(unsigned int, call )
  1171. __field(u32, abort_code )
  1172. ),
  1173. TP_fast_assign(
  1174. __entry->call = call->debug_id;
  1175. __entry->abort_code = call->abort_code;
  1176. ),
  1177. TP_printk("c=%08x ab=%08x",
  1178. __entry->call,
  1179. __entry->abort_code)
  1180. );
  1181. TRACE_EVENT(rxrpc_rx_eproto,
  1182. TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
  1183. const char *why),
  1184. TP_ARGS(call, serial, why),
  1185. TP_STRUCT__entry(
  1186. __field(unsigned int, call )
  1187. __field(rxrpc_serial_t, serial )
  1188. __field(const char *, why )
  1189. ),
  1190. TP_fast_assign(
  1191. __entry->call = call ? call->debug_id : 0;
  1192. __entry->serial = serial;
  1193. __entry->why = why;
  1194. ),
  1195. TP_printk("c=%08x EPROTO %08x %s",
  1196. __entry->call,
  1197. __entry->serial,
  1198. __entry->why)
  1199. );
  1200. TRACE_EVENT(rxrpc_connect_call,
  1201. TP_PROTO(struct rxrpc_call *call),
  1202. TP_ARGS(call),
  1203. TP_STRUCT__entry(
  1204. __field(unsigned int, call )
  1205. __field(unsigned long, user_call_ID )
  1206. __field(u32, cid )
  1207. __field(u32, call_id )
  1208. ),
  1209. TP_fast_assign(
  1210. __entry->call = call->debug_id;
  1211. __entry->user_call_ID = call->user_call_ID;
  1212. __entry->cid = call->cid;
  1213. __entry->call_id = call->call_id;
  1214. ),
  1215. TP_printk("c=%08x u=%p %08x:%08x",
  1216. __entry->call,
  1217. (void *)__entry->user_call_ID,
  1218. __entry->cid,
  1219. __entry->call_id)
  1220. );
  1221. TRACE_EVENT(rxrpc_resend,
  1222. TP_PROTO(struct rxrpc_call *call, int ix),
  1223. TP_ARGS(call, ix),
  1224. TP_STRUCT__entry(
  1225. __field(unsigned int, call )
  1226. __field(int, ix )
  1227. __array(u8, anno, 64 )
  1228. ),
  1229. TP_fast_assign(
  1230. __entry->call = call->debug_id;
  1231. __entry->ix = ix;
  1232. memcpy(__entry->anno, call->rxtx_annotations, 64);
  1233. ),
  1234. TP_printk("c=%08x ix=%u a=%64phN",
  1235. __entry->call,
  1236. __entry->ix,
  1237. __entry->anno)
  1238. );
  1239. TRACE_EVENT(rxrpc_rx_icmp,
  1240. TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee,
  1241. struct sockaddr_rxrpc *srx),
  1242. TP_ARGS(peer, ee, srx),
  1243. TP_STRUCT__entry(
  1244. __field(unsigned int, peer )
  1245. __field_struct(struct sock_extended_err, ee )
  1246. __field_struct(struct sockaddr_rxrpc, srx )
  1247. ),
  1248. TP_fast_assign(
  1249. __entry->peer = peer->debug_id;
  1250. memcpy(&__entry->ee, ee, sizeof(__entry->ee));
  1251. memcpy(&__entry->srx, srx, sizeof(__entry->srx));
  1252. ),
  1253. TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp",
  1254. __entry->peer,
  1255. __entry->ee.ee_origin,
  1256. __entry->ee.ee_type,
  1257. __entry->ee.ee_code,
  1258. __entry->ee.ee_info,
  1259. __entry->ee.ee_data,
  1260. __entry->ee.ee_errno,
  1261. &__entry->srx.transport)
  1262. );
  1263. TRACE_EVENT(rxrpc_tx_fail,
  1264. TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
  1265. enum rxrpc_tx_point where),
  1266. TP_ARGS(debug_id, serial, ret, where),
  1267. TP_STRUCT__entry(
  1268. __field(unsigned int, debug_id )
  1269. __field(rxrpc_serial_t, serial )
  1270. __field(int, ret )
  1271. __field(enum rxrpc_tx_point, where )
  1272. ),
  1273. TP_fast_assign(
  1274. __entry->debug_id = debug_id;
  1275. __entry->serial = serial;
  1276. __entry->ret = ret;
  1277. __entry->where = where;
  1278. ),
  1279. TP_printk("c=%08x r=%x ret=%d %s",
  1280. __entry->debug_id,
  1281. __entry->serial,
  1282. __entry->ret,
  1283. __print_symbolic(__entry->where, rxrpc_tx_points))
  1284. );
  1285. TRACE_EVENT(rxrpc_call_reset,
  1286. TP_PROTO(struct rxrpc_call *call),
  1287. TP_ARGS(call),
  1288. TP_STRUCT__entry(
  1289. __field(unsigned int, debug_id )
  1290. __field(u32, cid )
  1291. __field(u32, call_id )
  1292. __field(rxrpc_serial_t, call_serial )
  1293. __field(rxrpc_serial_t, conn_serial )
  1294. __field(rxrpc_seq_t, tx_seq )
  1295. __field(rxrpc_seq_t, rx_seq )
  1296. ),
  1297. TP_fast_assign(
  1298. __entry->debug_id = call->debug_id;
  1299. __entry->cid = call->cid;
  1300. __entry->call_id = call->call_id;
  1301. __entry->call_serial = call->rx_serial;
  1302. __entry->conn_serial = call->conn->hi_serial;
  1303. __entry->tx_seq = call->tx_hard_ack;
  1304. __entry->rx_seq = call->ackr_seen;
  1305. ),
  1306. TP_printk("c=%08x %08x:%08x r=%08x/%08x tx=%08x rx=%08x",
  1307. __entry->debug_id,
  1308. __entry->cid, __entry->call_id,
  1309. __entry->call_serial, __entry->conn_serial,
  1310. __entry->tx_seq, __entry->rx_seq)
  1311. );
  1312. TRACE_EVENT(rxrpc_notify_socket,
  1313. TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial),
  1314. TP_ARGS(debug_id, serial),
  1315. TP_STRUCT__entry(
  1316. __field(unsigned int, debug_id )
  1317. __field(rxrpc_serial_t, serial )
  1318. ),
  1319. TP_fast_assign(
  1320. __entry->debug_id = debug_id;
  1321. __entry->serial = serial;
  1322. ),
  1323. TP_printk("c=%08x r=%08x",
  1324. __entry->debug_id,
  1325. __entry->serial)
  1326. );
  1327. #endif /* _TRACE_RXRPC_H */
  1328. /* This part must be outside protection */
  1329. #include <trace/define_trace.h>