iwl-devtrace-data.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
  4. * Copyright(c) 2015 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_DATA) || defined(TRACE_HEADER_MULTI_READ)
  28. #define __IWLWIFI_DEVICE_TRACE_DATA
  29. #include <linux/tracepoint.h>
  30. #undef TRACE_SYSTEM
  31. #define TRACE_SYSTEM iwlwifi_data
  32. TRACE_EVENT(iwlwifi_dev_tx_data,
  33. TP_PROTO(const struct device *dev,
  34. struct sk_buff *skb, u8 hdr_len),
  35. TP_ARGS(dev, skb, hdr_len),
  36. TP_STRUCT__entry(
  37. DEV_ENTRY
  38. __dynamic_array(u8, data,
  39. iwl_trace_data(skb) ? skb->len - hdr_len : 0)
  40. ),
  41. TP_fast_assign(
  42. DEV_ASSIGN;
  43. if (iwl_trace_data(skb))
  44. skb_copy_bits(skb, hdr_len,
  45. __get_dynamic_array(data),
  46. skb->len - hdr_len);
  47. ),
  48. TP_printk("[%s] TX frame data", __get_str(dev))
  49. );
  50. TRACE_EVENT(iwlwifi_dev_tx_tso_chunk,
  51. TP_PROTO(const struct device *dev,
  52. u8 *data_src, size_t data_len),
  53. TP_ARGS(dev, data_src, data_len),
  54. TP_STRUCT__entry(
  55. DEV_ENTRY
  56. __dynamic_array(u8, data, data_len)
  57. ),
  58. TP_fast_assign(
  59. DEV_ASSIGN;
  60. memcpy(__get_dynamic_array(data), data_src, data_len);
  61. ),
  62. TP_printk("[%s] TX frame data", __get_str(dev))
  63. );
  64. TRACE_EVENT(iwlwifi_dev_rx_data,
  65. TP_PROTO(const struct device *dev,
  66. const struct iwl_trans *trans,
  67. void *rxbuf, size_t len),
  68. TP_ARGS(dev, trans, rxbuf, len),
  69. TP_STRUCT__entry(
  70. DEV_ENTRY
  71. __dynamic_array(u8, data,
  72. len - iwl_rx_trace_len(trans, rxbuf, len))
  73. ),
  74. TP_fast_assign(
  75. size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
  76. DEV_ASSIGN;
  77. if (offs < len)
  78. memcpy(__get_dynamic_array(data),
  79. ((u8 *)rxbuf) + offs, len - offs);
  80. ),
  81. TP_printk("[%s] RX frame data", __get_str(dev))
  82. );
  83. #endif /* __IWLWIFI_DEVICE_TRACE_DATA */
  84. #undef TRACE_INCLUDE_PATH
  85. #define TRACE_INCLUDE_PATH .
  86. #undef TRACE_INCLUDE_FILE
  87. #define TRACE_INCLUDE_FILE iwl-devtrace-data
  88. #include <trace/define_trace.h>