]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/trace/events/rxrpc.h
8ba8d76e856ad60e04845154e0e0301b818db6c4
[mirror_ubuntu-zesty-kernel.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_conn,
20 TP_PROTO(struct rxrpc_connection *conn, enum rxrpc_conn_trace op,
21 int usage, const void *where),
22
23 TP_ARGS(conn, op, usage, where),
24
25 TP_STRUCT__entry(
26 __field(struct rxrpc_connection *, conn )
27 __field(int, op )
28 __field(int, usage )
29 __field(const void *, where )
30 ),
31
32 TP_fast_assign(
33 __entry->conn = conn;
34 __entry->op = op;
35 __entry->usage = usage;
36 __entry->where = where;
37 ),
38
39 TP_printk("C=%p %s u=%d sp=%pSR",
40 __entry->conn,
41 rxrpc_conn_traces[__entry->op],
42 __entry->usage,
43 __entry->where)
44 );
45
46 TRACE_EVENT(rxrpc_client,
47 TP_PROTO(struct rxrpc_connection *conn, int channel,
48 enum rxrpc_client_trace op),
49
50 TP_ARGS(conn, channel, op),
51
52 TP_STRUCT__entry(
53 __field(struct rxrpc_connection *, conn )
54 __field(u32, cid )
55 __field(int, channel )
56 __field(int, usage )
57 __field(enum rxrpc_client_trace, op )
58 __field(enum rxrpc_conn_cache_state, cs )
59 ),
60
61 TP_fast_assign(
62 __entry->conn = conn;
63 __entry->channel = channel;
64 __entry->usage = atomic_read(&conn->usage);
65 __entry->op = op;
66 __entry->cid = conn->proto.cid;
67 __entry->cs = conn->cache_state;
68 ),
69
70 TP_printk("C=%p h=%2d %s %s i=%08x u=%d",
71 __entry->conn,
72 __entry->channel,
73 rxrpc_client_traces[__entry->op],
74 rxrpc_conn_cache_states[__entry->cs],
75 __entry->cid,
76 __entry->usage)
77 );
78
79 TRACE_EVENT(rxrpc_call,
80 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
81 int usage, const void *where, const void *aux),
82
83 TP_ARGS(call, op, usage, where, aux),
84
85 TP_STRUCT__entry(
86 __field(struct rxrpc_call *, call )
87 __field(int, op )
88 __field(int, usage )
89 __field(const void *, where )
90 __field(const void *, aux )
91 ),
92
93 TP_fast_assign(
94 __entry->call = call;
95 __entry->op = op;
96 __entry->usage = usage;
97 __entry->where = where;
98 __entry->aux = aux;
99 ),
100
101 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
102 __entry->call,
103 rxrpc_call_traces[__entry->op],
104 __entry->usage,
105 __entry->where,
106 __entry->aux)
107 );
108
109 TRACE_EVENT(rxrpc_skb,
110 TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
111 int usage, int mod_count, const void *where),
112
113 TP_ARGS(skb, op, usage, mod_count, where),
114
115 TP_STRUCT__entry(
116 __field(struct sk_buff *, skb )
117 __field(enum rxrpc_skb_trace, op )
118 __field(int, usage )
119 __field(int, mod_count )
120 __field(const void *, where )
121 ),
122
123 TP_fast_assign(
124 __entry->skb = skb;
125 __entry->op = op;
126 __entry->usage = usage;
127 __entry->mod_count = mod_count;
128 __entry->where = where;
129 ),
130
131 TP_printk("s=%p %s u=%d m=%d p=%pSR",
132 __entry->skb,
133 rxrpc_skb_traces[__entry->op],
134 __entry->usage,
135 __entry->mod_count,
136 __entry->where)
137 );
138
139 TRACE_EVENT(rxrpc_rx_packet,
140 TP_PROTO(struct rxrpc_skb_priv *sp),
141
142 TP_ARGS(sp),
143
144 TP_STRUCT__entry(
145 __field_struct(struct rxrpc_host_header, hdr )
146 ),
147
148 TP_fast_assign(
149 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
150 ),
151
152 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
153 __entry->hdr.epoch, __entry->hdr.cid,
154 __entry->hdr.callNumber, __entry->hdr.serviceId,
155 __entry->hdr.serial, __entry->hdr.seq,
156 __entry->hdr.type, __entry->hdr.flags,
157 __entry->hdr.type <= 15 ? rxrpc_pkts[__entry->hdr.type] : "?UNK")
158 );
159
160 TRACE_EVENT(rxrpc_rx_done,
161 TP_PROTO(int result, int abort_code),
162
163 TP_ARGS(result, abort_code),
164
165 TP_STRUCT__entry(
166 __field(int, result )
167 __field(int, abort_code )
168 ),
169
170 TP_fast_assign(
171 __entry->result = result;
172 __entry->abort_code = abort_code;
173 ),
174
175 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
176 );
177
178 TRACE_EVENT(rxrpc_abort,
179 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq,
180 int abort_code, int error),
181
182 TP_ARGS(why, cid, call_id, seq, abort_code, error),
183
184 TP_STRUCT__entry(
185 __array(char, why, 4 )
186 __field(u32, cid )
187 __field(u32, call_id )
188 __field(rxrpc_seq_t, seq )
189 __field(int, abort_code )
190 __field(int, error )
191 ),
192
193 TP_fast_assign(
194 memcpy(__entry->why, why, 4);
195 __entry->cid = cid;
196 __entry->call_id = call_id;
197 __entry->abort_code = abort_code;
198 __entry->error = error;
199 __entry->seq = seq;
200 ),
201
202 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
203 __entry->cid, __entry->call_id, __entry->seq,
204 __entry->abort_code, __entry->error, __entry->why)
205 );
206
207 TRACE_EVENT(rxrpc_transmit,
208 TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
209
210 TP_ARGS(call, why),
211
212 TP_STRUCT__entry(
213 __field(struct rxrpc_call *, call )
214 __field(enum rxrpc_transmit_trace, why )
215 __field(rxrpc_seq_t, tx_hard_ack )
216 __field(rxrpc_seq_t, tx_top )
217 ),
218
219 TP_fast_assign(
220 __entry->call = call;
221 __entry->why = why;
222 __entry->tx_hard_ack = call->tx_hard_ack;
223 __entry->tx_top = call->tx_top;
224 ),
225
226 TP_printk("c=%p %s f=%08x n=%u",
227 __entry->call,
228 rxrpc_transmit_traces[__entry->why],
229 __entry->tx_hard_ack + 1,
230 __entry->tx_top - __entry->tx_hard_ack)
231 );
232
233 TRACE_EVENT(rxrpc_rx_ack,
234 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t first, u8 reason, u8 n_acks),
235
236 TP_ARGS(call, first, reason, n_acks),
237
238 TP_STRUCT__entry(
239 __field(struct rxrpc_call *, call )
240 __field(rxrpc_seq_t, first )
241 __field(u8, reason )
242 __field(u8, n_acks )
243 ),
244
245 TP_fast_assign(
246 __entry->call = call;
247 __entry->first = first;
248 __entry->reason = reason;
249 __entry->n_acks = n_acks;
250 ),
251
252 TP_printk("c=%p %s f=%08x n=%u",
253 __entry->call,
254 rxrpc_ack_names[__entry->reason],
255 __entry->first,
256 __entry->n_acks)
257 );
258
259 TRACE_EVENT(rxrpc_tx_data,
260 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
261 rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
262
263 TP_ARGS(call, seq, serial, flags, retrans, lose),
264
265 TP_STRUCT__entry(
266 __field(struct rxrpc_call *, call )
267 __field(rxrpc_seq_t, seq )
268 __field(rxrpc_serial_t, serial )
269 __field(u8, flags )
270 __field(bool, retrans )
271 __field(bool, lose )
272 ),
273
274 TP_fast_assign(
275 __entry->call = call;
276 __entry->seq = seq;
277 __entry->serial = serial;
278 __entry->flags = flags;
279 __entry->retrans = retrans;
280 __entry->lose = lose;
281 ),
282
283 TP_printk("c=%p DATA %08x q=%08x fl=%02x%s",
284 __entry->call,
285 __entry->serial,
286 __entry->seq,
287 __entry->flags,
288 __entry->lose ? " *LOSE*" : "")
289 );
290
291 TRACE_EVENT(rxrpc_tx_ack,
292 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
293 rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
294 u8 reason, u8 n_acks),
295
296 TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
297
298 TP_STRUCT__entry(
299 __field(struct rxrpc_call *, call )
300 __field(rxrpc_serial_t, serial )
301 __field(rxrpc_seq_t, ack_first )
302 __field(rxrpc_serial_t, ack_serial )
303 __field(u8, reason )
304 __field(u8, n_acks )
305 ),
306
307 TP_fast_assign(
308 __entry->call = call;
309 __entry->serial = serial;
310 __entry->ack_first = ack_first;
311 __entry->ack_serial = ack_serial;
312 __entry->reason = reason;
313 __entry->n_acks = n_acks;
314 ),
315
316 TP_printk(" c=%p ACK %08x %s f=%08x r=%08x n=%u",
317 __entry->call,
318 __entry->serial,
319 rxrpc_ack_names[__entry->reason],
320 __entry->ack_first,
321 __entry->ack_serial,
322 __entry->n_acks)
323 );
324
325 TRACE_EVENT(rxrpc_receive,
326 TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
327 rxrpc_serial_t serial, rxrpc_seq_t seq),
328
329 TP_ARGS(call, why, serial, seq),
330
331 TP_STRUCT__entry(
332 __field(struct rxrpc_call *, call )
333 __field(enum rxrpc_receive_trace, why )
334 __field(rxrpc_serial_t, serial )
335 __field(rxrpc_seq_t, seq )
336 __field(rxrpc_seq_t, hard_ack )
337 __field(rxrpc_seq_t, top )
338 ),
339
340 TP_fast_assign(
341 __entry->call = call;
342 __entry->why = why;
343 __entry->serial = serial;
344 __entry->seq = seq;
345 __entry->hard_ack = call->rx_hard_ack;
346 __entry->top = call->rx_top;
347 ),
348
349 TP_printk("c=%p %s r=%08x q=%08x w=%08x-%08x",
350 __entry->call,
351 rxrpc_receive_traces[__entry->why],
352 __entry->serial,
353 __entry->seq,
354 __entry->hard_ack,
355 __entry->top)
356 );
357
358 TRACE_EVENT(rxrpc_recvmsg,
359 TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
360 rxrpc_seq_t seq, unsigned int offset, unsigned int len,
361 int ret),
362
363 TP_ARGS(call, why, seq, offset, len, ret),
364
365 TP_STRUCT__entry(
366 __field(struct rxrpc_call *, call )
367 __field(enum rxrpc_recvmsg_trace, why )
368 __field(rxrpc_seq_t, seq )
369 __field(unsigned int, offset )
370 __field(unsigned int, len )
371 __field(int, ret )
372 ),
373
374 TP_fast_assign(
375 __entry->call = call;
376 __entry->why = why;
377 __entry->seq = seq;
378 __entry->offset = offset;
379 __entry->len = len;
380 __entry->ret = ret;
381 ),
382
383 TP_printk("c=%p %s q=%08x o=%u l=%u ret=%d",
384 __entry->call,
385 rxrpc_recvmsg_traces[__entry->why],
386 __entry->seq,
387 __entry->offset,
388 __entry->len,
389 __entry->ret)
390 );
391
392 TRACE_EVENT(rxrpc_rtt_tx,
393 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
394 rxrpc_serial_t send_serial),
395
396 TP_ARGS(call, why, send_serial),
397
398 TP_STRUCT__entry(
399 __field(struct rxrpc_call *, call )
400 __field(enum rxrpc_rtt_tx_trace, why )
401 __field(rxrpc_serial_t, send_serial )
402 ),
403
404 TP_fast_assign(
405 __entry->call = call;
406 __entry->why = why;
407 __entry->send_serial = send_serial;
408 ),
409
410 TP_printk("c=%p %s sr=%08x",
411 __entry->call,
412 rxrpc_rtt_tx_traces[__entry->why],
413 __entry->send_serial)
414 );
415
416 TRACE_EVENT(rxrpc_rtt_rx,
417 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
418 rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
419 s64 rtt, u8 nr, s64 avg),
420
421 TP_ARGS(call, why, send_serial, resp_serial, rtt, nr, avg),
422
423 TP_STRUCT__entry(
424 __field(struct rxrpc_call *, call )
425 __field(enum rxrpc_rtt_rx_trace, why )
426 __field(u8, nr )
427 __field(rxrpc_serial_t, send_serial )
428 __field(rxrpc_serial_t, resp_serial )
429 __field(s64, rtt )
430 __field(u64, avg )
431 ),
432
433 TP_fast_assign(
434 __entry->call = call;
435 __entry->why = why;
436 __entry->send_serial = send_serial;
437 __entry->resp_serial = resp_serial;
438 __entry->rtt = rtt;
439 __entry->nr = nr;
440 __entry->avg = avg;
441 ),
442
443 TP_printk("c=%p %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
444 __entry->call,
445 rxrpc_rtt_rx_traces[__entry->why],
446 __entry->send_serial,
447 __entry->resp_serial,
448 __entry->rtt,
449 __entry->nr,
450 __entry->avg)
451 );
452
453 TRACE_EVENT(rxrpc_timer,
454 TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
455 unsigned long now),
456
457 TP_ARGS(call, why, now),
458
459 TP_STRUCT__entry(
460 __field(struct rxrpc_call *, call )
461 __field(enum rxrpc_timer_trace, why )
462 __field(unsigned long, now )
463 __field(unsigned long, expire_at )
464 __field(unsigned long, ack_at )
465 __field(unsigned long, resend_at )
466 __field(unsigned long, timer )
467 ),
468
469 TP_fast_assign(
470 __entry->call = call;
471 __entry->why = why;
472 __entry->now = now;
473 __entry->expire_at = call->expire_at;
474 __entry->ack_at = call->ack_at;
475 __entry->resend_at = call->resend_at;
476 __entry->timer = call->timer.expires;
477 ),
478
479 TP_printk("c=%p %s now=%lx x=%ld a=%ld r=%ld t=%ld",
480 __entry->call,
481 rxrpc_timer_traces[__entry->why],
482 __entry->now,
483 __entry->expire_at - __entry->now,
484 __entry->ack_at - __entry->now,
485 __entry->resend_at - __entry->now,
486 __entry->timer - __entry->now)
487 );
488
489 TRACE_EVENT(rxrpc_rx_lose,
490 TP_PROTO(struct rxrpc_skb_priv *sp),
491
492 TP_ARGS(sp),
493
494 TP_STRUCT__entry(
495 __field_struct(struct rxrpc_host_header, hdr )
496 ),
497
498 TP_fast_assign(
499 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
500 ),
501
502 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
503 __entry->hdr.epoch, __entry->hdr.cid,
504 __entry->hdr.callNumber, __entry->hdr.serviceId,
505 __entry->hdr.serial, __entry->hdr.seq,
506 __entry->hdr.type, __entry->hdr.flags,
507 __entry->hdr.type <= 15 ? rxrpc_pkts[__entry->hdr.type] : "?UNK")
508 );
509
510 TRACE_EVENT(rxrpc_propose_ack,
511 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
512 u8 ack_reason, rxrpc_serial_t serial, bool immediate,
513 bool background, enum rxrpc_propose_ack_outcome outcome),
514
515 TP_ARGS(call, why, ack_reason, serial, immediate, background,
516 outcome),
517
518 TP_STRUCT__entry(
519 __field(struct rxrpc_call *, call )
520 __field(enum rxrpc_propose_ack_trace, why )
521 __field(rxrpc_serial_t, serial )
522 __field(u8, ack_reason )
523 __field(bool, immediate )
524 __field(bool, background )
525 __field(enum rxrpc_propose_ack_outcome, outcome )
526 ),
527
528 TP_fast_assign(
529 __entry->call = call;
530 __entry->why = why;
531 __entry->serial = serial;
532 __entry->ack_reason = ack_reason;
533 __entry->immediate = immediate;
534 __entry->background = background;
535 __entry->outcome = outcome;
536 ),
537
538 TP_printk("c=%p %s %s r=%08x i=%u b=%u%s",
539 __entry->call,
540 rxrpc_propose_ack_traces[__entry->why],
541 rxrpc_ack_names[__entry->ack_reason],
542 __entry->serial,
543 __entry->immediate,
544 __entry->background,
545 rxrpc_propose_ack_outcomes[__entry->outcome])
546 );
547
548 TRACE_EVENT(rxrpc_retransmit,
549 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
550 s64 expiry),
551
552 TP_ARGS(call, seq, annotation, expiry),
553
554 TP_STRUCT__entry(
555 __field(struct rxrpc_call *, call )
556 __field(rxrpc_seq_t, seq )
557 __field(u8, annotation )
558 __field(s64, expiry )
559 ),
560
561 TP_fast_assign(
562 __entry->call = call;
563 __entry->seq = seq;
564 __entry->annotation = annotation;
565 __entry->expiry = expiry;
566 ),
567
568 TP_printk("c=%p q=%x a=%02x xp=%lld",
569 __entry->call,
570 __entry->seq,
571 __entry->annotation,
572 __entry->expiry)
573 );
574
575 TRACE_EVENT(rxrpc_congest,
576 TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
577 rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
578
579 TP_ARGS(call, summary, ack_serial, change),
580
581 TP_STRUCT__entry(
582 __field(struct rxrpc_call *, call )
583 __field(enum rxrpc_congest_change, change )
584 __field(rxrpc_seq_t, hard_ack )
585 __field(rxrpc_seq_t, top )
586 __field(rxrpc_seq_t, lowest_nak )
587 __field(rxrpc_serial_t, ack_serial )
588 __field_struct(struct rxrpc_ack_summary, sum )
589 ),
590
591 TP_fast_assign(
592 __entry->call = call;
593 __entry->change = change;
594 __entry->hard_ack = call->tx_hard_ack;
595 __entry->top = call->tx_top;
596 __entry->lowest_nak = call->acks_lowest_nak;
597 __entry->ack_serial = ack_serial;
598 memcpy(&__entry->sum, summary, sizeof(__entry->sum));
599 ),
600
601 TP_printk("c=%p %08x %s %08x %s cw=%u ss=%u nr=%u,%u nw=%u,%u r=%u b=%u u=%u d=%u l=%x%s%s%s",
602 __entry->call,
603 __entry->ack_serial,
604 rxrpc_ack_names[__entry->sum.ack_reason],
605 __entry->hard_ack,
606 rxrpc_congest_modes[__entry->sum.mode],
607 __entry->sum.cwnd,
608 __entry->sum.ssthresh,
609 __entry->sum.nr_acks, __entry->sum.nr_nacks,
610 __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
611 __entry->sum.nr_rot_new_acks,
612 __entry->top - __entry->hard_ack,
613 __entry->sum.cumulative_acks,
614 __entry->sum.dup_acks,
615 __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
616 rxrpc_congest_changes[__entry->change],
617 __entry->sum.retrans_timeo ? " rTxTo" : "")
618 );
619
620 #endif /* _TRACE_RXRPC_H */
621
622 /* This part must be outside protection */
623 #include <trace/define_trace.h>