iwl-devtrace-io.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
  4. * Copyright(c) 2016-2017 Intel Deutschland GmbH
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of version 2 of the GNU General Public License as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  18. *
  19. * The full GNU General Public License is included in this distribution in the
  20. * file called LICENSE.
  21. *
  22. * Contact Information:
  23. * Intel Linux Wireless <linuxwifi@intel.com>
  24. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  25. *
  26. *****************************************************************************/
  27. #if !defined(__IWLWIFI_DEVICE_TRACE_IO) || defined(TRACE_HEADER_MULTI_READ)
  28. #define __IWLWIFI_DEVICE_TRACE_IO
  29. #include <linux/tracepoint.h>
  30. #include <linux/pci.h>
  31. #undef TRACE_SYSTEM
  32. #define TRACE_SYSTEM iwlwifi_io
  33. TRACE_EVENT(iwlwifi_dev_ioread32,
  34. TP_PROTO(const struct device *dev, u32 offs, u32 val),
  35. TP_ARGS(dev, offs, val),
  36. TP_STRUCT__entry(
  37. DEV_ENTRY
  38. __field(u32, offs)
  39. __field(u32, val)
  40. ),
  41. TP_fast_assign(
  42. DEV_ASSIGN;
  43. __entry->offs = offs;
  44. __entry->val = val;
  45. ),
  46. TP_printk("[%s] read io[%#x] = %#x",
  47. __get_str(dev), __entry->offs, __entry->val)
  48. );
  49. TRACE_EVENT(iwlwifi_dev_iowrite8,
  50. TP_PROTO(const struct device *dev, u32 offs, u8 val),
  51. TP_ARGS(dev, offs, val),
  52. TP_STRUCT__entry(
  53. DEV_ENTRY
  54. __field(u32, offs)
  55. __field(u8, val)
  56. ),
  57. TP_fast_assign(
  58. DEV_ASSIGN;
  59. __entry->offs = offs;
  60. __entry->val = val;
  61. ),
  62. TP_printk("[%s] write io[%#x] = %#x)",
  63. __get_str(dev), __entry->offs, __entry->val)
  64. );
  65. TRACE_EVENT(iwlwifi_dev_iowrite32,
  66. TP_PROTO(const struct device *dev, u32 offs, u32 val),
  67. TP_ARGS(dev, offs, val),
  68. TP_STRUCT__entry(
  69. DEV_ENTRY
  70. __field(u32, offs)
  71. __field(u32, val)
  72. ),
  73. TP_fast_assign(
  74. DEV_ASSIGN;
  75. __entry->offs = offs;
  76. __entry->val = val;
  77. ),
  78. TP_printk("[%s] write io[%#x] = %#x)",
  79. __get_str(dev), __entry->offs, __entry->val)
  80. );
  81. TRACE_EVENT(iwlwifi_dev_iowrite64,
  82. TP_PROTO(const struct device *dev, u64 offs, u64 val),
  83. TP_ARGS(dev, offs, val),
  84. TP_STRUCT__entry(
  85. DEV_ENTRY
  86. __field(u64, offs)
  87. __field(u64, val)
  88. ),
  89. TP_fast_assign(
  90. DEV_ASSIGN;
  91. __entry->offs = offs;
  92. __entry->val = val;
  93. ),
  94. TP_printk("[%s] write io[%llu] = %llu)",
  95. __get_str(dev), __entry->offs, __entry->val)
  96. );
  97. TRACE_EVENT(iwlwifi_dev_iowrite_prph32,
  98. TP_PROTO(const struct device *dev, u32 offs, u32 val),
  99. TP_ARGS(dev, offs, val),
  100. TP_STRUCT__entry(
  101. DEV_ENTRY
  102. __field(u32, offs)
  103. __field(u32, val)
  104. ),
  105. TP_fast_assign(
  106. DEV_ASSIGN;
  107. __entry->offs = offs;
  108. __entry->val = val;
  109. ),
  110. TP_printk("[%s] write PRPH[%#x] = %#x)",
  111. __get_str(dev), __entry->offs, __entry->val)
  112. );
  113. TRACE_EVENT(iwlwifi_dev_iowrite_prph64,
  114. TP_PROTO(const struct device *dev, u64 offs, u64 val),
  115. TP_ARGS(dev, offs, val),
  116. TP_STRUCT__entry(
  117. DEV_ENTRY
  118. __field(u64, offs)
  119. __field(u64, val)
  120. ),
  121. TP_fast_assign(
  122. DEV_ASSIGN;
  123. __entry->offs = offs;
  124. __entry->val = val;
  125. ),
  126. TP_printk("[%s] write PRPH[%llu] = %llu)",
  127. __get_str(dev), __entry->offs, __entry->val)
  128. );
  129. TRACE_EVENT(iwlwifi_dev_ioread_prph32,
  130. TP_PROTO(const struct device *dev, u32 offs, u32 val),
  131. TP_ARGS(dev, offs, val),
  132. TP_STRUCT__entry(
  133. DEV_ENTRY
  134. __field(u32, offs)
  135. __field(u32, val)
  136. ),
  137. TP_fast_assign(
  138. DEV_ASSIGN;
  139. __entry->offs = offs;
  140. __entry->val = val;
  141. ),
  142. TP_printk("[%s] read PRPH[%#x] = %#x",
  143. __get_str(dev), __entry->offs, __entry->val)
  144. );
  145. TRACE_EVENT(iwlwifi_dev_irq,
  146. TP_PROTO(const struct device *dev),
  147. TP_ARGS(dev),
  148. TP_STRUCT__entry(
  149. DEV_ENTRY
  150. ),
  151. TP_fast_assign(
  152. DEV_ASSIGN;
  153. ),
  154. /* TP_printk("") doesn't compile */
  155. TP_printk("%d", 0)
  156. );
  157. TRACE_EVENT(iwlwifi_dev_irq_msix,
  158. TP_PROTO(const struct device *dev, struct msix_entry *msix_entry,
  159. bool defirq, u32 inta_fh, u32 inta_hw),
  160. TP_ARGS(dev, msix_entry, defirq, inta_fh, inta_hw),
  161. TP_STRUCT__entry(
  162. DEV_ENTRY
  163. __field(u32, entry)
  164. __field(u8, defirq)
  165. __field(u32, inta_fh)
  166. __field(u32, inta_hw)
  167. ),
  168. TP_fast_assign(
  169. DEV_ASSIGN;
  170. __entry->entry = msix_entry->entry;
  171. __entry->defirq = defirq;
  172. __entry->inta_fh = inta_fh;
  173. __entry->inta_hw = inta_hw;
  174. ),
  175. TP_printk("entry:%d defirq:%d fh:0x%x, hw:0x%x",
  176. __entry->entry, __entry->defirq,
  177. __entry->inta_fh, __entry->inta_hw)
  178. );
  179. TRACE_EVENT(iwlwifi_dev_ict_read,
  180. TP_PROTO(const struct device *dev, u32 index, u32 value),
  181. TP_ARGS(dev, index, value),
  182. TP_STRUCT__entry(
  183. DEV_ENTRY
  184. __field(u32, index)
  185. __field(u32, value)
  186. ),
  187. TP_fast_assign(
  188. DEV_ASSIGN;
  189. __entry->index = index;
  190. __entry->value = value;
  191. ),
  192. TP_printk("[%s] read ict[%d] = %#.8x",
  193. __get_str(dev), __entry->index, __entry->value)
  194. );
  195. #endif /* __IWLWIFI_DEVICE_TRACE_IO */
  196. #undef TRACE_INCLUDE_PATH
  197. #define TRACE_INCLUDE_PATH .
  198. #undef TRACE_INCLUDE_FILE
  199. #define TRACE_INCLUDE_FILE iwl-devtrace-io
  200. #include <trace/define_trace.h>