30164896f1f66559c1f00dac1866dc1100c3340e
[linux-block.git] / include / trace / events / rxrpc.h
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
19 TRACE_EVENT(rxrpc_call,
20             TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
21                      int usage, int nskb,
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,
46                       rxrpc_call_traces[__entry->op],
47                       __entry->usage,
48                       __entry->nskb,
49                       __entry->where,
50                       __entry->aux)
51             );
52
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
87 #endif /* _TRACE_RXRPC_H */
88
89 /* This part must be outside protection */
90 #include <trace/define_trace.h>