iwl-devtrace-io.h 4.6 KB

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