trace_rx.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. /*
  2. * Copyright(c) 2015, 2016 Intel Corporation.
  3. *
  4. * This file is provided under a dual BSD/GPLv2 license. When using or
  5. * redistributing this file, you may do so under either license.
  6. *
  7. * GPL LICENSE SUMMARY
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of version 2 of the GNU General Public License as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * BSD LICENSE
  19. *
  20. * Redistribution and use in source and binary forms, with or without
  21. * modification, are permitted provided that the following conditions
  22. * are met:
  23. *
  24. * - Redistributions of source code must retain the above copyright
  25. * notice, this list of conditions and the following disclaimer.
  26. * - Redistributions in binary form must reproduce the above copyright
  27. * notice, this list of conditions and the following disclaimer in
  28. * the documentation and/or other materials provided with the
  29. * distribution.
  30. * - Neither the name of Intel Corporation nor the names of its
  31. * contributors may be used to endorse or promote products derived
  32. * from this software without specific prior written permission.
  33. *
  34. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  35. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  36. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  37. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  38. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  39. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  40. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  41. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  42. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  43. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  44. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  45. *
  46. */
  47. #if !defined(__HFI1_TRACE_RX_H) || defined(TRACE_HEADER_MULTI_READ)
  48. #define __HFI1_TRACE_RX_H
  49. #include <linux/tracepoint.h>
  50. #include <linux/trace_seq.h>
  51. #include "hfi.h"
  52. #undef TRACE_SYSTEM
  53. #define TRACE_SYSTEM hfi1_rx
  54. TRACE_EVENT(hfi1_rcvhdr,
  55. TP_PROTO(struct hfi1_devdata *dd,
  56. u32 ctxt,
  57. u64 eflags,
  58. u32 etype,
  59. u32 hlen,
  60. u32 tlen,
  61. u32 updegr,
  62. u32 etail
  63. ),
  64. TP_ARGS(dd, ctxt, eflags, etype, hlen, tlen, updegr, etail),
  65. TP_STRUCT__entry(DD_DEV_ENTRY(dd)
  66. __field(u64, eflags)
  67. __field(u32, ctxt)
  68. __field(u32, etype)
  69. __field(u32, hlen)
  70. __field(u32, tlen)
  71. __field(u32, updegr)
  72. __field(u32, etail)
  73. ),
  74. TP_fast_assign(DD_DEV_ASSIGN(dd);
  75. __entry->eflags = eflags;
  76. __entry->ctxt = ctxt;
  77. __entry->etype = etype;
  78. __entry->hlen = hlen;
  79. __entry->tlen = tlen;
  80. __entry->updegr = updegr;
  81. __entry->etail = etail;
  82. ),
  83. TP_printk(
  84. "[%s] ctxt %d eflags 0x%llx etype %d,%s hlen %d tlen %d updegr %d etail %d",
  85. __get_str(dev),
  86. __entry->ctxt,
  87. __entry->eflags,
  88. __entry->etype, show_packettype(__entry->etype),
  89. __entry->hlen,
  90. __entry->tlen,
  91. __entry->updegr,
  92. __entry->etail
  93. )
  94. );
  95. TRACE_EVENT(hfi1_receive_interrupt,
  96. TP_PROTO(struct hfi1_devdata *dd, u32 ctxt),
  97. TP_ARGS(dd, ctxt),
  98. TP_STRUCT__entry(DD_DEV_ENTRY(dd)
  99. __field(u32, ctxt)
  100. __field(u8, slow_path)
  101. __field(u8, dma_rtail)
  102. ),
  103. TP_fast_assign(DD_DEV_ASSIGN(dd);
  104. __entry->ctxt = ctxt;
  105. if (dd->rcd[ctxt]->do_interrupt ==
  106. &handle_receive_interrupt) {
  107. __entry->slow_path = 1;
  108. __entry->dma_rtail = 0xFF;
  109. } else if (dd->rcd[ctxt]->do_interrupt ==
  110. &handle_receive_interrupt_dma_rtail){
  111. __entry->dma_rtail = 1;
  112. __entry->slow_path = 0;
  113. } else if (dd->rcd[ctxt]->do_interrupt ==
  114. &handle_receive_interrupt_nodma_rtail) {
  115. __entry->dma_rtail = 0;
  116. __entry->slow_path = 0;
  117. }
  118. ),
  119. TP_printk("[%s] ctxt %d SlowPath: %d DmaRtail: %d",
  120. __get_str(dev),
  121. __entry->ctxt,
  122. __entry->slow_path,
  123. __entry->dma_rtail
  124. )
  125. );
  126. TRACE_EVENT(hfi1_exp_tid_reg,
  127. TP_PROTO(unsigned int ctxt, u16 subctxt, u32 rarr,
  128. u32 npages, unsigned long va, unsigned long pa,
  129. dma_addr_t dma),
  130. TP_ARGS(ctxt, subctxt, rarr, npages, va, pa, dma),
  131. TP_STRUCT__entry(
  132. __field(unsigned int, ctxt)
  133. __field(u16, subctxt)
  134. __field(u32, rarr)
  135. __field(u32, npages)
  136. __field(unsigned long, va)
  137. __field(unsigned long, pa)
  138. __field(dma_addr_t, dma)
  139. ),
  140. TP_fast_assign(
  141. __entry->ctxt = ctxt;
  142. __entry->subctxt = subctxt;
  143. __entry->rarr = rarr;
  144. __entry->npages = npages;
  145. __entry->va = va;
  146. __entry->pa = pa;
  147. __entry->dma = dma;
  148. ),
  149. TP_printk("[%u:%u] entry:%u, %u pages @ 0x%lx, va:0x%lx dma:0x%llx",
  150. __entry->ctxt,
  151. __entry->subctxt,
  152. __entry->rarr,
  153. __entry->npages,
  154. __entry->pa,
  155. __entry->va,
  156. __entry->dma
  157. )
  158. );
  159. TRACE_EVENT(hfi1_exp_tid_unreg,
  160. TP_PROTO(unsigned int ctxt, u16 subctxt, u32 rarr, u32 npages,
  161. unsigned long va, unsigned long pa, dma_addr_t dma),
  162. TP_ARGS(ctxt, subctxt, rarr, npages, va, pa, dma),
  163. TP_STRUCT__entry(
  164. __field(unsigned int, ctxt)
  165. __field(u16, subctxt)
  166. __field(u32, rarr)
  167. __field(u32, npages)
  168. __field(unsigned long, va)
  169. __field(unsigned long, pa)
  170. __field(dma_addr_t, dma)
  171. ),
  172. TP_fast_assign(
  173. __entry->ctxt = ctxt;
  174. __entry->subctxt = subctxt;
  175. __entry->rarr = rarr;
  176. __entry->npages = npages;
  177. __entry->va = va;
  178. __entry->pa = pa;
  179. __entry->dma = dma;
  180. ),
  181. TP_printk("[%u:%u] entry:%u, %u pages @ 0x%lx, va:0x%lx dma:0x%llx",
  182. __entry->ctxt,
  183. __entry->subctxt,
  184. __entry->rarr,
  185. __entry->npages,
  186. __entry->pa,
  187. __entry->va,
  188. __entry->dma
  189. )
  190. );
  191. TRACE_EVENT(hfi1_exp_tid_inval,
  192. TP_PROTO(unsigned int ctxt, u16 subctxt, unsigned long va, u32 rarr,
  193. u32 npages, dma_addr_t dma),
  194. TP_ARGS(ctxt, subctxt, va, rarr, npages, dma),
  195. TP_STRUCT__entry(
  196. __field(unsigned int, ctxt)
  197. __field(u16, subctxt)
  198. __field(unsigned long, va)
  199. __field(u32, rarr)
  200. __field(u32, npages)
  201. __field(dma_addr_t, dma)
  202. ),
  203. TP_fast_assign(
  204. __entry->ctxt = ctxt;
  205. __entry->subctxt = subctxt;
  206. __entry->va = va;
  207. __entry->rarr = rarr;
  208. __entry->npages = npages;
  209. __entry->dma = dma;
  210. ),
  211. TP_printk("[%u:%u] entry:%u, %u pages @ 0x%lx dma: 0x%llx",
  212. __entry->ctxt,
  213. __entry->subctxt,
  214. __entry->rarr,
  215. __entry->npages,
  216. __entry->va,
  217. __entry->dma
  218. )
  219. );
  220. TRACE_EVENT(hfi1_mmu_invalidate,
  221. TP_PROTO(unsigned int ctxt, u16 subctxt, const char *type,
  222. unsigned long start, unsigned long end),
  223. TP_ARGS(ctxt, subctxt, type, start, end),
  224. TP_STRUCT__entry(
  225. __field(unsigned int, ctxt)
  226. __field(u16, subctxt)
  227. __string(type, type)
  228. __field(unsigned long, start)
  229. __field(unsigned long, end)
  230. ),
  231. TP_fast_assign(
  232. __entry->ctxt = ctxt;
  233. __entry->subctxt = subctxt;
  234. __assign_str(type, type);
  235. __entry->start = start;
  236. __entry->end = end;
  237. ),
  238. TP_printk("[%3u:%02u] MMU Invalidate (%s) 0x%lx - 0x%lx",
  239. __entry->ctxt,
  240. __entry->subctxt,
  241. __get_str(type),
  242. __entry->start,
  243. __entry->end
  244. )
  245. );
  246. #endif /* __HFI1_TRACE_RX_H */
  247. #undef TRACE_INCLUDE_PATH
  248. #undef TRACE_INCLUDE_FILE
  249. #define TRACE_INCLUDE_PATH .
  250. #define TRACE_INCLUDE_FILE trace_rx
  251. #include <trace/define_trace.h>