1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* AF_RXRPC tracepoints
4 * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
8 #define TRACE_SYSTEM rxrpc
10 #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_RXRPC_H
13 #include <linux/tracepoint.h>
14 #include <linux/errqueue.h>
17 * Declare tracing information enums and their string mappings for display.
19 #define rxrpc_abort_reasons \
21 EM(afs_abort_general_error, "afs-error") \
22 EM(afs_abort_interrupted, "afs-intr") \
23 EM(afs_abort_oom, "afs-oom") \
24 EM(afs_abort_op_not_supported, "afs-op-notsupp") \
25 EM(afs_abort_probeuuid_negative, "afs-probeuuid-neg") \
26 EM(afs_abort_send_data_error, "afs-send-data") \
27 EM(afs_abort_unmarshal_error, "afs-unmarshal") \
29 EM(rxperf_abort_general_error, "rxperf-error") \
30 EM(rxperf_abort_oom, "rxperf-oom") \
31 EM(rxperf_abort_op_not_supported, "rxperf-op-notsupp") \
32 EM(rxperf_abort_unmarshal_error, "rxperf-unmarshal") \
33 /* RxKAD security errors */ \
34 EM(rxkad_abort_1_short_check, "rxkad1-short-check") \
35 EM(rxkad_abort_1_short_data, "rxkad1-short-data") \
36 EM(rxkad_abort_1_short_encdata, "rxkad1-short-encdata") \
37 EM(rxkad_abort_1_short_header, "rxkad1-short-hdr") \
38 EM(rxkad_abort_2_short_check, "rxkad2-short-check") \
39 EM(rxkad_abort_2_short_data, "rxkad2-short-data") \
40 EM(rxkad_abort_2_short_header, "rxkad2-short-hdr") \
41 EM(rxkad_abort_2_short_len, "rxkad2-short-len") \
42 EM(rxkad_abort_bad_checksum, "rxkad2-bad-cksum") \
43 EM(rxkad_abort_chall_key_expired, "rxkad-chall-key-exp") \
44 EM(rxkad_abort_chall_level, "rxkad-chall-level") \
45 EM(rxkad_abort_chall_no_key, "rxkad-chall-nokey") \
46 EM(rxkad_abort_chall_short, "rxkad-chall-short") \
47 EM(rxkad_abort_chall_version, "rxkad-chall-version") \
48 EM(rxkad_abort_resp_bad_callid, "rxkad-resp-bad-callid") \
49 EM(rxkad_abort_resp_bad_checksum, "rxkad-resp-bad-cksum") \
50 EM(rxkad_abort_resp_bad_param, "rxkad-resp-bad-param") \
51 EM(rxkad_abort_resp_call_ctr, "rxkad-resp-call-ctr") \
52 EM(rxkad_abort_resp_call_state, "rxkad-resp-call-state") \
53 EM(rxkad_abort_resp_key_expired, "rxkad-resp-key-exp") \
54 EM(rxkad_abort_resp_key_rejected, "rxkad-resp-key-rej") \
55 EM(rxkad_abort_resp_level, "rxkad-resp-level") \
56 EM(rxkad_abort_resp_nokey, "rxkad-resp-nokey") \
57 EM(rxkad_abort_resp_ooseq, "rxkad-resp-ooseq") \
58 EM(rxkad_abort_resp_short, "rxkad-resp-short") \
59 EM(rxkad_abort_resp_short_tkt, "rxkad-resp-short-tkt") \
60 EM(rxkad_abort_resp_tkt_aname, "rxkad-resp-tk-aname") \
61 EM(rxkad_abort_resp_tkt_expired, "rxkad-resp-tk-exp") \
62 EM(rxkad_abort_resp_tkt_future, "rxkad-resp-tk-future") \
63 EM(rxkad_abort_resp_tkt_inst, "rxkad-resp-tk-inst") \
64 EM(rxkad_abort_resp_tkt_len, "rxkad-resp-tk-len") \
65 EM(rxkad_abort_resp_tkt_realm, "rxkad-resp-tk-realm") \
66 EM(rxkad_abort_resp_tkt_short, "rxkad-resp-tk-short") \
67 EM(rxkad_abort_resp_tkt_sinst, "rxkad-resp-tk-sinst") \
68 EM(rxkad_abort_resp_tkt_sname, "rxkad-resp-tk-sname") \
69 EM(rxkad_abort_resp_unknown_tkt, "rxkad-resp-unknown-tkt") \
70 EM(rxkad_abort_resp_version, "rxkad-resp-version") \
72 EM(rxrpc_abort_call_improper_term, "call-improper-term") \
73 EM(rxrpc_abort_call_reset, "call-reset") \
74 EM(rxrpc_abort_call_sendmsg, "call-sendmsg") \
75 EM(rxrpc_abort_call_sock_release, "call-sock-rel") \
76 EM(rxrpc_abort_call_sock_release_tba, "call-sock-rel-tba") \
77 EM(rxrpc_abort_call_timeout, "call-timeout") \
78 EM(rxrpc_abort_no_service_key, "no-serv-key") \
79 EM(rxrpc_abort_nomem, "nomem") \
80 EM(rxrpc_abort_service_not_offered, "serv-not-offered") \
81 EM(rxrpc_abort_shut_down, "shut-down") \
82 EM(rxrpc_abort_unsupported_security, "unsup-sec") \
83 EM(rxrpc_badmsg_bad_abort, "bad-abort") \
84 EM(rxrpc_badmsg_bad_jumbo, "bad-jumbo") \
85 EM(rxrpc_badmsg_short_ack, "short-ack") \
86 EM(rxrpc_badmsg_short_ack_info, "short-ack-info") \
87 EM(rxrpc_badmsg_short_hdr, "short-hdr") \
88 EM(rxrpc_badmsg_unsupported_packet, "unsup-pkt") \
89 EM(rxrpc_badmsg_zero_call, "zero-call") \
90 EM(rxrpc_badmsg_zero_seq, "zero-seq") \
91 EM(rxrpc_badmsg_zero_service, "zero-service") \
92 EM(rxrpc_eproto_ackr_outside_window, "ackr-out-win") \
93 EM(rxrpc_eproto_ackr_sack_overflow, "ackr-sack-over") \
94 EM(rxrpc_eproto_ackr_short_sack, "ackr-short-sack") \
95 EM(rxrpc_eproto_ackr_zero, "ackr-zero") \
96 EM(rxrpc_eproto_bad_upgrade, "bad-upgrade") \
97 EM(rxrpc_eproto_data_after_last, "data-after-last") \
98 EM(rxrpc_eproto_different_last, "diff-last") \
99 EM(rxrpc_eproto_early_reply, "early-reply") \
100 EM(rxrpc_eproto_improper_term, "improper-term") \
101 EM(rxrpc_eproto_no_client_call, "no-cl-call") \
102 EM(rxrpc_eproto_no_client_conn, "no-cl-conn") \
103 EM(rxrpc_eproto_no_service_call, "no-sv-call") \
104 EM(rxrpc_eproto_reupgrade, "re-upgrade") \
105 EM(rxrpc_eproto_rxnull_challenge, "rxnull-chall") \
106 EM(rxrpc_eproto_rxnull_response, "rxnull-resp") \
107 EM(rxrpc_eproto_tx_rot_last, "tx-rot-last") \
108 EM(rxrpc_eproto_unexpected_ack, "unex-ack") \
109 EM(rxrpc_eproto_unexpected_ackall, "unex-ackall") \
110 EM(rxrpc_eproto_unexpected_implicit_end, "unex-impl-end") \
111 EM(rxrpc_eproto_unexpected_reply, "unex-reply") \
112 EM(rxrpc_eproto_wrong_security, "wrong-sec") \
113 EM(rxrpc_recvmsg_excess_data, "recvmsg-excess") \
114 EM(rxrpc_recvmsg_short_data, "recvmsg-short") \
115 E_(rxrpc_sendmsg_late_send, "sendmsg-late")
117 #define rxrpc_call_poke_traces \
118 EM(rxrpc_call_poke_abort, "Abort") \
119 EM(rxrpc_call_poke_complete, "Compl") \
120 EM(rxrpc_call_poke_error, "Error") \
121 EM(rxrpc_call_poke_idle, "Idle") \
122 EM(rxrpc_call_poke_start, "Start") \
123 EM(rxrpc_call_poke_timer, "Timer") \
124 E_(rxrpc_call_poke_timer_now, "Timer-now")
126 #define rxrpc_skb_traces \
127 EM(rxrpc_skb_eaten_by_unshare, "ETN unshare ") \
128 EM(rxrpc_skb_eaten_by_unshare_nomem, "ETN unshar-nm") \
129 EM(rxrpc_skb_get_conn_secured, "GET conn-secd") \
130 EM(rxrpc_skb_get_conn_work, "GET conn-work") \
131 EM(rxrpc_skb_get_local_work, "GET locl-work") \
132 EM(rxrpc_skb_get_reject_work, "GET rej-work ") \
133 EM(rxrpc_skb_get_to_recvmsg, "GET to-recv ") \
134 EM(rxrpc_skb_get_to_recvmsg_oos, "GET to-recv-o") \
135 EM(rxrpc_skb_new_encap_rcv, "NEW encap-rcv") \
136 EM(rxrpc_skb_new_error_report, "NEW error-rpt") \
137 EM(rxrpc_skb_new_jumbo_subpacket, "NEW jumbo-sub") \
138 EM(rxrpc_skb_new_unshared, "NEW unshared ") \
139 EM(rxrpc_skb_put_conn_secured, "PUT conn-secd") \
140 EM(rxrpc_skb_put_conn_work, "PUT conn-work") \
141 EM(rxrpc_skb_put_error_report, "PUT error-rep") \
142 EM(rxrpc_skb_put_input, "PUT input ") \
143 EM(rxrpc_skb_put_jumbo_subpacket, "PUT jumbo-sub") \
144 EM(rxrpc_skb_put_purge, "PUT purge ") \
145 EM(rxrpc_skb_put_rotate, "PUT rotate ") \
146 EM(rxrpc_skb_put_unknown, "PUT unknown ") \
147 EM(rxrpc_skb_see_conn_work, "SEE conn-work") \
148 EM(rxrpc_skb_see_recvmsg, "SEE recvmsg ") \
149 EM(rxrpc_skb_see_reject, "SEE reject ") \
150 EM(rxrpc_skb_see_rotate, "SEE rotate ") \
151 E_(rxrpc_skb_see_version, "SEE version ")
153 #define rxrpc_local_traces \
154 EM(rxrpc_local_free, "FREE ") \
155 EM(rxrpc_local_get_call, "GET call ") \
156 EM(rxrpc_local_get_client_conn, "GET conn-cln") \
157 EM(rxrpc_local_get_for_use, "GET for-use ") \
158 EM(rxrpc_local_get_peer, "GET peer ") \
159 EM(rxrpc_local_get_prealloc_conn, "GET conn-pre") \
160 EM(rxrpc_local_new, "NEW ") \
161 EM(rxrpc_local_put_bind, "PUT bind ") \
162 EM(rxrpc_local_put_call, "PUT call ") \
163 EM(rxrpc_local_put_for_use, "PUT for-use ") \
164 EM(rxrpc_local_put_kill_conn, "PUT conn-kil") \
165 EM(rxrpc_local_put_peer, "PUT peer ") \
166 EM(rxrpc_local_put_prealloc_peer, "PUT peer-pre") \
167 EM(rxrpc_local_put_release_sock, "PUT rel-sock") \
168 EM(rxrpc_local_stop, "STOP ") \
169 EM(rxrpc_local_stopped, "STOPPED ") \
170 EM(rxrpc_local_unuse_bind, "UNU bind ") \
171 EM(rxrpc_local_unuse_conn_work, "UNU conn-wrk") \
172 EM(rxrpc_local_unuse_peer_keepalive, "UNU peer-kpa") \
173 EM(rxrpc_local_unuse_release_sock, "UNU rel-sock") \
174 EM(rxrpc_local_use_conn_work, "USE conn-wrk") \
175 EM(rxrpc_local_use_lookup, "USE lookup ") \
176 E_(rxrpc_local_use_peer_keepalive, "USE peer-kpa")
178 #define rxrpc_peer_traces \
179 EM(rxrpc_peer_free, "FREE ") \
180 EM(rxrpc_peer_get_accept, "GET accept ") \
181 EM(rxrpc_peer_get_bundle, "GET bundle ") \
182 EM(rxrpc_peer_get_client_conn, "GET cln-conn") \
183 EM(rxrpc_peer_get_input, "GET input ") \
184 EM(rxrpc_peer_get_input_error, "GET inpt-err") \
185 EM(rxrpc_peer_get_keepalive, "GET keepaliv") \
186 EM(rxrpc_peer_get_lookup_client, "GET look-cln") \
187 EM(rxrpc_peer_get_service_conn, "GET srv-conn") \
188 EM(rxrpc_peer_new_client, "NEW client ") \
189 EM(rxrpc_peer_new_prealloc, "NEW prealloc") \
190 EM(rxrpc_peer_put_bundle, "PUT bundle ") \
191 EM(rxrpc_peer_put_call, "PUT call ") \
192 EM(rxrpc_peer_put_conn, "PUT conn ") \
193 EM(rxrpc_peer_put_input, "PUT input ") \
194 EM(rxrpc_peer_put_input_error, "PUT inpt-err") \
195 E_(rxrpc_peer_put_keepalive, "PUT keepaliv")
197 #define rxrpc_bundle_traces \
198 EM(rxrpc_bundle_free, "FREE ") \
199 EM(rxrpc_bundle_get_client_call, "GET clt-call") \
200 EM(rxrpc_bundle_get_client_conn, "GET clt-conn") \
201 EM(rxrpc_bundle_get_service_conn, "GET svc-conn") \
202 EM(rxrpc_bundle_put_call, "PUT call ") \
203 EM(rxrpc_bundle_put_conn, "PUT conn ") \
204 EM(rxrpc_bundle_put_discard, "PUT discard ") \
205 E_(rxrpc_bundle_new, "NEW ")
207 #define rxrpc_conn_traces \
208 EM(rxrpc_conn_free, "FREE ") \
209 EM(rxrpc_conn_get_activate_call, "GET act-call") \
210 EM(rxrpc_conn_get_call_input, "GET inp-call") \
211 EM(rxrpc_conn_get_conn_input, "GET inp-conn") \
212 EM(rxrpc_conn_get_idle, "GET idle ") \
213 EM(rxrpc_conn_get_poke_abort, "GET pk-abort") \
214 EM(rxrpc_conn_get_poke_timer, "GET poke ") \
215 EM(rxrpc_conn_get_service_conn, "GET svc-conn") \
216 EM(rxrpc_conn_new_client, "NEW client ") \
217 EM(rxrpc_conn_new_service, "NEW service ") \
218 EM(rxrpc_conn_put_call, "PUT call ") \
219 EM(rxrpc_conn_put_call_input, "PUT inp-call") \
220 EM(rxrpc_conn_put_conn_input, "PUT inp-conn") \
221 EM(rxrpc_conn_put_discard_idle, "PUT disc-idl") \
222 EM(rxrpc_conn_put_local_dead, "PUT loc-dead") \
223 EM(rxrpc_conn_put_noreuse, "PUT noreuse ") \
224 EM(rxrpc_conn_put_poke, "PUT poke ") \
225 EM(rxrpc_conn_put_service_reaped, "PUT svc-reap") \
226 EM(rxrpc_conn_put_unbundle, "PUT unbundle") \
227 EM(rxrpc_conn_put_unidle, "PUT unidle ") \
228 EM(rxrpc_conn_put_work, "PUT work ") \
229 EM(rxrpc_conn_queue_challenge, "QUE chall ") \
230 EM(rxrpc_conn_queue_retry_work, "QUE retry-wk") \
231 EM(rxrpc_conn_queue_rx_work, "QUE rx-work ") \
232 EM(rxrpc_conn_see_new_service_conn, "SEE new-svc ") \
233 EM(rxrpc_conn_see_reap_service, "SEE reap-svc") \
234 E_(rxrpc_conn_see_work, "SEE work ")
236 #define rxrpc_client_traces \
237 EM(rxrpc_client_activate_chans, "Activa") \
238 EM(rxrpc_client_alloc, "Alloc ") \
239 EM(rxrpc_client_chan_activate, "ChActv") \
240 EM(rxrpc_client_chan_disconnect, "ChDisc") \
241 EM(rxrpc_client_chan_pass, "ChPass") \
242 EM(rxrpc_client_cleanup, "Clean ") \
243 EM(rxrpc_client_discard, "Discar") \
244 EM(rxrpc_client_exposed, "Expose") \
245 EM(rxrpc_client_replace, "Replac") \
246 EM(rxrpc_client_queue_new_call, "Q-Call") \
247 EM(rxrpc_client_to_active, "->Actv") \
248 E_(rxrpc_client_to_idle, "->Idle")
250 #define rxrpc_call_traces \
251 EM(rxrpc_call_get_io_thread, "GET iothread") \
252 EM(rxrpc_call_get_input, "GET input ") \
253 EM(rxrpc_call_get_kernel_service, "GET krnl-srv") \
254 EM(rxrpc_call_get_notify_socket, "GET notify ") \
255 EM(rxrpc_call_get_poke, "GET poke ") \
256 EM(rxrpc_call_get_recvmsg, "GET recvmsg ") \
257 EM(rxrpc_call_get_release_sock, "GET rel-sock") \
258 EM(rxrpc_call_get_sendmsg, "GET sendmsg ") \
259 EM(rxrpc_call_get_userid, "GET user-id ") \
260 EM(rxrpc_call_new_client, "NEW client ") \
261 EM(rxrpc_call_new_prealloc_service, "NEW prealloc") \
262 EM(rxrpc_call_put_discard_prealloc, "PUT disc-pre") \
263 EM(rxrpc_call_put_discard_error, "PUT disc-err") \
264 EM(rxrpc_call_put_io_thread, "PUT iothread") \
265 EM(rxrpc_call_put_input, "PUT input ") \
266 EM(rxrpc_call_put_kernel, "PUT kernel ") \
267 EM(rxrpc_call_put_poke, "PUT poke ") \
268 EM(rxrpc_call_put_recvmsg, "PUT recvmsg ") \
269 EM(rxrpc_call_put_release_sock, "PUT rls-sock") \
270 EM(rxrpc_call_put_release_sock_tba, "PUT rls-sk-a") \
271 EM(rxrpc_call_put_sendmsg, "PUT sendmsg ") \
272 EM(rxrpc_call_put_unnotify, "PUT unnotify") \
273 EM(rxrpc_call_put_userid_exists, "PUT u-exists") \
274 EM(rxrpc_call_put_userid, "PUT user-id ") \
275 EM(rxrpc_call_see_accept, "SEE accept ") \
276 EM(rxrpc_call_see_activate_client, "SEE act-clnt") \
277 EM(rxrpc_call_see_connect_failed, "SEE con-fail") \
278 EM(rxrpc_call_see_connected, "SEE connect ") \
279 EM(rxrpc_call_see_disconnected, "SEE disconn ") \
280 EM(rxrpc_call_see_distribute_error, "SEE dist-err") \
281 EM(rxrpc_call_see_input, "SEE input ") \
282 EM(rxrpc_call_see_release, "SEE release ") \
283 EM(rxrpc_call_see_userid_exists, "SEE u-exists") \
284 E_(rxrpc_call_see_zap, "SEE zap ")
286 #define rxrpc_txqueue_traces \
287 EM(rxrpc_txqueue_await_reply, "AWR") \
288 EM(rxrpc_txqueue_dequeue, "DEQ") \
289 EM(rxrpc_txqueue_end, "END") \
290 EM(rxrpc_txqueue_queue, "QUE") \
291 EM(rxrpc_txqueue_queue_last, "QLS") \
292 EM(rxrpc_txqueue_rotate, "ROT") \
293 EM(rxrpc_txqueue_rotate_last, "RLS") \
294 E_(rxrpc_txqueue_wait, "WAI")
296 #define rxrpc_receive_traces \
297 EM(rxrpc_receive_end, "END") \
298 EM(rxrpc_receive_front, "FRN") \
299 EM(rxrpc_receive_incoming, "INC") \
300 EM(rxrpc_receive_queue, "QUE") \
301 EM(rxrpc_receive_queue_last, "QLS") \
302 EM(rxrpc_receive_queue_oos, "QUO") \
303 EM(rxrpc_receive_queue_oos_last, "QOL") \
304 EM(rxrpc_receive_oos, "OOS") \
305 EM(rxrpc_receive_oos_last, "OSL") \
306 EM(rxrpc_receive_rotate, "ROT") \
307 E_(rxrpc_receive_rotate_last, "RLS")
309 #define rxrpc_recvmsg_traces \
310 EM(rxrpc_recvmsg_cont, "CONT") \
311 EM(rxrpc_recvmsg_data_return, "DATA") \
312 EM(rxrpc_recvmsg_dequeue, "DEQU") \
313 EM(rxrpc_recvmsg_enter, "ENTR") \
314 EM(rxrpc_recvmsg_full, "FULL") \
315 EM(rxrpc_recvmsg_hole, "HOLE") \
316 EM(rxrpc_recvmsg_next, "NEXT") \
317 EM(rxrpc_recvmsg_requeue, "REQU") \
318 EM(rxrpc_recvmsg_return, "RETN") \
319 EM(rxrpc_recvmsg_terminal, "TERM") \
320 EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \
321 EM(rxrpc_recvmsg_unqueue, "UNQU") \
322 E_(rxrpc_recvmsg_wait, "WAIT")
324 #define rxrpc_rtt_tx_traces \
325 EM(rxrpc_rtt_tx_cancel, "CNCE") \
326 EM(rxrpc_rtt_tx_data, "DATA") \
327 EM(rxrpc_rtt_tx_no_slot, "FULL") \
328 E_(rxrpc_rtt_tx_ping, "PING")
330 #define rxrpc_rtt_rx_traces \
331 EM(rxrpc_rtt_rx_other_ack, "OACK") \
332 EM(rxrpc_rtt_rx_obsolete, "OBSL") \
333 EM(rxrpc_rtt_rx_lost, "LOST") \
334 EM(rxrpc_rtt_rx_ping_response, "PONG") \
335 E_(rxrpc_rtt_rx_requested_ack, "RACK")
337 #define rxrpc_timer_traces \
338 EM(rxrpc_timer_begin, "Begin ") \
339 EM(rxrpc_timer_exp_ack, "ExpAck") \
340 EM(rxrpc_timer_exp_hard, "ExpHrd") \
341 EM(rxrpc_timer_exp_idle, "ExpIdl") \
342 EM(rxrpc_timer_exp_keepalive, "ExpKA ") \
343 EM(rxrpc_timer_exp_lost_ack, "ExpLoA") \
344 EM(rxrpc_timer_exp_normal, "ExpNml") \
345 EM(rxrpc_timer_exp_ping, "ExpPng") \
346 EM(rxrpc_timer_exp_resend, "ExpRsn") \
347 EM(rxrpc_timer_init_for_reply, "IniRpl") \
348 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
349 EM(rxrpc_timer_restart, "Restrt") \
350 EM(rxrpc_timer_set_for_ack, "SetAck") \
351 EM(rxrpc_timer_set_for_hard, "SetHrd") \
352 EM(rxrpc_timer_set_for_idle, "SetIdl") \
353 EM(rxrpc_timer_set_for_keepalive, "KeepAl") \
354 EM(rxrpc_timer_set_for_lost_ack, "SetLoA") \
355 EM(rxrpc_timer_set_for_normal, "SetNml") \
356 EM(rxrpc_timer_set_for_ping, "SetPng") \
357 EM(rxrpc_timer_set_for_resend, "SetRTx") \
358 E_(rxrpc_timer_set_for_send, "SetSnd")
360 #define rxrpc_propose_ack_traces \
361 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
362 EM(rxrpc_propose_ack_input_data, "DataIn ") \
363 EM(rxrpc_propose_ack_input_data_hole, "DataInH") \
364 EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \
365 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
366 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
367 EM(rxrpc_propose_ack_ping_for_old_rtt, "OldRtt ") \
368 EM(rxrpc_propose_ack_ping_for_params, "Params ") \
369 EM(rxrpc_propose_ack_ping_for_rtt, "Rtt ") \
370 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
371 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
372 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
373 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
374 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
375 EM(rxrpc_propose_ack_rx_idle, "RxIdle ") \
376 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
378 #define rxrpc_congest_modes \
379 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
380 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
381 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
382 E_(RXRPC_CALL_SLOW_START, "SlowStart")
384 #define rxrpc_congest_changes \
385 EM(rxrpc_cong_begin_retransmission, " Retrans") \
386 EM(rxrpc_cong_cleared_nacks, " Cleared") \
387 EM(rxrpc_cong_new_low_nack, " NewLowN") \
388 EM(rxrpc_cong_no_change, " -") \
389 EM(rxrpc_cong_progress, " Progres") \
390 EM(rxrpc_cong_idle_reset, " IdleRes") \
391 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
392 EM(rxrpc_cong_rtt_window_end, " RttWinE") \
393 E_(rxrpc_cong_saw_nack, " SawNack")
397 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
398 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
399 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
400 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
401 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
402 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
403 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
404 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
409 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
413 #define rxrpc_ack_names \
415 EM(RXRPC_ACK_REQUESTED, "REQ") \
416 EM(RXRPC_ACK_DUPLICATE, "DUP") \
417 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
418 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
419 EM(RXRPC_ACK_NOSPACE, "MEM") \
420 EM(RXRPC_ACK_PING, "PNG") \
421 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
422 EM(RXRPC_ACK_DELAY, "DLY") \
423 EM(RXRPC_ACK_IDLE, "IDL") \
424 E_(RXRPC_ACK__INVALID, "-?-")
426 #define rxrpc_sack_traces \
427 EM(rxrpc_sack_advance, "ADV") \
428 EM(rxrpc_sack_fill, "FIL") \
429 EM(rxrpc_sack_nack, "NAK") \
430 EM(rxrpc_sack_none, "---") \
431 E_(rxrpc_sack_oos, "OOS")
433 #define rxrpc_completions \
434 EM(RXRPC_CALL_SUCCEEDED, "Succeeded") \
435 EM(RXRPC_CALL_REMOTELY_ABORTED, "RemoteAbort") \
436 EM(RXRPC_CALL_LOCALLY_ABORTED, "LocalAbort") \
437 EM(RXRPC_CALL_LOCAL_ERROR, "LocalError") \
438 E_(RXRPC_CALL_NETWORK_ERROR, "NetError")
440 #define rxrpc_tx_points \
441 EM(rxrpc_tx_point_call_abort, "CallAbort") \
442 EM(rxrpc_tx_point_call_ack, "CallAck") \
443 EM(rxrpc_tx_point_call_data_frag, "CallDataFrag") \
444 EM(rxrpc_tx_point_call_data_nofrag, "CallDataNofrag") \
445 EM(rxrpc_tx_point_call_final_resend, "CallFinalResend") \
446 EM(rxrpc_tx_point_conn_abort, "ConnAbort") \
447 EM(rxrpc_tx_point_reject, "Reject") \
448 EM(rxrpc_tx_point_rxkad_challenge, "RxkadChall") \
449 EM(rxrpc_tx_point_rxkad_response, "RxkadResp") \
450 EM(rxrpc_tx_point_version_keepalive, "VerKeepalive") \
451 E_(rxrpc_tx_point_version_reply, "VerReply")
453 #define rxrpc_req_ack_traces \
454 EM(rxrpc_reqack_ack_lost, "ACK-LOST ") \
455 EM(rxrpc_reqack_already_on, "ALREADY-ON") \
456 EM(rxrpc_reqack_more_rtt, "MORE-RTT ") \
457 EM(rxrpc_reqack_no_srv_last, "NO-SRVLAST") \
458 EM(rxrpc_reqack_old_rtt, "OLD-RTT ") \
459 EM(rxrpc_reqack_retrans, "RETRANS ") \
460 EM(rxrpc_reqack_slow_start, "SLOW-START") \
461 E_(rxrpc_reqack_small_txwin, "SMALL-TXWN")
462 /* ---- Must update size of stat_why_req_ack[] if more are added! */
464 #define rxrpc_txbuf_traces \
465 EM(rxrpc_txbuf_alloc_ack, "ALLOC ACK ") \
466 EM(rxrpc_txbuf_alloc_data, "ALLOC DATA ") \
467 EM(rxrpc_txbuf_free, "FREE ") \
468 EM(rxrpc_txbuf_get_buffer, "GET BUFFER ") \
469 EM(rxrpc_txbuf_get_trans, "GET TRANS ") \
470 EM(rxrpc_txbuf_get_retrans, "GET RETRANS") \
471 EM(rxrpc_txbuf_put_ack_tx, "PUT ACK TX ") \
472 EM(rxrpc_txbuf_put_cleaned, "PUT CLEANED") \
473 EM(rxrpc_txbuf_put_nomem, "PUT NOMEM ") \
474 EM(rxrpc_txbuf_put_rotated, "PUT ROTATED") \
475 EM(rxrpc_txbuf_put_send_aborted, "PUT SEND-X ") \
476 EM(rxrpc_txbuf_put_trans, "PUT TRANS ") \
477 EM(rxrpc_txbuf_see_out_of_step, "OUT-OF-STEP") \
478 EM(rxrpc_txbuf_see_send_more, "SEE SEND+ ") \
479 E_(rxrpc_txbuf_see_unacked, "SEE UNACKED")
482 * Generate enums for tracing information.
484 #ifndef __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
485 #define __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
492 enum rxrpc_abort_reason { rxrpc_abort_reasons } __mode(byte);
493 enum rxrpc_bundle_trace { rxrpc_bundle_traces } __mode(byte);
494 enum rxrpc_call_poke_trace { rxrpc_call_poke_traces } __mode(byte);
495 enum rxrpc_call_trace { rxrpc_call_traces } __mode(byte);
496 enum rxrpc_client_trace { rxrpc_client_traces } __mode(byte);
497 enum rxrpc_congest_change { rxrpc_congest_changes } __mode(byte);
498 enum rxrpc_conn_trace { rxrpc_conn_traces } __mode(byte);
499 enum rxrpc_local_trace { rxrpc_local_traces } __mode(byte);
500 enum rxrpc_peer_trace { rxrpc_peer_traces } __mode(byte);
501 enum rxrpc_propose_ack_outcome { rxrpc_propose_ack_outcomes } __mode(byte);
502 enum rxrpc_propose_ack_trace { rxrpc_propose_ack_traces } __mode(byte);
503 enum rxrpc_receive_trace { rxrpc_receive_traces } __mode(byte);
504 enum rxrpc_recvmsg_trace { rxrpc_recvmsg_traces } __mode(byte);
505 enum rxrpc_req_ack_trace { rxrpc_req_ack_traces } __mode(byte);
506 enum rxrpc_rtt_rx_trace { rxrpc_rtt_rx_traces } __mode(byte);
507 enum rxrpc_rtt_tx_trace { rxrpc_rtt_tx_traces } __mode(byte);
508 enum rxrpc_sack_trace { rxrpc_sack_traces } __mode(byte);
509 enum rxrpc_skb_trace { rxrpc_skb_traces } __mode(byte);
510 enum rxrpc_timer_trace { rxrpc_timer_traces } __mode(byte);
511 enum rxrpc_tx_point { rxrpc_tx_points } __mode(byte);
512 enum rxrpc_txbuf_trace { rxrpc_txbuf_traces } __mode(byte);
513 enum rxrpc_txqueue_trace { rxrpc_txqueue_traces } __mode(byte);
515 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
518 * Export enum symbols via userspace.
523 #ifndef RXRPC_TRACE_ONLY_DEFINE_ENUMS
525 #define EM(a, b) TRACE_DEFINE_ENUM(a);
526 #define E_(a, b) TRACE_DEFINE_ENUM(a);
530 rxrpc_call_poke_traces;
533 rxrpc_congest_changes;
537 rxrpc_propose_ack_traces;
538 rxrpc_receive_traces;
539 rxrpc_recvmsg_traces;
540 rxrpc_req_ack_traces;
548 rxrpc_txqueue_traces;
551 * Now redefine the EM() and E_() macros to map the enums to the strings that
552 * will be printed in the output.
556 #define EM(a, b) { a, b },
557 #define E_(a, b) { a, b }
559 TRACE_EVENT(rxrpc_local,
560 TP_PROTO(unsigned int local_debug_id, enum rxrpc_local_trace op,
563 TP_ARGS(local_debug_id, op, ref, usage),
566 __field(unsigned int, local)
573 __entry->local = local_debug_id;
576 __entry->usage = usage;
579 TP_printk("L=%08x %s r=%d u=%d",
581 __print_symbolic(__entry->op, rxrpc_local_traces),
586 TRACE_EVENT(rxrpc_peer,
587 TP_PROTO(unsigned int peer_debug_id, int ref, enum rxrpc_peer_trace why),
589 TP_ARGS(peer_debug_id, ref, why),
592 __field(unsigned int, peer)
594 __field(enum rxrpc_peer_trace, why)
598 __entry->peer = peer_debug_id;
603 TP_printk("P=%08x %s r=%d",
605 __print_symbolic(__entry->why, rxrpc_peer_traces),
609 TRACE_EVENT(rxrpc_bundle,
610 TP_PROTO(unsigned int bundle_debug_id, int ref, enum rxrpc_bundle_trace why),
612 TP_ARGS(bundle_debug_id, ref, why),
615 __field(unsigned int, bundle)
621 __entry->bundle = bundle_debug_id;
626 TP_printk("CB=%08x %s r=%d",
628 __print_symbolic(__entry->why, rxrpc_bundle_traces),
632 TRACE_EVENT(rxrpc_conn,
633 TP_PROTO(unsigned int conn_debug_id, int ref, enum rxrpc_conn_trace why),
635 TP_ARGS(conn_debug_id, ref, why),
638 __field(unsigned int, conn)
644 __entry->conn = conn_debug_id;
649 TP_printk("C=%08x %s r=%d",
651 __print_symbolic(__entry->why, rxrpc_conn_traces),
655 TRACE_EVENT(rxrpc_client,
656 TP_PROTO(struct rxrpc_connection *conn, int channel,
657 enum rxrpc_client_trace op),
659 TP_ARGS(conn, channel, op),
662 __field(unsigned int, conn)
664 __field(int, channel)
666 __field(enum rxrpc_client_trace, op)
670 __entry->conn = conn ? conn->debug_id : 0;
671 __entry->channel = channel;
672 __entry->usage = conn ? refcount_read(&conn->ref) : -2;
674 __entry->cid = conn ? conn->proto.cid : 0;
677 TP_printk("C=%08x h=%2d %s i=%08x u=%d",
680 __print_symbolic(__entry->op, rxrpc_client_traces),
685 TRACE_EVENT(rxrpc_call,
686 TP_PROTO(unsigned int call_debug_id, int ref, unsigned long aux,
687 enum rxrpc_call_trace why),
689 TP_ARGS(call_debug_id, ref, aux, why),
692 __field(unsigned int, call)
695 __field(unsigned long, aux)
699 __entry->call = call_debug_id;
705 TP_printk("c=%08x %s r=%d a=%lx",
707 __print_symbolic(__entry->why, rxrpc_call_traces),
712 TRACE_EVENT(rxrpc_skb,
713 TP_PROTO(struct sk_buff *skb, int usage, int mod_count,
714 enum rxrpc_skb_trace why),
716 TP_ARGS(skb, usage, mod_count, why),
719 __field(struct sk_buff *, skb)
721 __field(int, mod_count)
722 __field(enum rxrpc_skb_trace, why)
727 __entry->usage = usage;
728 __entry->mod_count = mod_count;
732 TP_printk("s=%p Rx %s u=%d m=%d",
734 __print_symbolic(__entry->why, rxrpc_skb_traces),
739 TRACE_EVENT(rxrpc_rx_packet,
740 TP_PROTO(struct rxrpc_skb_priv *sp),
745 __field_struct(struct rxrpc_host_header, hdr)
749 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
752 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
753 __entry->hdr.epoch, __entry->hdr.cid,
754 __entry->hdr.callNumber, __entry->hdr.serviceId,
755 __entry->hdr.serial, __entry->hdr.seq,
756 __entry->hdr.securityIndex, __entry->hdr.flags,
757 __print_symbolic(__entry->hdr.type, rxrpc_pkts))
760 TRACE_EVENT(rxrpc_rx_done,
761 TP_PROTO(int result, int abort_code),
763 TP_ARGS(result, abort_code),
767 __field(int, abort_code)
771 __entry->result = result;
772 __entry->abort_code = abort_code;
775 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
778 TRACE_EVENT(rxrpc_abort,
779 TP_PROTO(unsigned int call_nr, enum rxrpc_abort_reason why,
780 u32 cid, u32 call_id, rxrpc_seq_t seq, int abort_code, int error),
782 TP_ARGS(call_nr, why, cid, call_id, seq, abort_code, error),
785 __field(unsigned int, call_nr)
786 __field(enum rxrpc_abort_reason, why)
788 __field(u32, call_id)
789 __field(rxrpc_seq_t, seq)
790 __field(int, abort_code)
795 __entry->call_nr = call_nr;
798 __entry->call_id = call_id;
799 __entry->abort_code = abort_code;
800 __entry->error = error;
804 TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
806 __entry->cid, __entry->call_id, __entry->seq,
807 __entry->abort_code, __entry->error,
808 __print_symbolic(__entry->why, rxrpc_abort_reasons))
811 TRACE_EVENT(rxrpc_call_complete,
812 TP_PROTO(struct rxrpc_call *call),
817 __field(unsigned int, call)
818 __field(enum rxrpc_call_completion, compl)
820 __field(u32, abort_code)
824 __entry->call = call->debug_id;
825 __entry->compl = call->completion;
826 __entry->error = call->error;
827 __entry->abort_code = call->abort_code;
830 TP_printk("c=%08x %s r=%d ac=%d",
832 __print_symbolic(__entry->compl, rxrpc_completions),
837 TRACE_EVENT(rxrpc_txqueue,
838 TP_PROTO(struct rxrpc_call *call, enum rxrpc_txqueue_trace why),
843 __field(unsigned int, call)
844 __field(enum rxrpc_txqueue_trace, why)
845 __field(rxrpc_seq_t, acks_hard_ack)
846 __field(rxrpc_seq_t, tx_bottom)
847 __field(rxrpc_seq_t, tx_top)
848 __field(rxrpc_seq_t, tx_prepared)
849 __field(int, tx_winsize)
853 __entry->call = call->debug_id;
855 __entry->acks_hard_ack = call->acks_hard_ack;
856 __entry->tx_bottom = call->tx_bottom;
857 __entry->tx_top = call->tx_top;
858 __entry->tx_prepared = call->tx_prepared;
859 __entry->tx_winsize = call->tx_winsize;
862 TP_printk("c=%08x %s f=%08x h=%08x n=%u/%u/%u/%u",
864 __print_symbolic(__entry->why, rxrpc_txqueue_traces),
866 __entry->acks_hard_ack,
867 __entry->tx_top - __entry->tx_bottom,
868 __entry->tx_top - __entry->acks_hard_ack,
869 __entry->tx_prepared - __entry->tx_bottom,
873 TRACE_EVENT(rxrpc_rx_data,
874 TP_PROTO(unsigned int call, rxrpc_seq_t seq,
875 rxrpc_serial_t serial, u8 flags),
877 TP_ARGS(call, seq, serial, flags),
880 __field(unsigned int, call)
881 __field(rxrpc_seq_t, seq)
882 __field(rxrpc_serial_t, serial)
887 __entry->call = call;
889 __entry->serial = serial;
890 __entry->flags = flags;
893 TP_printk("c=%08x DATA %08x q=%08x fl=%02x",
900 TRACE_EVENT(rxrpc_rx_ack,
901 TP_PROTO(struct rxrpc_call *call,
902 rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
903 rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
905 TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
908 __field(unsigned int, call)
909 __field(rxrpc_serial_t, serial)
910 __field(rxrpc_serial_t, ack_serial)
911 __field(rxrpc_seq_t, first)
912 __field(rxrpc_seq_t, prev)
918 __entry->call = call->debug_id;
919 __entry->serial = serial;
920 __entry->ack_serial = ack_serial;
921 __entry->first = first;
922 __entry->prev = prev;
923 __entry->reason = reason;
924 __entry->n_acks = n_acks;
927 TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
930 __print_symbolic(__entry->reason, rxrpc_ack_names),
937 TRACE_EVENT(rxrpc_rx_abort,
938 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
941 TP_ARGS(call, serial, abort_code),
944 __field(unsigned int, call)
945 __field(rxrpc_serial_t, serial)
946 __field(u32, abort_code)
950 __entry->call = call->debug_id;
951 __entry->serial = serial;
952 __entry->abort_code = abort_code;
955 TP_printk("c=%08x ABORT %08x ac=%d",
961 TRACE_EVENT(rxrpc_rx_challenge,
962 TP_PROTO(struct rxrpc_connection *conn, rxrpc_serial_t serial,
963 u32 version, u32 nonce, u32 min_level),
965 TP_ARGS(conn, serial, version, nonce, min_level),
968 __field(unsigned int, conn)
969 __field(rxrpc_serial_t, serial)
970 __field(u32, version)
972 __field(u32, min_level)
976 __entry->conn = conn->debug_id;
977 __entry->serial = serial;
978 __entry->version = version;
979 __entry->nonce = nonce;
980 __entry->min_level = min_level;
983 TP_printk("C=%08x CHALLENGE %08x v=%x n=%x ml=%x",
991 TRACE_EVENT(rxrpc_rx_response,
992 TP_PROTO(struct rxrpc_connection *conn, rxrpc_serial_t serial,
993 u32 version, u32 kvno, u32 ticket_len),
995 TP_ARGS(conn, serial, version, kvno, ticket_len),
998 __field(unsigned int, conn)
999 __field(rxrpc_serial_t, serial)
1000 __field(u32, version)
1002 __field(u32, ticket_len)
1006 __entry->conn = conn->debug_id;
1007 __entry->serial = serial;
1008 __entry->version = version;
1009 __entry->kvno = kvno;
1010 __entry->ticket_len = ticket_len;
1013 TP_printk("C=%08x RESPONSE %08x v=%x kvno=%x tl=%x",
1018 __entry->ticket_len)
1021 TRACE_EVENT(rxrpc_rx_rwind_change,
1022 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1023 u32 rwind, bool wake),
1025 TP_ARGS(call, serial, rwind, wake),
1028 __field(unsigned int, call)
1029 __field(rxrpc_serial_t, serial)
1035 __entry->call = call->debug_id;
1036 __entry->serial = serial;
1037 __entry->rwind = rwind;
1038 __entry->wake = wake;
1041 TP_printk("c=%08x %08x rw=%u%s",
1045 __entry->wake ? " wake" : "")
1048 TRACE_EVENT(rxrpc_tx_packet,
1049 TP_PROTO(unsigned int call_id, struct rxrpc_wire_header *whdr,
1050 enum rxrpc_tx_point where),
1052 TP_ARGS(call_id, whdr, where),
1055 __field(unsigned int, call)
1056 __field(enum rxrpc_tx_point, where)
1057 __field_struct(struct rxrpc_wire_header, whdr)
1061 __entry->call = call_id;
1062 memcpy(&__entry->whdr, whdr, sizeof(__entry->whdr));
1063 __entry->where = where;
1066 TP_printk("c=%08x %08x:%08x:%08x:%04x %08x %08x %02x %02x %s %s",
1068 ntohl(__entry->whdr.epoch),
1069 ntohl(__entry->whdr.cid),
1070 ntohl(__entry->whdr.callNumber),
1071 ntohs(__entry->whdr.serviceId),
1072 ntohl(__entry->whdr.serial),
1073 ntohl(__entry->whdr.seq),
1074 __entry->whdr.type, __entry->whdr.flags,
1075 __entry->whdr.type <= 15 ?
1076 __print_symbolic(__entry->whdr.type, rxrpc_pkts) : "?UNK",
1077 __print_symbolic(__entry->where, rxrpc_tx_points))
1080 TRACE_EVENT(rxrpc_tx_data,
1081 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
1082 rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
1084 TP_ARGS(call, seq, serial, flags, retrans, lose),
1087 __field(unsigned int, call)
1088 __field(rxrpc_seq_t, seq)
1089 __field(rxrpc_serial_t, serial)
1091 __field(u32, call_id)
1093 __field(bool, retrans)
1098 __entry->call = call->debug_id;
1099 __entry->cid = call->cid;
1100 __entry->call_id = call->call_id;
1102 __entry->serial = serial;
1103 __entry->flags = flags;
1104 __entry->retrans = retrans;
1105 __entry->lose = lose;
1108 TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
1115 __entry->retrans ? " *RETRANS*" : "",
1116 __entry->lose ? " *LOSE*" : "")
1119 TRACE_EVENT(rxrpc_tx_ack,
1120 TP_PROTO(unsigned int call, rxrpc_serial_t serial,
1121 rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
1122 u8 reason, u8 n_acks, u16 rwind),
1124 TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks, rwind),
1127 __field(unsigned int, call)
1128 __field(rxrpc_serial_t, serial)
1129 __field(rxrpc_seq_t, ack_first)
1130 __field(rxrpc_serial_t, ack_serial)
1137 __entry->call = call;
1138 __entry->serial = serial;
1139 __entry->ack_first = ack_first;
1140 __entry->ack_serial = ack_serial;
1141 __entry->reason = reason;
1142 __entry->n_acks = n_acks;
1143 __entry->rwind = rwind;
1146 TP_printk(" c=%08x ACK %08x %s f=%08x r=%08x n=%u rw=%u",
1149 __print_symbolic(__entry->reason, rxrpc_ack_names),
1151 __entry->ack_serial,
1156 TRACE_EVENT(rxrpc_receive,
1157 TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
1158 rxrpc_serial_t serial, rxrpc_seq_t seq),
1160 TP_ARGS(call, why, serial, seq),
1163 __field(unsigned int, call)
1164 __field(enum rxrpc_receive_trace, why)
1165 __field(rxrpc_serial_t, serial)
1166 __field(rxrpc_seq_t, seq)
1167 __field(rxrpc_seq_t, window)
1168 __field(rxrpc_seq_t, wtop)
1172 __entry->call = call->debug_id;
1174 __entry->serial = serial;
1176 __entry->window = call->ackr_window;
1177 __entry->wtop = call->ackr_wtop;
1180 TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
1182 __print_symbolic(__entry->why, rxrpc_receive_traces),
1189 TRACE_EVENT(rxrpc_recvmsg,
1190 TP_PROTO(unsigned int call_debug_id, enum rxrpc_recvmsg_trace why,
1193 TP_ARGS(call_debug_id, why, ret),
1196 __field(unsigned int, call)
1197 __field(enum rxrpc_recvmsg_trace, why)
1202 __entry->call = call_debug_id;
1207 TP_printk("c=%08x %s ret=%d",
1209 __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
1213 TRACE_EVENT(rxrpc_recvdata,
1214 TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
1215 rxrpc_seq_t seq, unsigned int offset, unsigned int len,
1218 TP_ARGS(call, why, seq, offset, len, ret),
1221 __field(unsigned int, call)
1222 __field(enum rxrpc_recvmsg_trace, why)
1223 __field(rxrpc_seq_t, seq)
1224 __field(unsigned int, offset)
1225 __field(unsigned int, len)
1230 __entry->call = call ? call->debug_id : 0;
1233 __entry->offset = offset;
1238 TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
1240 __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
1247 TRACE_EVENT(rxrpc_rtt_tx,
1248 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
1249 int slot, rxrpc_serial_t send_serial),
1251 TP_ARGS(call, why, slot, send_serial),
1254 __field(unsigned int, call)
1255 __field(enum rxrpc_rtt_tx_trace, why)
1257 __field(rxrpc_serial_t, send_serial)
1261 __entry->call = call->debug_id;
1263 __entry->slot = slot;
1264 __entry->send_serial = send_serial;
1267 TP_printk("c=%08x [%d] %s sr=%08x",
1270 __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
1271 __entry->send_serial)
1274 TRACE_EVENT(rxrpc_rtt_rx,
1275 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
1277 rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
1280 TP_ARGS(call, why, slot, send_serial, resp_serial, rtt, rto),
1283 __field(unsigned int, call)
1284 __field(enum rxrpc_rtt_rx_trace, why)
1286 __field(rxrpc_serial_t, send_serial)
1287 __field(rxrpc_serial_t, resp_serial)
1293 __entry->call = call->debug_id;
1295 __entry->slot = slot;
1296 __entry->send_serial = send_serial;
1297 __entry->resp_serial = resp_serial;
1302 TP_printk("c=%08x [%d] %s sr=%08x rr=%08x rtt=%u rto=%u",
1305 __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
1306 __entry->send_serial,
1307 __entry->resp_serial,
1312 TRACE_EVENT(rxrpc_timer,
1313 TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
1316 TP_ARGS(call, why, now),
1319 __field(unsigned int, call)
1320 __field(enum rxrpc_timer_trace, why)
1322 __field(long, ack_at)
1323 __field(long, ack_lost_at)
1324 __field(long, resend_at)
1325 __field(long, ping_at)
1326 __field(long, expect_rx_by)
1327 __field(long, expect_req_by)
1328 __field(long, expect_term_by)
1329 __field(long, timer)
1333 __entry->call = call->debug_id;
1336 __entry->ack_at = call->delay_ack_at;
1337 __entry->ack_lost_at = call->ack_lost_at;
1338 __entry->resend_at = call->resend_at;
1339 __entry->expect_rx_by = call->expect_rx_by;
1340 __entry->expect_req_by = call->expect_req_by;
1341 __entry->expect_term_by = call->expect_term_by;
1342 __entry->timer = call->timer.expires;
1345 TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1347 __print_symbolic(__entry->why, rxrpc_timer_traces),
1348 __entry->ack_at - __entry->now,
1349 __entry->ack_lost_at - __entry->now,
1350 __entry->resend_at - __entry->now,
1351 __entry->expect_rx_by - __entry->now,
1352 __entry->expect_req_by - __entry->now,
1353 __entry->expect_term_by - __entry->now,
1354 __entry->timer - __entry->now)
1357 TRACE_EVENT(rxrpc_timer_expired,
1358 TP_PROTO(struct rxrpc_call *call, unsigned long now),
1363 __field(unsigned int, call)
1365 __field(long, ack_at)
1366 __field(long, ack_lost_at)
1367 __field(long, resend_at)
1368 __field(long, ping_at)
1369 __field(long, expect_rx_by)
1370 __field(long, expect_req_by)
1371 __field(long, expect_term_by)
1372 __field(long, timer)
1376 __entry->call = call->debug_id;
1378 __entry->ack_at = call->delay_ack_at;
1379 __entry->ack_lost_at = call->ack_lost_at;
1380 __entry->resend_at = call->resend_at;
1381 __entry->expect_rx_by = call->expect_rx_by;
1382 __entry->expect_req_by = call->expect_req_by;
1383 __entry->expect_term_by = call->expect_term_by;
1384 __entry->timer = call->timer.expires;
1387 TP_printk("c=%08x EXPIRED a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1389 __entry->ack_at - __entry->now,
1390 __entry->ack_lost_at - __entry->now,
1391 __entry->resend_at - __entry->now,
1392 __entry->expect_rx_by - __entry->now,
1393 __entry->expect_req_by - __entry->now,
1394 __entry->expect_term_by - __entry->now,
1395 __entry->timer - __entry->now)
1398 TRACE_EVENT(rxrpc_rx_lose,
1399 TP_PROTO(struct rxrpc_skb_priv *sp),
1404 __field_struct(struct rxrpc_host_header, hdr)
1408 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
1411 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1412 __entry->hdr.epoch, __entry->hdr.cid,
1413 __entry->hdr.callNumber, __entry->hdr.serviceId,
1414 __entry->hdr.serial, __entry->hdr.seq,
1415 __entry->hdr.type, __entry->hdr.flags,
1416 __entry->hdr.type <= 15 ?
1417 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
1420 TRACE_EVENT(rxrpc_propose_ack,
1421 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1422 u8 ack_reason, rxrpc_serial_t serial),
1424 TP_ARGS(call, why, ack_reason, serial),
1427 __field(unsigned int, call)
1428 __field(enum rxrpc_propose_ack_trace, why)
1429 __field(rxrpc_serial_t, serial)
1430 __field(u8, ack_reason)
1434 __entry->call = call->debug_id;
1436 __entry->serial = serial;
1437 __entry->ack_reason = ack_reason;
1440 TP_printk("c=%08x %s %s r=%08x",
1442 __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1443 __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1447 TRACE_EVENT(rxrpc_send_ack,
1448 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1449 u8 ack_reason, rxrpc_serial_t serial),
1451 TP_ARGS(call, why, ack_reason, serial),
1454 __field(unsigned int, call)
1455 __field(enum rxrpc_propose_ack_trace, why)
1456 __field(rxrpc_serial_t, serial)
1457 __field(u8, ack_reason)
1461 __entry->call = call->debug_id;
1463 __entry->serial = serial;
1464 __entry->ack_reason = ack_reason;
1467 TP_printk("c=%08x %s %s r=%08x",
1469 __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1470 __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1474 TRACE_EVENT(rxrpc_drop_ack,
1475 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1476 u8 ack_reason, rxrpc_serial_t serial, bool nobuf),
1478 TP_ARGS(call, why, ack_reason, serial, nobuf),
1481 __field(unsigned int, call)
1482 __field(enum rxrpc_propose_ack_trace, why)
1483 __field(rxrpc_serial_t, serial)
1484 __field(u8, ack_reason)
1485 __field(bool, nobuf)
1489 __entry->call = call->debug_id;
1491 __entry->serial = serial;
1492 __entry->ack_reason = ack_reason;
1493 __entry->nobuf = nobuf;
1496 TP_printk("c=%08x %s %s r=%08x nbf=%u",
1498 __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1499 __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1500 __entry->serial, __entry->nobuf)
1503 TRACE_EVENT(rxrpc_retransmit,
1504 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, s64 expiry),
1506 TP_ARGS(call, seq, expiry),
1509 __field(unsigned int, call)
1510 __field(rxrpc_seq_t, seq)
1511 __field(s64, expiry)
1515 __entry->call = call->debug_id;
1517 __entry->expiry = expiry;
1520 TP_printk("c=%08x q=%x xp=%lld",
1526 TRACE_EVENT(rxrpc_congest,
1527 TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1528 rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1530 TP_ARGS(call, summary, ack_serial, change),
1533 __field(unsigned int, call)
1534 __field(enum rxrpc_congest_change, change)
1535 __field(rxrpc_seq_t, hard_ack)
1536 __field(rxrpc_seq_t, top)
1537 __field(rxrpc_seq_t, lowest_nak)
1538 __field(rxrpc_serial_t, ack_serial)
1539 __field_struct(struct rxrpc_ack_summary, sum)
1543 __entry->call = call->debug_id;
1544 __entry->change = change;
1545 __entry->hard_ack = call->acks_hard_ack;
1546 __entry->top = call->tx_top;
1547 __entry->lowest_nak = call->acks_lowest_nak;
1548 __entry->ack_serial = ack_serial;
1549 memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1552 TP_printk("c=%08x r=%08x %s q=%08x %s cw=%u ss=%u nA=%u,%u+%u r=%u b=%u u=%u d=%u l=%x%s%s%s",
1554 __entry->ack_serial,
1555 __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
1557 __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
1559 __entry->sum.ssthresh,
1560 __entry->sum.nr_acks, __entry->sum.saw_nacks,
1561 __entry->sum.nr_new_acks,
1562 __entry->sum.nr_rot_new_acks,
1563 __entry->top - __entry->hard_ack,
1564 __entry->sum.cumulative_acks,
1565 __entry->sum.dup_acks,
1566 __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
1567 __print_symbolic(__entry->change, rxrpc_congest_changes),
1568 __entry->sum.retrans_timeo ? " rTxTo" : "")
1571 TRACE_EVENT(rxrpc_reset_cwnd,
1572 TP_PROTO(struct rxrpc_call *call, ktime_t now),
1577 __field(unsigned int, call)
1578 __field(enum rxrpc_congest_mode, mode)
1579 __field(unsigned short, cwnd)
1580 __field(unsigned short, extra)
1581 __field(rxrpc_seq_t, hard_ack)
1582 __field(rxrpc_seq_t, prepared)
1583 __field(ktime_t, since_last_tx)
1584 __field(bool, has_data)
1588 __entry->call = call->debug_id;
1589 __entry->mode = call->cong_mode;
1590 __entry->cwnd = call->cong_cwnd;
1591 __entry->extra = call->cong_extra;
1592 __entry->hard_ack = call->acks_hard_ack;
1593 __entry->prepared = call->tx_prepared - call->tx_bottom;
1594 __entry->since_last_tx = ktime_sub(now, call->tx_last_sent);
1595 __entry->has_data = !list_empty(&call->tx_sendmsg);
1598 TP_printk("c=%08x q=%08x %s cw=%u+%u pr=%u tm=%llu d=%u",
1601 __print_symbolic(__entry->mode, rxrpc_congest_modes),
1605 ktime_to_ns(__entry->since_last_tx),
1609 TRACE_EVENT(rxrpc_disconnect_call,
1610 TP_PROTO(struct rxrpc_call *call),
1615 __field(unsigned int, call)
1616 __field(u32, abort_code)
1620 __entry->call = call->debug_id;
1621 __entry->abort_code = call->abort_code;
1624 TP_printk("c=%08x ab=%08x",
1626 __entry->abort_code)
1629 TRACE_EVENT(rxrpc_improper_term,
1630 TP_PROTO(struct rxrpc_call *call),
1635 __field(unsigned int, call)
1636 __field(u32, abort_code)
1640 __entry->call = call->debug_id;
1641 __entry->abort_code = call->abort_code;
1644 TP_printk("c=%08x ab=%08x",
1646 __entry->abort_code)
1649 TRACE_EVENT(rxrpc_connect_call,
1650 TP_PROTO(struct rxrpc_call *call),
1655 __field(unsigned int, call)
1656 __field(unsigned long, user_call_ID)
1658 __field(u32, call_id)
1659 __field_struct(struct sockaddr_rxrpc, srx)
1663 __entry->call = call->debug_id;
1664 __entry->user_call_ID = call->user_call_ID;
1665 __entry->cid = call->cid;
1666 __entry->call_id = call->call_id;
1667 __entry->srx = call->dest_srx;
1670 TP_printk("c=%08x u=%p %08x:%08x dst=%pISp",
1672 (void *)__entry->user_call_ID,
1675 &__entry->srx.transport)
1678 TRACE_EVENT(rxrpc_resend,
1679 TP_PROTO(struct rxrpc_call *call, struct sk_buff *ack),
1684 __field(unsigned int, call)
1685 __field(rxrpc_seq_t, seq)
1686 __field(rxrpc_seq_t, transmitted)
1687 __field(rxrpc_serial_t, ack_serial)
1691 struct rxrpc_skb_priv *sp = ack ? rxrpc_skb(ack) : NULL;
1692 __entry->call = call->debug_id;
1693 __entry->seq = call->acks_hard_ack;
1694 __entry->transmitted = call->tx_transmitted;
1695 __entry->ack_serial = sp ? sp->hdr.serial : 0;
1698 TP_printk("c=%08x r=%x q=%x tq=%x",
1700 __entry->ack_serial,
1702 __entry->transmitted)
1705 TRACE_EVENT(rxrpc_rx_icmp,
1706 TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee,
1707 struct sockaddr_rxrpc *srx),
1709 TP_ARGS(peer, ee, srx),
1712 __field(unsigned int, peer)
1713 __field_struct(struct sock_extended_err, ee)
1714 __field_struct(struct sockaddr_rxrpc, srx)
1718 __entry->peer = peer->debug_id;
1719 memcpy(&__entry->ee, ee, sizeof(__entry->ee));
1720 memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1723 TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp",
1725 __entry->ee.ee_origin,
1726 __entry->ee.ee_type,
1727 __entry->ee.ee_code,
1728 __entry->ee.ee_info,
1729 __entry->ee.ee_data,
1730 __entry->ee.ee_errno,
1731 &__entry->srx.transport)
1734 TRACE_EVENT(rxrpc_tx_fail,
1735 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
1736 enum rxrpc_tx_point where),
1738 TP_ARGS(debug_id, serial, ret, where),
1741 __field(unsigned int, debug_id)
1742 __field(rxrpc_serial_t, serial)
1744 __field(enum rxrpc_tx_point, where)
1748 __entry->debug_id = debug_id;
1749 __entry->serial = serial;
1751 __entry->where = where;
1754 TP_printk("c=%08x r=%x ret=%d %s",
1758 __print_symbolic(__entry->where, rxrpc_tx_points))
1761 TRACE_EVENT(rxrpc_call_reset,
1762 TP_PROTO(struct rxrpc_call *call),
1767 __field(unsigned int, debug_id)
1769 __field(u32, call_id)
1770 __field(rxrpc_serial_t, call_serial)
1771 __field(rxrpc_serial_t, conn_serial)
1772 __field(rxrpc_seq_t, tx_seq)
1773 __field(rxrpc_seq_t, rx_seq)
1777 __entry->debug_id = call->debug_id;
1778 __entry->cid = call->cid;
1779 __entry->call_id = call->call_id;
1780 __entry->call_serial = call->rx_serial;
1781 __entry->conn_serial = call->conn->hi_serial;
1782 __entry->tx_seq = call->acks_hard_ack;
1783 __entry->rx_seq = call->rx_highest_seq;
1786 TP_printk("c=%08x %08x:%08x r=%08x/%08x tx=%08x rx=%08x",
1788 __entry->cid, __entry->call_id,
1789 __entry->call_serial, __entry->conn_serial,
1790 __entry->tx_seq, __entry->rx_seq)
1793 TRACE_EVENT(rxrpc_notify_socket,
1794 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial),
1796 TP_ARGS(debug_id, serial),
1799 __field(unsigned int, debug_id)
1800 __field(rxrpc_serial_t, serial)
1804 __entry->debug_id = debug_id;
1805 __entry->serial = serial;
1808 TP_printk("c=%08x r=%08x",
1813 TRACE_EVENT(rxrpc_rx_discard_ack,
1814 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial,
1815 rxrpc_seq_t first_soft_ack, rxrpc_seq_t call_ackr_first,
1816 rxrpc_seq_t prev_pkt, rxrpc_seq_t call_ackr_prev),
1818 TP_ARGS(debug_id, serial, first_soft_ack, call_ackr_first,
1819 prev_pkt, call_ackr_prev),
1822 __field(unsigned int, debug_id)
1823 __field(rxrpc_serial_t, serial)
1824 __field(rxrpc_seq_t, first_soft_ack)
1825 __field(rxrpc_seq_t, call_ackr_first)
1826 __field(rxrpc_seq_t, prev_pkt)
1827 __field(rxrpc_seq_t, call_ackr_prev)
1831 __entry->debug_id = debug_id;
1832 __entry->serial = serial;
1833 __entry->first_soft_ack = first_soft_ack;
1834 __entry->call_ackr_first = call_ackr_first;
1835 __entry->prev_pkt = prev_pkt;
1836 __entry->call_ackr_prev = call_ackr_prev;
1839 TP_printk("c=%08x r=%08x %08x<%08x %08x<%08x",
1842 __entry->first_soft_ack,
1843 __entry->call_ackr_first,
1845 __entry->call_ackr_prev)
1848 TRACE_EVENT(rxrpc_req_ack,
1849 TP_PROTO(unsigned int call_debug_id, rxrpc_seq_t seq,
1850 enum rxrpc_req_ack_trace why),
1852 TP_ARGS(call_debug_id, seq, why),
1855 __field(unsigned int, call_debug_id)
1856 __field(rxrpc_seq_t, seq)
1857 __field(enum rxrpc_req_ack_trace, why)
1861 __entry->call_debug_id = call_debug_id;
1866 TP_printk("c=%08x q=%08x REQ-%s",
1867 __entry->call_debug_id,
1869 __print_symbolic(__entry->why, rxrpc_req_ack_traces))
1872 TRACE_EVENT(rxrpc_txbuf,
1873 TP_PROTO(unsigned int debug_id,
1874 unsigned int call_debug_id, rxrpc_seq_t seq,
1875 int ref, enum rxrpc_txbuf_trace what),
1877 TP_ARGS(debug_id, call_debug_id, seq, ref, what),
1880 __field(unsigned int, debug_id)
1881 __field(unsigned int, call_debug_id)
1882 __field(rxrpc_seq_t, seq)
1884 __field(enum rxrpc_txbuf_trace, what)
1888 __entry->debug_id = debug_id;
1889 __entry->call_debug_id = call_debug_id;
1892 __entry->what = what;
1895 TP_printk("B=%08x c=%08x q=%08x %s r=%d",
1897 __entry->call_debug_id,
1899 __print_symbolic(__entry->what, rxrpc_txbuf_traces),
1903 TRACE_EVENT(rxrpc_poke_call,
1904 TP_PROTO(struct rxrpc_call *call, bool busy,
1905 enum rxrpc_call_poke_trace what),
1907 TP_ARGS(call, busy, what),
1910 __field(unsigned int, call_debug_id)
1912 __field(enum rxrpc_call_poke_trace, what)
1916 __entry->call_debug_id = call->debug_id;
1917 __entry->busy = busy;
1918 __entry->what = what;
1921 TP_printk("c=%08x %s%s",
1922 __entry->call_debug_id,
1923 __print_symbolic(__entry->what, rxrpc_call_poke_traces),
1924 __entry->busy ? "!" : "")
1927 TRACE_EVENT(rxrpc_call_poked,
1928 TP_PROTO(struct rxrpc_call *call),
1933 __field(unsigned int, call_debug_id)
1937 __entry->call_debug_id = call->debug_id;
1941 __entry->call_debug_id)
1944 TRACE_EVENT(rxrpc_sack,
1945 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
1946 unsigned int sack, enum rxrpc_sack_trace what),
1948 TP_ARGS(call, seq, sack, what),
1951 __field(unsigned int, call_debug_id)
1952 __field(rxrpc_seq_t, seq)
1953 __field(unsigned int, sack)
1954 __field(enum rxrpc_sack_trace, what)
1958 __entry->call_debug_id = call->debug_id;
1960 __entry->sack = sack;
1961 __entry->what = what;
1964 TP_printk("c=%08x q=%08x %s k=%x",
1965 __entry->call_debug_id,
1967 __print_symbolic(__entry->what, rxrpc_sack_traces),
1974 #endif /* RXRPC_TRACE_ONLY_DEFINE_ENUMS */
1975 #endif /* _TRACE_RXRPC_H */
1977 /* This part must be outside protection */
1978 #include <trace/define_trace.h>