]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/trace/events/rxrpc.h
rxrpc: Add some additional call tracing
[mirror_ubuntu-artful-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
e34d4234 19TRACE_EVENT(rxrpc_call,
fff72429 20 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
2ab27215 21 int usage, const void *where, const void *aux),
e34d4234 22
2ab27215 23 TP_ARGS(call, op, usage, where, aux),
e34d4234
DH
24
25 TP_STRUCT__entry(
26 __field(struct rxrpc_call *, call )
27 __field(int, op )
28 __field(int, usage )
e34d4234
DH
29 __field(const void *, where )
30 __field(const void *, aux )
31 ),
32
33 TP_fast_assign(
34 __entry->call = call;
35 __entry->op = op;
36 __entry->usage = usage;
e34d4234
DH
37 __entry->where = where;
38 __entry->aux = aux;
39 ),
40
2ab27215 41 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
e34d4234 42 __entry->call,
fff72429 43 rxrpc_call_traces[__entry->op],
e34d4234 44 __entry->usage,
e34d4234
DH
45 __entry->where,
46 __entry->aux)
47 );
48
df844fd4
DH
49TRACE_EVENT(rxrpc_skb,
50 TP_PROTO(struct sk_buff *skb, int op, int usage, int mod_count,
51 const void *where),
52
53 TP_ARGS(skb, op, usage, mod_count, where),
54
55 TP_STRUCT__entry(
56 __field(struct sk_buff *, skb )
57 __field(int, op )
58 __field(int, usage )
59 __field(int, mod_count )
60 __field(const void *, where )
61 ),
62
63 TP_fast_assign(
64 __entry->skb = skb;
65 __entry->op = op;
66 __entry->usage = usage;
67 __entry->mod_count = mod_count;
68 __entry->where = where;
69 ),
70
71 TP_printk("s=%p %s u=%d m=%d p=%pSR",
72 __entry->skb,
73 (__entry->op == 0 ? "NEW" :
74 __entry->op == 1 ? "SEE" :
75 __entry->op == 2 ? "GET" :
76 __entry->op == 3 ? "FRE" :
77 "PUR"),
78 __entry->usage,
79 __entry->mod_count,
80 __entry->where)
81 );
82
49e19ec7
DH
83TRACE_EVENT(rxrpc_rx_packet,
84 TP_PROTO(struct rxrpc_skb_priv *sp),
85
86 TP_ARGS(sp),
87
88 TP_STRUCT__entry(
89 __field_struct(struct rxrpc_host_header, hdr )
90 ),
91
92 TP_fast_assign(
93 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
94 ),
95
a3868bfc 96 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
49e19ec7
DH
97 __entry->hdr.epoch, __entry->hdr.cid,
98 __entry->hdr.callNumber, __entry->hdr.serviceId,
99 __entry->hdr.serial, __entry->hdr.seq,
a3868bfc
DH
100 __entry->hdr.type, __entry->hdr.flags,
101 __entry->hdr.type <= 15 ? rxrpc_pkts[__entry->hdr.type] : "?UNK")
49e19ec7
DH
102 );
103
104TRACE_EVENT(rxrpc_rx_done,
105 TP_PROTO(int result, int abort_code),
106
107 TP_ARGS(result, abort_code),
108
109 TP_STRUCT__entry(
110 __field(int, result )
111 __field(int, abort_code )
112 ),
113
114 TP_fast_assign(
115 __entry->result = result;
116 __entry->abort_code = abort_code;
117 ),
118
119 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
120 );
121
5a42976d
DH
122TRACE_EVENT(rxrpc_abort,
123 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq,
124 int abort_code, int error),
125
126 TP_ARGS(why, cid, call_id, seq, abort_code, error),
127
128 TP_STRUCT__entry(
129 __array(char, why, 4 )
130 __field(u32, cid )
131 __field(u32, call_id )
132 __field(rxrpc_seq_t, seq )
133 __field(int, abort_code )
134 __field(int, error )
135 ),
136
137 TP_fast_assign(
138 memcpy(__entry->why, why, 4);
139 __entry->cid = cid;
140 __entry->call_id = call_id;
141 __entry->abort_code = abort_code;
142 __entry->error = error;
143 __entry->seq = seq;
144 ),
145
146 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
147 __entry->cid, __entry->call_id, __entry->seq,
148 __entry->abort_code, __entry->error, __entry->why)
149 );
150
df844fd4
DH
151#endif /* _TRACE_RXRPC_H */
152
153/* This part must be outside protection */
154#include <trace/define_trace.h>