blob: 6b06cf050bc0a18de433484f94cf47cc4287d354 [file] [log] [blame]
David Howellsdf844fd2016-08-23 15:27:24 +01001/* 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
David Howellse34d4232016-08-30 09:49:29 +010019TRACE_EVENT(rxrpc_call,
David Howellsfff724292016-09-07 14:34:21 +010020 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
David Howells2ab27212016-09-08 11:10:12 +010021 int usage, const void *where, const void *aux),
David Howellse34d4232016-08-30 09:49:29 +010022
David Howells2ab27212016-09-08 11:10:12 +010023 TP_ARGS(call, op, usage, where, aux),
David Howellse34d4232016-08-30 09:49:29 +010024
25 TP_STRUCT__entry(
26 __field(struct rxrpc_call *, call )
27 __field(int, op )
28 __field(int, usage )
David Howellse34d4232016-08-30 09:49:29 +010029 __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;
David Howellse34d4232016-08-30 09:49:29 +010037 __entry->where = where;
38 __entry->aux = aux;
39 ),
40
David Howells2ab27212016-09-08 11:10:12 +010041 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
David Howellse34d4232016-08-30 09:49:29 +010042 __entry->call,
David Howellsfff724292016-09-07 14:34:21 +010043 rxrpc_call_traces[__entry->op],
David Howellse34d4232016-08-30 09:49:29 +010044 __entry->usage,
David Howellse34d4232016-08-30 09:49:29 +010045 __entry->where,
46 __entry->aux)
47 );
48
David Howellsdf844fd2016-08-23 15:27:24 +010049TRACE_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
David Howells5a429762016-09-06 22:19:51 +010083TRACE_EVENT(rxrpc_abort,
84 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq,
85 int abort_code, int error),
86
87 TP_ARGS(why, cid, call_id, seq, abort_code, error),
88
89 TP_STRUCT__entry(
90 __array(char, why, 4 )
91 __field(u32, cid )
92 __field(u32, call_id )
93 __field(rxrpc_seq_t, seq )
94 __field(int, abort_code )
95 __field(int, error )
96 ),
97
98 TP_fast_assign(
99 memcpy(__entry->why, why, 4);
100 __entry->cid = cid;
101 __entry->call_id = call_id;
102 __entry->abort_code = abort_code;
103 __entry->error = error;
104 __entry->seq = seq;
105 ),
106
107 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
108 __entry->cid, __entry->call_id, __entry->seq,
109 __entry->abort_code, __entry->error, __entry->why)
110 );
111
David Howellsdf844fd2016-08-23 15:27:24 +0100112#endif /* _TRACE_RXRPC_H */
113
114/* This part must be outside protection */
115#include <trace/define_trace.h>