]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/trace/events/rxrpc.h
rxrpc: Add a tracepoint to log received ACK packets
[mirror_ubuntu-bionic-kernel.git] / include / trace / events / rxrpc.h
CommitLineData
df844fd4
DH
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
14#if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
15#define _TRACE_RXRPC_H
16
17#include <linux/tracepoint.h>
18
363deeab
DH
19TRACE_EVENT(rxrpc_conn,
20 TP_PROTO(struct rxrpc_connection *conn, enum rxrpc_conn_trace op,
21 int usage, const void *where),
22
23 TP_ARGS(conn, op, usage, where),
24
25 TP_STRUCT__entry(
26 __field(struct rxrpc_connection *, conn )
27 __field(int, op )
28 __field(int, usage )
29 __field(const void *, where )
30 ),
31
32 TP_fast_assign(
33 __entry->conn = conn;
34 __entry->op = op;
35 __entry->usage = usage;
36 __entry->where = where;
37 ),
38
39 TP_printk("C=%p %s u=%d sp=%pSR",
40 __entry->conn,
41 rxrpc_conn_traces[__entry->op],
42 __entry->usage,
43 __entry->where)
44 );
45
46TRACE_EVENT(rxrpc_client,
47 TP_PROTO(struct rxrpc_connection *conn, int channel,
48 enum rxrpc_client_trace op),
49
50 TP_ARGS(conn, channel, op),
51
52 TP_STRUCT__entry(
53 __field(struct rxrpc_connection *, conn )
54 __field(u32, cid )
55 __field(int, channel )
56 __field(int, usage )
57 __field(enum rxrpc_client_trace, op )
58 __field(enum rxrpc_conn_cache_state, cs )
59 ),
60
61 TP_fast_assign(
62 __entry->conn = conn;
63 __entry->channel = channel;
64 __entry->usage = atomic_read(&conn->usage);
65 __entry->op = op;
66 __entry->cid = conn->proto.cid;
67 __entry->cs = conn->cache_state;
68 ),
69
70 TP_printk("C=%p h=%2d %s %s i=%08x u=%d",
71 __entry->conn,
72 __entry->channel,
73 rxrpc_client_traces[__entry->op],
74 rxrpc_conn_cache_states[__entry->cs],
75 __entry->cid,
76 __entry->usage)
77 );
78
e34d4234 79TRACE_EVENT(rxrpc_call,
fff72429 80 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
2ab27215 81 int usage, const void *where, const void *aux),
e34d4234 82
2ab27215 83 TP_ARGS(call, op, usage, where, aux),
e34d4234
DH
84
85 TP_STRUCT__entry(
86 __field(struct rxrpc_call *, call )
87 __field(int, op )
88 __field(int, usage )
e34d4234
DH
89 __field(const void *, where )
90 __field(const void *, aux )
91 ),
92
93 TP_fast_assign(
94 __entry->call = call;
95 __entry->op = op;
96 __entry->usage = usage;
e34d4234
DH
97 __entry->where = where;
98 __entry->aux = aux;
99 ),
100
2ab27215 101 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
e34d4234 102 __entry->call,
fff72429 103 rxrpc_call_traces[__entry->op],
e34d4234 104 __entry->usage,
e34d4234
DH
105 __entry->where,
106 __entry->aux)
107 );
108
df844fd4
DH
109TRACE_EVENT(rxrpc_skb,
110 TP_PROTO(struct sk_buff *skb, int op, int usage, int mod_count,
111 const void *where),
112
113 TP_ARGS(skb, op, usage, mod_count, where),
114
115 TP_STRUCT__entry(
116 __field(struct sk_buff *, skb )
117 __field(int, op )
118 __field(int, usage )
119 __field(int, mod_count )
120 __field(const void *, where )
121 ),
122
123 TP_fast_assign(
124 __entry->skb = skb;
125 __entry->op = op;
126 __entry->usage = usage;
127 __entry->mod_count = mod_count;
128 __entry->where = where;
129 ),
130
131 TP_printk("s=%p %s u=%d m=%d p=%pSR",
132 __entry->skb,
133 (__entry->op == 0 ? "NEW" :
134 __entry->op == 1 ? "SEE" :
135 __entry->op == 2 ? "GET" :
136 __entry->op == 3 ? "FRE" :
137 "PUR"),
138 __entry->usage,
139 __entry->mod_count,
140 __entry->where)
141 );
142
49e19ec7
DH
143TRACE_EVENT(rxrpc_rx_packet,
144 TP_PROTO(struct rxrpc_skb_priv *sp),
145
146 TP_ARGS(sp),
147
148 TP_STRUCT__entry(
149 __field_struct(struct rxrpc_host_header, hdr )
150 ),
151
152 TP_fast_assign(
153 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
154 ),
155
a3868bfc 156 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
49e19ec7
DH
157 __entry->hdr.epoch, __entry->hdr.cid,
158 __entry->hdr.callNumber, __entry->hdr.serviceId,
159 __entry->hdr.serial, __entry->hdr.seq,
a3868bfc
DH
160 __entry->hdr.type, __entry->hdr.flags,
161 __entry->hdr.type <= 15 ? rxrpc_pkts[__entry->hdr.type] : "?UNK")
49e19ec7
DH
162 );
163
164TRACE_EVENT(rxrpc_rx_done,
165 TP_PROTO(int result, int abort_code),
166
167 TP_ARGS(result, abort_code),
168
169 TP_STRUCT__entry(
170 __field(int, result )
171 __field(int, abort_code )
172 ),
173
174 TP_fast_assign(
175 __entry->result = result;
176 __entry->abort_code = abort_code;
177 ),
178
179 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
180 );
181
5a42976d
DH
182TRACE_EVENT(rxrpc_abort,
183 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq,
184 int abort_code, int error),
185
186 TP_ARGS(why, cid, call_id, seq, abort_code, error),
187
188 TP_STRUCT__entry(
189 __array(char, why, 4 )
190 __field(u32, cid )
191 __field(u32, call_id )
192 __field(rxrpc_seq_t, seq )
193 __field(int, abort_code )
194 __field(int, error )
195 ),
196
197 TP_fast_assign(
198 memcpy(__entry->why, why, 4);
199 __entry->cid = cid;
200 __entry->call_id = call_id;
201 __entry->abort_code = abort_code;
202 __entry->error = error;
203 __entry->seq = seq;
204 ),
205
206 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
207 __entry->cid, __entry->call_id, __entry->seq,
208 __entry->abort_code, __entry->error, __entry->why)
209 );
210
a124fe3e
DH
211TRACE_EVENT(rxrpc_transmit,
212 TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
213
214 TP_ARGS(call, why),
215
216 TP_STRUCT__entry(
217 __field(struct rxrpc_call *, call )
218 __field(enum rxrpc_transmit_trace, why )
219 __field(rxrpc_seq_t, tx_hard_ack )
220 __field(rxrpc_seq_t, tx_top )
221 ),
222
223 TP_fast_assign(
224 __entry->call = call;
225 __entry->why = why;
226 __entry->tx_hard_ack = call->tx_hard_ack;
227 __entry->tx_top = call->tx_top;
228 ),
229
230 TP_printk("c=%p %s f=%08x n=%u",
231 __entry->call,
232 rxrpc_transmit_traces[__entry->why],
233 __entry->tx_hard_ack + 1,
234 __entry->tx_top - __entry->tx_hard_ack)
235 );
236
ec71eb9a
DH
237TRACE_EVENT(rxrpc_rx_ack,
238 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t first, u8 reason, u8 n_acks),
239
240 TP_ARGS(call, first, reason, n_acks),
241
242 TP_STRUCT__entry(
243 __field(struct rxrpc_call *, call )
244 __field(rxrpc_seq_t, first )
245 __field(u8, reason )
246 __field(u8, n_acks )
247 ),
248
249 TP_fast_assign(
250 __entry->call = call;
251 __entry->first = first;
252 __entry->reason = reason;
253 __entry->n_acks = n_acks;
254 ),
255
256 TP_printk("c=%p %s f=%08x n=%u",
257 __entry->call,
258 rxrpc_acks(__entry->reason),
259 __entry->first,
260 __entry->n_acks)
261 );
262
df844fd4
DH
263#endif /* _TRACE_RXRPC_H */
264
265/* This part must be outside protection */
266#include <trace/define_trace.h>