1 /* AF_RXRPC tracepoints
3 * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
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.
12 #define TRACE_SYSTEM rxrpc
14 #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
15 #define _TRACE_RXRPC_H
17 #include <linux/tracepoint.h>
19 TRACE_EVENT(rxrpc_conn,
20 TP_PROTO(struct rxrpc_connection *conn, enum rxrpc_conn_trace op,
21 int usage, const void *where),
23 TP_ARGS(conn, op, usage, where),
26 __field(struct rxrpc_connection *, conn )
29 __field(const void *, where )
35 __entry->usage = usage;
36 __entry->where = where;
39 TP_printk("C=%p %s u=%d sp=%pSR",
41 rxrpc_conn_traces[__entry->op],
46 TRACE_EVENT(rxrpc_client,
47 TP_PROTO(struct rxrpc_connection *conn, int channel,
48 enum rxrpc_client_trace op),
50 TP_ARGS(conn, channel, op),
53 __field(struct rxrpc_connection *, conn )
55 __field(int, channel )
57 __field(enum rxrpc_client_trace, op )
58 __field(enum rxrpc_conn_cache_state, cs )
63 __entry->channel = channel;
64 __entry->usage = atomic_read(&conn->usage);
66 __entry->cid = conn->proto.cid;
67 __entry->cs = conn->cache_state;
70 TP_printk("C=%p h=%2d %s %s i=%08x u=%d",
73 rxrpc_client_traces[__entry->op],
74 rxrpc_conn_cache_states[__entry->cs],
79 TRACE_EVENT(rxrpc_call,
80 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
81 int usage, const void *where, const void *aux),
83 TP_ARGS(call, op, usage, where, aux),
86 __field(struct rxrpc_call *, call )
89 __field(const void *, where )
90 __field(const void *, aux )
96 __entry->usage = usage;
97 __entry->where = where;
101 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
103 rxrpc_call_traces[__entry->op],
109 TRACE_EVENT(rxrpc_skb,
110 TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
111 int usage, int mod_count, const void *where),
113 TP_ARGS(skb, op, usage, mod_count, where),
116 __field(struct sk_buff *, skb )
117 __field(enum rxrpc_skb_trace, op )
119 __field(int, mod_count )
120 __field(const void *, where )
126 __entry->usage = usage;
127 __entry->mod_count = mod_count;
128 __entry->where = where;
131 TP_printk("s=%p %s u=%d m=%d p=%pSR",
133 rxrpc_skb_traces[__entry->op],
139 TRACE_EVENT(rxrpc_rx_packet,
140 TP_PROTO(struct rxrpc_skb_priv *sp),
145 __field_struct(struct rxrpc_host_header, hdr )
149 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
152 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
153 __entry->hdr.epoch, __entry->hdr.cid,
154 __entry->hdr.callNumber, __entry->hdr.serviceId,
155 __entry->hdr.serial, __entry->hdr.seq,
156 __entry->hdr.type, __entry->hdr.flags,
157 __entry->hdr.type <= 15 ? rxrpc_pkts[__entry->hdr.type] : "?UNK")
160 TRACE_EVENT(rxrpc_rx_done,
161 TP_PROTO(int result, int abort_code),
163 TP_ARGS(result, abort_code),
166 __field(int, result )
167 __field(int, abort_code )
171 __entry->result = result;
172 __entry->abort_code = abort_code;
175 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
178 TRACE_EVENT(rxrpc_abort,
179 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq,
180 int abort_code, int error),
182 TP_ARGS(why, cid, call_id, seq, abort_code, error),
185 __array(char, why, 4 )
187 __field(u32, call_id )
188 __field(rxrpc_seq_t, seq )
189 __field(int, abort_code )
194 memcpy(__entry->why, why, 4);
196 __entry->call_id = call_id;
197 __entry->abort_code = abort_code;
198 __entry->error = error;
202 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
203 __entry->cid, __entry->call_id, __entry->seq,
204 __entry->abort_code, __entry->error, __entry->why)
207 TRACE_EVENT(rxrpc_transmit,
208 TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
213 __field(struct rxrpc_call *, call )
214 __field(enum rxrpc_transmit_trace, why )
215 __field(rxrpc_seq_t, tx_hard_ack )
216 __field(rxrpc_seq_t, tx_top )
220 __entry->call = call;
222 __entry->tx_hard_ack = call->tx_hard_ack;
223 __entry->tx_top = call->tx_top;
226 TP_printk("c=%p %s f=%08x n=%u",
228 rxrpc_transmit_traces[__entry->why],
229 __entry->tx_hard_ack + 1,
230 __entry->tx_top - __entry->tx_hard_ack)
233 TRACE_EVENT(rxrpc_rx_ack,
234 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t first, u8 reason, u8 n_acks),
236 TP_ARGS(call, first, reason, n_acks),
239 __field(struct rxrpc_call *, call )
240 __field(rxrpc_seq_t, first )
246 __entry->call = call;
247 __entry->first = first;
248 __entry->reason = reason;
249 __entry->n_acks = n_acks;
252 TP_printk("c=%p %s f=%08x n=%u",
254 rxrpc_acks(__entry->reason),
259 TRACE_EVENT(rxrpc_tx_ack,
260 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t first,
261 rxrpc_serial_t serial, u8 reason, u8 n_acks),
263 TP_ARGS(call, first, serial, reason, n_acks),
266 __field(struct rxrpc_call *, call )
267 __field(rxrpc_seq_t, first )
268 __field(rxrpc_serial_t, serial )
274 __entry->call = call;
275 __entry->first = first;
276 __entry->serial = serial;
277 __entry->reason = reason;
278 __entry->n_acks = n_acks;
281 TP_printk("c=%p %s f=%08x r=%08x n=%u",
283 rxrpc_acks(__entry->reason),
289 TRACE_EVENT(rxrpc_receive,
290 TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
291 rxrpc_serial_t serial, rxrpc_seq_t seq),
293 TP_ARGS(call, why, serial, seq),
296 __field(struct rxrpc_call *, call )
297 __field(enum rxrpc_receive_trace, why )
298 __field(rxrpc_serial_t, serial )
299 __field(rxrpc_seq_t, seq )
300 __field(rxrpc_seq_t, hard_ack )
301 __field(rxrpc_seq_t, top )
305 __entry->call = call;
307 __entry->serial = serial;
309 __entry->hard_ack = call->rx_hard_ack;
310 __entry->top = call->rx_top;
313 TP_printk("c=%p %s r=%08x q=%08x w=%08x-%08x",
315 rxrpc_receive_traces[__entry->why],
322 TRACE_EVENT(rxrpc_recvmsg,
323 TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
324 rxrpc_seq_t seq, unsigned int offset, unsigned int len,
327 TP_ARGS(call, why, seq, offset, len, ret),
330 __field(struct rxrpc_call *, call )
331 __field(enum rxrpc_recvmsg_trace, why )
332 __field(rxrpc_seq_t, seq )
333 __field(unsigned int, offset )
334 __field(unsigned int, len )
339 __entry->call = call;
342 __entry->offset = offset;
347 TP_printk("c=%p %s q=%08x o=%u l=%u ret=%d",
349 rxrpc_recvmsg_traces[__entry->why],
356 #endif /* _TRACE_RXRPC_H */
358 /* This part must be outside protection */
359 #include <trace/define_trace.h>