rxrpc.h 37 KB

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