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,
  35. u8 hdr_len, size_t data_len),
  36. TP_ARGS(dev, skb, hdr_len, data_len),
  37. TP_STRUCT__entry(
  38. DEV_ENTRY
  39. __dynamic_array(u8, data, iwl_trace_data(skb) ? data_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), data_len);
  46. ),
  47. TP_printk("[%s] TX frame data", __get_str(dev))
  48. );
  49. TRACE_EVENT(iwlwifi_dev_tx_tso_chunk,
  50. TP_PROTO(const struct device *dev,
  51. u8 *data_src, size_t data_len),
  52. TP_ARGS(dev, data_src, data_len),
  53. TP_STRUCT__entry(
  54. DEV_ENTRY
  55. __dynamic_array(u8, data, data_len)
  56. ),
  57. TP_fast_assign(
  58. DEV_ASSIGN;
  59. memcpy(__get_dynamic_array(data), data_src, data_len);
  60. ),
  61. TP_printk("[%s] TX frame data", __get_str(dev))
  62. );
  63. TRACE_EVENT(iwlwifi_dev_rx_data,
  64. TP_PROTO(const struct device *dev,
  65. const struct iwl_trans *trans,
  66. void *rxbuf, size_t len),
  67. TP_ARGS(dev, trans, rxbuf, len),
  68. TP_STRUCT__entry(
  69. DEV_ENTRY
  70. __dynamic_array(u8, data,
  71. len - iwl_rx_trace_len(trans, rxbuf, len))
  72. ),
  73. TP_fast_assign(
  74. size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
  75. DEV_ASSIGN;
  76. if (offs < len)
  77. memcpy(__get_dynamic_array(data),
  78. ((u8 *)rxbuf) + offs, len - offs);
  79. ),
  80. TP_printk("[%s] RX frame data", __get_str(dev))
  81. );
  82. #endif /* __IWLWIFI_DEVICE_TRACE_DATA */
  83. #undef TRACE_INCLUDE_PATH
  84. #define TRACE_INCLUDE_PATH .
  85. #undef TRACE_INCLUDE_FILE
  86. #define TRACE_INCLUDE_FILE iwl-devtrace-data
  87. #include <trace/define_trace.h>