Commit | Line | Data |
---|---|---|
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 | 19 | TRACE_EVENT(rxrpc_call, |
fff72429 DH |
20 | TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op, |
21 | int usage, int nskb, | |
e34d4234 DH |
22 | const void *where, const void *aux), |
23 | ||
24 | TP_ARGS(call, op, usage, nskb, where, aux), | |
25 | ||
26 | TP_STRUCT__entry( | |
27 | __field(struct rxrpc_call *, call ) | |
28 | __field(int, op ) | |
29 | __field(int, usage ) | |
30 | __field(int, nskb ) | |
31 | __field(const void *, where ) | |
32 | __field(const void *, aux ) | |
33 | ), | |
34 | ||
35 | TP_fast_assign( | |
36 | __entry->call = call; | |
37 | __entry->op = op; | |
38 | __entry->usage = usage; | |
39 | __entry->nskb = nskb; | |
40 | __entry->where = where; | |
41 | __entry->aux = aux; | |
42 | ), | |
43 | ||
44 | TP_printk("c=%p %s u=%d s=%d p=%pSR a=%p", | |
45 | __entry->call, | |
fff72429 | 46 | rxrpc_call_traces[__entry->op], |
e34d4234 DH |
47 | __entry->usage, |
48 | __entry->nskb, | |
49 | __entry->where, | |
50 | __entry->aux) | |
51 | ); | |
52 | ||
df844fd4 DH |
53 | TRACE_EVENT(rxrpc_skb, |
54 | TP_PROTO(struct sk_buff *skb, int op, int usage, int mod_count, | |
55 | const void *where), | |
56 | ||
57 | TP_ARGS(skb, op, usage, mod_count, where), | |
58 | ||
59 | TP_STRUCT__entry( | |
60 | __field(struct sk_buff *, skb ) | |
61 | __field(int, op ) | |
62 | __field(int, usage ) | |
63 | __field(int, mod_count ) | |
64 | __field(const void *, where ) | |
65 | ), | |
66 | ||
67 | TP_fast_assign( | |
68 | __entry->skb = skb; | |
69 | __entry->op = op; | |
70 | __entry->usage = usage; | |
71 | __entry->mod_count = mod_count; | |
72 | __entry->where = where; | |
73 | ), | |
74 | ||
75 | TP_printk("s=%p %s u=%d m=%d p=%pSR", | |
76 | __entry->skb, | |
77 | (__entry->op == 0 ? "NEW" : | |
78 | __entry->op == 1 ? "SEE" : | |
79 | __entry->op == 2 ? "GET" : | |
80 | __entry->op == 3 ? "FRE" : | |
81 | "PUR"), | |
82 | __entry->usage, | |
83 | __entry->mod_count, | |
84 | __entry->where) | |
85 | ); | |
86 | ||
5a42976d DH |
87 | TRACE_EVENT(rxrpc_abort, |
88 | TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq, | |
89 | int abort_code, int error), | |
90 | ||
91 | TP_ARGS(why, cid, call_id, seq, abort_code, error), | |
92 | ||
93 | TP_STRUCT__entry( | |
94 | __array(char, why, 4 ) | |
95 | __field(u32, cid ) | |
96 | __field(u32, call_id ) | |
97 | __field(rxrpc_seq_t, seq ) | |
98 | __field(int, abort_code ) | |
99 | __field(int, error ) | |
100 | ), | |
101 | ||
102 | TP_fast_assign( | |
103 | memcpy(__entry->why, why, 4); | |
104 | __entry->cid = cid; | |
105 | __entry->call_id = call_id; | |
106 | __entry->abort_code = abort_code; | |
107 | __entry->error = error; | |
108 | __entry->seq = seq; | |
109 | ), | |
110 | ||
111 | TP_printk("%08x:%08x s=%u a=%d e=%d %s", | |
112 | __entry->cid, __entry->call_id, __entry->seq, | |
113 | __entry->abort_code, __entry->error, __entry->why) | |
114 | ); | |
115 | ||
df844fd4 DH |
116 | #endif /* _TRACE_RXRPC_H */ |
117 | ||
118 | /* This part must be outside protection */ | |
119 | #include <trace/define_trace.h> |