iwl-devtrace-data.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. u8 hdr_len, size_t data_len),
  35. TP_ARGS(dev, skb, hdr_len, 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. skb_copy_bits(skb, hdr_len,
  44. __get_dynamic_array(data), data_len);
  45. ),
  46. TP_printk("[%s] TX frame data", __get_str(dev))
  47. );
  48. TRACE_EVENT(iwlwifi_dev_rx_data,
  49. TP_PROTO(const struct device *dev,
  50. const struct iwl_trans *trans,
  51. void *rxbuf, size_t len),
  52. TP_ARGS(dev, trans, rxbuf, len),
  53. TP_STRUCT__entry(
  54. DEV_ENTRY
  55. __dynamic_array(u8, data,
  56. len - iwl_rx_trace_len(trans, rxbuf, len))
  57. ),
  58. TP_fast_assign(
  59. size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
  60. DEV_ASSIGN;
  61. if (offs < len)
  62. memcpy(__get_dynamic_array(data),
  63. ((u8 *)rxbuf) + offs, len - offs);
  64. ),
  65. TP_printk("[%s] RX frame data", __get_str(dev))
  66. );
  67. #endif /* __IWLWIFI_DEVICE_TRACE_DATA */
  68. #undef TRACE_INCLUDE_PATH
  69. #define TRACE_INCLUDE_PATH .
  70. #undef TRACE_INCLUDE_FILE
  71. #define TRACE_INCLUDE_FILE iwl-devtrace-data
  72. #include <trace/define_trace.h>