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, const void *where, const void *aux), 22 23 TP_ARGS(call, op, usage, where, aux), 24 25 TP_STRUCT__entry( 26 __field(struct rxrpc_call *, call ) 27 __field(int, op ) 28 __field(int, usage ) 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; 37 __entry->where = where; 38 __entry->aux = aux; 39 ), 40 41 TP_printk("c=%p %s u=%d sp=%pSR a=%p", 42 __entry->call, 43 rxrpc_call_traces[__entry->op], 44 __entry->usage, 45 __entry->where, 46 __entry->aux) 47 ); 48 49 TRACE_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 83 TRACE_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 96 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x", 97 __entry->hdr.epoch, __entry->hdr.cid, 98 __entry->hdr.callNumber, __entry->hdr.serviceId, 99 __entry->hdr.serial, __entry->hdr.seq, 100 __entry->hdr.type, __entry->hdr.flags) 101 ); 102 103 TRACE_EVENT(rxrpc_rx_done, 104 TP_PROTO(int result, int abort_code), 105 106 TP_ARGS(result, abort_code), 107 108 TP_STRUCT__entry( 109 __field(int, result ) 110 __field(int, abort_code ) 111 ), 112 113 TP_fast_assign( 114 __entry->result = result; 115 __entry->abort_code = abort_code; 116 ), 117 118 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code) 119 ); 120 121 TRACE_EVENT(rxrpc_abort, 122 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq, 123 int abort_code, int error), 124 125 TP_ARGS(why, cid, call_id, seq, abort_code, error), 126 127 TP_STRUCT__entry( 128 __array(char, why, 4 ) 129 __field(u32, cid ) 130 __field(u32, call_id ) 131 __field(rxrpc_seq_t, seq ) 132 __field(int, abort_code ) 133 __field(int, error ) 134 ), 135 136 TP_fast_assign( 137 memcpy(__entry->why, why, 4); 138 __entry->cid = cid; 139 __entry->call_id = call_id; 140 __entry->abort_code = abort_code; 141 __entry->error = error; 142 __entry->seq = seq; 143 ), 144 145 TP_printk("%08x:%08x s=%u a=%d e=%d %s", 146 __entry->cid, __entry->call_id, __entry->seq, 147 __entry->abort_code, __entry->error, __entry->why) 148 ); 149 150 #endif /* _TRACE_RXRPC_H */ 151 152 /* This part must be outside protection */ 153 #include <trace/define_trace.h> 154