sctp.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM sctp
  4. #if !defined(_TRACE_SCTP_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_SCTP_H
  6. #include <net/sctp/structs.h>
  7. #include <linux/tracepoint.h>
  8. TRACE_EVENT(sctp_probe_path,
  9. TP_PROTO(struct sctp_transport *sp,
  10. const struct sctp_association *asoc),
  11. TP_ARGS(sp, asoc),
  12. TP_STRUCT__entry(
  13. __field(__u64, asoc)
  14. __field(__u32, primary)
  15. __array(__u8, ipaddr, sizeof(union sctp_addr))
  16. __field(__u32, state)
  17. __field(__u32, cwnd)
  18. __field(__u32, ssthresh)
  19. __field(__u32, flight_size)
  20. __field(__u32, partial_bytes_acked)
  21. __field(__u32, pathmtu)
  22. ),
  23. TP_fast_assign(
  24. __entry->asoc = (unsigned long)asoc;
  25. __entry->primary = (sp == asoc->peer.primary_path);
  26. memcpy(__entry->ipaddr, &sp->ipaddr, sizeof(union sctp_addr));
  27. __entry->state = sp->state;
  28. __entry->cwnd = sp->cwnd;
  29. __entry->ssthresh = sp->ssthresh;
  30. __entry->flight_size = sp->flight_size;
  31. __entry->partial_bytes_acked = sp->partial_bytes_acked;
  32. __entry->pathmtu = sp->pathmtu;
  33. ),
  34. TP_printk("asoc=%#llx%s ipaddr=%pISpc state=%u cwnd=%u ssthresh=%u "
  35. "flight_size=%u partial_bytes_acked=%u pathmtu=%u",
  36. __entry->asoc, __entry->primary ? "(*)" : "",
  37. __entry->ipaddr, __entry->state, __entry->cwnd,
  38. __entry->ssthresh, __entry->flight_size,
  39. __entry->partial_bytes_acked, __entry->pathmtu)
  40. );
  41. TRACE_EVENT(sctp_probe,
  42. TP_PROTO(const struct sctp_endpoint *ep,
  43. const struct sctp_association *asoc,
  44. struct sctp_chunk *chunk),
  45. TP_ARGS(ep, asoc, chunk),
  46. TP_STRUCT__entry(
  47. __field(__u64, asoc)
  48. __field(__u32, mark)
  49. __field(__u16, bind_port)
  50. __field(__u16, peer_port)
  51. __field(__u32, pathmtu)
  52. __field(__u32, rwnd)
  53. __field(__u16, unack_data)
  54. ),
  55. TP_fast_assign(
  56. struct sk_buff *skb = chunk->skb;
  57. __entry->asoc = (unsigned long)asoc;
  58. __entry->mark = skb->mark;
  59. __entry->bind_port = ep->base.bind_addr.port;
  60. __entry->peer_port = asoc->peer.port;
  61. __entry->pathmtu = asoc->pathmtu;
  62. __entry->rwnd = asoc->peer.rwnd;
  63. __entry->unack_data = asoc->unack_data;
  64. if (trace_sctp_probe_path_enabled()) {
  65. struct sctp_transport *sp;
  66. list_for_each_entry(sp, &asoc->peer.transport_addr_list,
  67. transports) {
  68. trace_sctp_probe_path(sp, asoc);
  69. }
  70. }
  71. ),
  72. TP_printk("asoc=%#llx mark=%#x bind_port=%d peer_port=%d pathmtu=%d "
  73. "rwnd=%u unack_data=%d",
  74. __entry->asoc, __entry->mark, __entry->bind_port,
  75. __entry->peer_port, __entry->pathmtu, __entry->rwnd,
  76. __entry->unack_data)
  77. );
  78. #endif /* _TRACE_SCTP_H */
  79. /* This part must be outside protection */
  80. #include <trace/define_trace.h>