iwl-devtrace-data.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * Intel Linux Wireless <ilw@linux.intel.com>
  23. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  24. *
  25. *****************************************************************************/
  26. #if !defined(__IWLWIFI_DEVICE_TRACE_DATA) || defined(TRACE_HEADER_MULTI_READ)
  27. #define __IWLWIFI_DEVICE_TRACE_DATA
  28. #include <linux/tracepoint.h>
  29. #undef TRACE_SYSTEM
  30. #define TRACE_SYSTEM iwlwifi_data
  31. TRACE_EVENT(iwlwifi_dev_tx_data,
  32. TP_PROTO(const struct device *dev,
  33. struct sk_buff *skb,
  34. void *data, size_t data_len),
  35. TP_ARGS(dev, skb, data, data_len),
  36. TP_STRUCT__entry(
  37. DEV_ENTRY
  38. __dynamic_array(u8, data, iwl_trace_data(skb) ? data_len : 0)
  39. ),
  40. TP_fast_assign(
  41. DEV_ASSIGN;
  42. if (iwl_trace_data(skb))
  43. memcpy(__get_dynamic_array(data), data, data_len);
  44. ),
  45. TP_printk("[%s] TX frame data", __get_str(dev))
  46. );
  47. TRACE_EVENT(iwlwifi_dev_rx_data,
  48. TP_PROTO(const struct device *dev,
  49. const struct iwl_trans *trans,
  50. void *rxbuf, size_t len),
  51. TP_ARGS(dev, trans, rxbuf, len),
  52. TP_STRUCT__entry(
  53. DEV_ENTRY
  54. __dynamic_array(u8, data,
  55. len - iwl_rx_trace_len(trans, rxbuf, len))
  56. ),
  57. TP_fast_assign(
  58. size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
  59. DEV_ASSIGN;
  60. if (offs < len)
  61. memcpy(__get_dynamic_array(data),
  62. ((u8 *)rxbuf) + offs, len - offs);
  63. ),
  64. TP_printk("[%s] RX frame data", __get_str(dev))
  65. );
  66. #endif /* __IWLWIFI_DEVICE_TRACE_DATA */
  67. #undef TRACE_INCLUDE_PATH
  68. #define TRACE_INCLUDE_PATH .
  69. #undef TRACE_INCLUDE_FILE
  70. #define TRACE_INCLUDE_FILE iwl-devtrace-data
  71. #include <trace/define_trace.h>