ib_umad.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
  2. /*
  3. * Copyright (c) 2018 Intel Corporation. All rights reserved.
  4. *
  5. */
  6. #undef TRACE_SYSTEM
  7. #define TRACE_SYSTEM ib_umad
  8. #if !defined(_TRACE_IB_UMAD_H) || defined(TRACE_HEADER_MULTI_READ)
  9. #define _TRACE_IB_UMAD_H
  10. #include <linux/tracepoint.h>
  11. DECLARE_EVENT_CLASS(ib_umad_template,
  12. TP_PROTO(struct ib_umad_file *file, struct ib_user_mad_hdr *umad_hdr,
  13. struct ib_mad_hdr *mad_hdr),
  14. TP_ARGS(file, umad_hdr, mad_hdr),
  15. TP_STRUCT__entry(
  16. __field(u8, port_num)
  17. __field(u8, sl)
  18. __field(u8, path_bits)
  19. __field(u8, grh_present)
  20. __field(u32, id)
  21. __field(u32, status)
  22. __field(u32, timeout_ms)
  23. __field(u32, retires)
  24. __field(u32, length)
  25. __field(u32, qpn)
  26. __field(u32, qkey)
  27. __field(u8, gid_index)
  28. __field(u8, hop_limit)
  29. __field(u16, lid)
  30. __field(u16, attr_id)
  31. __field(u16, pkey_index)
  32. __field(u8, base_version)
  33. __field(u8, mgmt_class)
  34. __field(u8, class_version)
  35. __field(u8, method)
  36. __field(u32, flow_label)
  37. __field(u16, mad_status)
  38. __field(u16, class_specific)
  39. __field(u32, attr_mod)
  40. __field(u64, tid)
  41. __array(u8, gid, 16)
  42. __field(u32, dev_index)
  43. __field(u8, traffic_class)
  44. ),
  45. TP_fast_assign(
  46. __entry->dev_index = file->port->ib_dev->index;
  47. __entry->port_num = file->port->port_num;
  48. __entry->id = umad_hdr->id;
  49. __entry->status = umad_hdr->status;
  50. __entry->timeout_ms = umad_hdr->timeout_ms;
  51. __entry->retires = umad_hdr->retries;
  52. __entry->length = umad_hdr->length;
  53. __entry->qpn = umad_hdr->qpn;
  54. __entry->qkey = umad_hdr->qkey;
  55. __entry->lid = umad_hdr->lid;
  56. __entry->sl = umad_hdr->sl;
  57. __entry->path_bits = umad_hdr->path_bits;
  58. __entry->grh_present = umad_hdr->grh_present;
  59. __entry->gid_index = umad_hdr->gid_index;
  60. __entry->hop_limit = umad_hdr->hop_limit;
  61. __entry->traffic_class = umad_hdr->traffic_class;
  62. memcpy(__entry->gid, umad_hdr->gid, sizeof(umad_hdr->gid));
  63. __entry->flow_label = umad_hdr->flow_label;
  64. __entry->pkey_index = umad_hdr->pkey_index;
  65. __entry->base_version = mad_hdr->base_version;
  66. __entry->mgmt_class = mad_hdr->mgmt_class;
  67. __entry->class_version = mad_hdr->class_version;
  68. __entry->method = mad_hdr->method;
  69. __entry->mad_status = mad_hdr->status;
  70. __entry->class_specific = mad_hdr->class_specific;
  71. __entry->tid = mad_hdr->tid;
  72. __entry->attr_id = mad_hdr->attr_id;
  73. __entry->attr_mod = mad_hdr->attr_mod;
  74. ),
  75. TP_printk("%d:%d umad_hdr: id 0x%08x status 0x%08x ms %u ret %u " \
  76. "len %u QP%u qkey 0x%08x lid 0x%04x sl %u path_bits 0x%x " \
  77. "grh 0x%x gidi %u hop_lim %u traf_cl %u gid %pI6c " \
  78. "flow 0x%08x pkeyi %u MAD: base_ver 0x%x class 0x%x " \
  79. "class_ver 0x%x method 0x%x status 0x%04x " \
  80. "class_specific 0x%04x tid 0x%016llx attr_id 0x%04x " \
  81. "attr_mod 0x%08x ",
  82. __entry->dev_index, __entry->port_num,
  83. __entry->id, __entry->status, __entry->timeout_ms,
  84. __entry->retires, __entry->length, be32_to_cpu(__entry->qpn),
  85. be32_to_cpu(__entry->qkey), be16_to_cpu(__entry->lid),
  86. __entry->sl, __entry->path_bits, __entry->grh_present,
  87. __entry->gid_index, __entry->hop_limit,
  88. __entry->traffic_class, &__entry->gid,
  89. be32_to_cpu(__entry->flow_label), __entry->pkey_index,
  90. __entry->base_version, __entry->mgmt_class,
  91. __entry->class_version, __entry->method,
  92. be16_to_cpu(__entry->mad_status),
  93. be16_to_cpu(__entry->class_specific),
  94. be64_to_cpu(__entry->tid), be16_to_cpu(__entry->attr_id),
  95. be32_to_cpu(__entry->attr_mod)
  96. )
  97. );
  98. DEFINE_EVENT(ib_umad_template, ib_umad_write,
  99. TP_PROTO(struct ib_umad_file *file, struct ib_user_mad_hdr *umad_hdr,
  100. struct ib_mad_hdr *mad_hdr),
  101. TP_ARGS(file, umad_hdr, mad_hdr));
  102. DEFINE_EVENT(ib_umad_template, ib_umad_read_recv,
  103. TP_PROTO(struct ib_umad_file *file, struct ib_user_mad_hdr *umad_hdr,
  104. struct ib_mad_hdr *mad_hdr),
  105. TP_ARGS(file, umad_hdr, mad_hdr));
  106. DEFINE_EVENT(ib_umad_template, ib_umad_read_send,
  107. TP_PROTO(struct ib_umad_file *file, struct ib_user_mad_hdr *umad_hdr,
  108. struct ib_mad_hdr *mad_hdr),
  109. TP_ARGS(file, umad_hdr, mad_hdr));
  110. #endif /* _TRACE_IB_UMAD_H */
  111. #include <trace/define_trace.h>