xref: /openbmc/linux/include/trace/events/rxrpc.h (revision 5a42976d4fe5d7fddce133de995c742c87b1b7e3)
1df844fd4SDavid Howells /* AF_RXRPC tracepoints
2df844fd4SDavid Howells  *
3df844fd4SDavid Howells  * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
4df844fd4SDavid Howells  * Written by David Howells (dhowells@redhat.com)
5df844fd4SDavid Howells  *
6df844fd4SDavid Howells  * This program is free software; you can redistribute it and/or
7df844fd4SDavid Howells  * modify it under the terms of the GNU General Public Licence
8df844fd4SDavid Howells  * as published by the Free Software Foundation; either version
9df844fd4SDavid Howells  * 2 of the Licence, or (at your option) any later version.
10df844fd4SDavid Howells  */
11df844fd4SDavid Howells #undef TRACE_SYSTEM
12df844fd4SDavid Howells #define TRACE_SYSTEM rxrpc
13df844fd4SDavid Howells 
14df844fd4SDavid Howells #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
15df844fd4SDavid Howells #define _TRACE_RXRPC_H
16df844fd4SDavid Howells 
17df844fd4SDavid Howells #include <linux/tracepoint.h>
18df844fd4SDavid Howells 
19e34d4234SDavid Howells TRACE_EVENT(rxrpc_call,
20fff72429SDavid Howells 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
21fff72429SDavid Howells 		     int usage, int nskb,
22e34d4234SDavid Howells 		     const void *where, const void *aux),
23e34d4234SDavid Howells 
24e34d4234SDavid Howells 	    TP_ARGS(call, op, usage, nskb, where, aux),
25e34d4234SDavid Howells 
26e34d4234SDavid Howells 	    TP_STRUCT__entry(
27e34d4234SDavid Howells 		    __field(struct rxrpc_call *,	call		)
28e34d4234SDavid Howells 		    __field(int,			op		)
29e34d4234SDavid Howells 		    __field(int,			usage		)
30e34d4234SDavid Howells 		    __field(int,			nskb		)
31e34d4234SDavid Howells 		    __field(const void *,		where		)
32e34d4234SDavid Howells 		    __field(const void *,		aux		)
33e34d4234SDavid Howells 			     ),
34e34d4234SDavid Howells 
35e34d4234SDavid Howells 	    TP_fast_assign(
36e34d4234SDavid Howells 		    __entry->call = call;
37e34d4234SDavid Howells 		    __entry->op = op;
38e34d4234SDavid Howells 		    __entry->usage = usage;
39e34d4234SDavid Howells 		    __entry->nskb = nskb;
40e34d4234SDavid Howells 		    __entry->where = where;
41e34d4234SDavid Howells 		    __entry->aux = aux;
42e34d4234SDavid Howells 			   ),
43e34d4234SDavid Howells 
44e34d4234SDavid Howells 	    TP_printk("c=%p %s u=%d s=%d p=%pSR a=%p",
45e34d4234SDavid Howells 		      __entry->call,
46fff72429SDavid Howells 		      rxrpc_call_traces[__entry->op],
47e34d4234SDavid Howells 		      __entry->usage,
48e34d4234SDavid Howells 		      __entry->nskb,
49e34d4234SDavid Howells 		      __entry->where,
50e34d4234SDavid Howells 		      __entry->aux)
51e34d4234SDavid Howells 	    );
52e34d4234SDavid Howells 
53df844fd4SDavid Howells TRACE_EVENT(rxrpc_skb,
54df844fd4SDavid Howells 	    TP_PROTO(struct sk_buff *skb, int op, int usage, int mod_count,
55df844fd4SDavid Howells 		     const void *where),
56df844fd4SDavid Howells 
57df844fd4SDavid Howells 	    TP_ARGS(skb, op, usage, mod_count, where),
58df844fd4SDavid Howells 
59df844fd4SDavid Howells 	    TP_STRUCT__entry(
60df844fd4SDavid Howells 		    __field(struct sk_buff *,		skb		)
61df844fd4SDavid Howells 		    __field(int,			op		)
62df844fd4SDavid Howells 		    __field(int,			usage		)
63df844fd4SDavid Howells 		    __field(int,			mod_count	)
64df844fd4SDavid Howells 		    __field(const void *,		where		)
65df844fd4SDavid Howells 			     ),
66df844fd4SDavid Howells 
67df844fd4SDavid Howells 	    TP_fast_assign(
68df844fd4SDavid Howells 		    __entry->skb = skb;
69df844fd4SDavid Howells 		    __entry->op = op;
70df844fd4SDavid Howells 		    __entry->usage = usage;
71df844fd4SDavid Howells 		    __entry->mod_count = mod_count;
72df844fd4SDavid Howells 		    __entry->where = where;
73df844fd4SDavid Howells 			   ),
74df844fd4SDavid Howells 
75df844fd4SDavid Howells 	    TP_printk("s=%p %s u=%d m=%d p=%pSR",
76df844fd4SDavid Howells 		      __entry->skb,
77df844fd4SDavid Howells 		      (__entry->op == 0 ? "NEW" :
78df844fd4SDavid Howells 		       __entry->op == 1 ? "SEE" :
79df844fd4SDavid Howells 		       __entry->op == 2 ? "GET" :
80df844fd4SDavid Howells 		       __entry->op == 3 ? "FRE" :
81df844fd4SDavid Howells 		       "PUR"),
82df844fd4SDavid Howells 		      __entry->usage,
83df844fd4SDavid Howells 		      __entry->mod_count,
84df844fd4SDavid Howells 		      __entry->where)
85df844fd4SDavid Howells 	    );
86df844fd4SDavid Howells 
87*5a42976dSDavid Howells TRACE_EVENT(rxrpc_abort,
88*5a42976dSDavid Howells 	    TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq,
89*5a42976dSDavid Howells 		     int abort_code, int error),
90*5a42976dSDavid Howells 
91*5a42976dSDavid Howells 	    TP_ARGS(why, cid, call_id, seq, abort_code, error),
92*5a42976dSDavid Howells 
93*5a42976dSDavid Howells 	    TP_STRUCT__entry(
94*5a42976dSDavid Howells 		    __array(char,			why, 4		)
95*5a42976dSDavid Howells 		    __field(u32,			cid		)
96*5a42976dSDavid Howells 		    __field(u32,			call_id		)
97*5a42976dSDavid Howells 		    __field(rxrpc_seq_t,		seq		)
98*5a42976dSDavid Howells 		    __field(int,			abort_code	)
99*5a42976dSDavid Howells 		    __field(int,			error		)
100*5a42976dSDavid Howells 			     ),
101*5a42976dSDavid Howells 
102*5a42976dSDavid Howells 	    TP_fast_assign(
103*5a42976dSDavid Howells 		    memcpy(__entry->why, why, 4);
104*5a42976dSDavid Howells 		    __entry->cid = cid;
105*5a42976dSDavid Howells 		    __entry->call_id = call_id;
106*5a42976dSDavid Howells 		    __entry->abort_code = abort_code;
107*5a42976dSDavid Howells 		    __entry->error = error;
108*5a42976dSDavid Howells 		    __entry->seq = seq;
109*5a42976dSDavid Howells 			   ),
110*5a42976dSDavid Howells 
111*5a42976dSDavid Howells 	    TP_printk("%08x:%08x s=%u a=%d e=%d %s",
112*5a42976dSDavid Howells 		      __entry->cid, __entry->call_id, __entry->seq,
113*5a42976dSDavid Howells 		      __entry->abort_code, __entry->error, __entry->why)
114*5a42976dSDavid Howells 	    );
115*5a42976dSDavid Howells 
116df844fd4SDavid Howells #endif /* _TRACE_RXRPC_H */
117df844fd4SDavid Howells 
118df844fd4SDavid Howells /* This part must be outside protection */
119df844fd4SDavid Howells #include <trace/define_trace.h>
120