iwl-devtrace-io.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /******************************************************************************
  3. *
  4. * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
  5. * Copyright(c) 2016-2017 Intel Deutschland GmbH
  6. *****************************************************************************/
  7. #if !defined(__IWLWIFI_DEVICE_TRACE_IO) || defined(TRACE_HEADER_MULTI_READ)
  8. #define __IWLWIFI_DEVICE_TRACE_IO
  9. #include <linux/tracepoint.h>
  10. #include <linux/pci.h>
  11. #undef TRACE_SYSTEM
  12. #define TRACE_SYSTEM iwlwifi_io
  13. TRACE_EVENT(iwlwifi_dev_ioread32,
  14. TP_PROTO(const struct device *dev, u32 offs, u32 val),
  15. TP_ARGS(dev, offs, val),
  16. TP_STRUCT__entry(
  17. DEV_ENTRY
  18. __field(u32, offs)
  19. __field(u32, val)
  20. ),
  21. TP_fast_assign(
  22. DEV_ASSIGN;
  23. __entry->offs = offs;
  24. __entry->val = val;
  25. ),
  26. TP_printk("[%s] read io[%#x] = %#x",
  27. __get_str(dev), __entry->offs, __entry->val)
  28. );
  29. TRACE_EVENT(iwlwifi_dev_iowrite8,
  30. TP_PROTO(const struct device *dev, u32 offs, u8 val),
  31. TP_ARGS(dev, offs, val),
  32. TP_STRUCT__entry(
  33. DEV_ENTRY
  34. __field(u32, offs)
  35. __field(u8, val)
  36. ),
  37. TP_fast_assign(
  38. DEV_ASSIGN;
  39. __entry->offs = offs;
  40. __entry->val = val;
  41. ),
  42. TP_printk("[%s] write io[%#x] = %#x)",
  43. __get_str(dev), __entry->offs, __entry->val)
  44. );
  45. TRACE_EVENT(iwlwifi_dev_iowrite32,
  46. TP_PROTO(const struct device *dev, u32 offs, u32 val),
  47. TP_ARGS(dev, offs, val),
  48. TP_STRUCT__entry(
  49. DEV_ENTRY
  50. __field(u32, offs)
  51. __field(u32, val)
  52. ),
  53. TP_fast_assign(
  54. DEV_ASSIGN;
  55. __entry->offs = offs;
  56. __entry->val = val;
  57. ),
  58. TP_printk("[%s] write io[%#x] = %#x)",
  59. __get_str(dev), __entry->offs, __entry->val)
  60. );
  61. TRACE_EVENT(iwlwifi_dev_iowrite64,
  62. TP_PROTO(const struct device *dev, u64 offs, u64 val),
  63. TP_ARGS(dev, offs, val),
  64. TP_STRUCT__entry(
  65. DEV_ENTRY
  66. __field(u64, offs)
  67. __field(u64, val)
  68. ),
  69. TP_fast_assign(
  70. DEV_ASSIGN;
  71. __entry->offs = offs;
  72. __entry->val = val;
  73. ),
  74. TP_printk("[%s] write io[%llu] = %llu)",
  75. __get_str(dev), __entry->offs, __entry->val)
  76. );
  77. TRACE_EVENT(iwlwifi_dev_iowrite_prph32,
  78. TP_PROTO(const struct device *dev, u32 offs, u32 val),
  79. TP_ARGS(dev, offs, val),
  80. TP_STRUCT__entry(
  81. DEV_ENTRY
  82. __field(u32, offs)
  83. __field(u32, val)
  84. ),
  85. TP_fast_assign(
  86. DEV_ASSIGN;
  87. __entry->offs = offs;
  88. __entry->val = val;
  89. ),
  90. TP_printk("[%s] write PRPH[%#x] = %#x)",
  91. __get_str(dev), __entry->offs, __entry->val)
  92. );
  93. TRACE_EVENT(iwlwifi_dev_iowrite_prph64,
  94. TP_PROTO(const struct device *dev, u64 offs, u64 val),
  95. TP_ARGS(dev, offs, val),
  96. TP_STRUCT__entry(
  97. DEV_ENTRY
  98. __field(u64, offs)
  99. __field(u64, val)
  100. ),
  101. TP_fast_assign(
  102. DEV_ASSIGN;
  103. __entry->offs = offs;
  104. __entry->val = val;
  105. ),
  106. TP_printk("[%s] write PRPH[%llu] = %llu)",
  107. __get_str(dev), __entry->offs, __entry->val)
  108. );
  109. TRACE_EVENT(iwlwifi_dev_ioread_prph32,
  110. TP_PROTO(const struct device *dev, u32 offs, u32 val),
  111. TP_ARGS(dev, offs, val),
  112. TP_STRUCT__entry(
  113. DEV_ENTRY
  114. __field(u32, offs)
  115. __field(u32, val)
  116. ),
  117. TP_fast_assign(
  118. DEV_ASSIGN;
  119. __entry->offs = offs;
  120. __entry->val = val;
  121. ),
  122. TP_printk("[%s] read PRPH[%#x] = %#x",
  123. __get_str(dev), __entry->offs, __entry->val)
  124. );
  125. TRACE_EVENT(iwlwifi_dev_irq,
  126. TP_PROTO(const struct device *dev),
  127. TP_ARGS(dev),
  128. TP_STRUCT__entry(
  129. DEV_ENTRY
  130. ),
  131. TP_fast_assign(
  132. DEV_ASSIGN;
  133. ),
  134. /* TP_printk("") doesn't compile */
  135. TP_printk("%d", 0)
  136. );
  137. TRACE_EVENT(iwlwifi_dev_irq_msix,
  138. TP_PROTO(const struct device *dev, struct msix_entry *msix_entry,
  139. bool defirq, u32 inta_fh, u32 inta_hw),
  140. TP_ARGS(dev, msix_entry, defirq, inta_fh, inta_hw),
  141. TP_STRUCT__entry(
  142. DEV_ENTRY
  143. __field(u32, entry)
  144. __field(u8, defirq)
  145. __field(u32, inta_fh)
  146. __field(u32, inta_hw)
  147. ),
  148. TP_fast_assign(
  149. DEV_ASSIGN;
  150. __entry->entry = msix_entry->entry;
  151. __entry->defirq = defirq;
  152. __entry->inta_fh = inta_fh;
  153. __entry->inta_hw = inta_hw;
  154. ),
  155. TP_printk("entry:%d defirq:%d fh:0x%x, hw:0x%x",
  156. __entry->entry, __entry->defirq,
  157. __entry->inta_fh, __entry->inta_hw)
  158. );
  159. TRACE_EVENT(iwlwifi_dev_ict_read,
  160. TP_PROTO(const struct device *dev, u32 index, u32 value),
  161. TP_ARGS(dev, index, value),
  162. TP_STRUCT__entry(
  163. DEV_ENTRY
  164. __field(u32, index)
  165. __field(u32, value)
  166. ),
  167. TP_fast_assign(
  168. DEV_ASSIGN;
  169. __entry->index = index;
  170. __entry->value = value;
  171. ),
  172. TP_printk("[%s] read ict[%d] = %#.8x",
  173. __get_str(dev), __entry->index, __entry->value)
  174. );
  175. #endif /* __IWLWIFI_DEVICE_TRACE_IO */
  176. #undef TRACE_INCLUDE_PATH
  177. #define TRACE_INCLUDE_PATH .
  178. #undef TRACE_INCLUDE_FILE
  179. #define TRACE_INCLUDE_FILE iwl-devtrace-io
  180. #include <trace/define_trace.h>