iwl-devtrace-msg.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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_MSG) || defined(TRACE_HEADER_MULTI_READ)
  27. #define __IWLWIFI_DEVICE_TRACE_MSG
  28. #include <linux/tracepoint.h>
  29. #undef TRACE_SYSTEM
  30. #define TRACE_SYSTEM iwlwifi_msg
  31. #define MAX_MSG_LEN 110
  32. DECLARE_EVENT_CLASS(iwlwifi_msg_event,
  33. TP_PROTO(struct va_format *vaf),
  34. TP_ARGS(vaf),
  35. TP_STRUCT__entry(
  36. __dynamic_array(char, msg, MAX_MSG_LEN)
  37. ),
  38. TP_fast_assign(
  39. WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
  40. MAX_MSG_LEN, vaf->fmt,
  41. *vaf->va) >= MAX_MSG_LEN);
  42. ),
  43. TP_printk("%s", __get_str(msg))
  44. );
  45. DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
  46. TP_PROTO(struct va_format *vaf),
  47. TP_ARGS(vaf)
  48. );
  49. DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
  50. TP_PROTO(struct va_format *vaf),
  51. TP_ARGS(vaf)
  52. );
  53. DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
  54. TP_PROTO(struct va_format *vaf),
  55. TP_ARGS(vaf)
  56. );
  57. DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
  58. TP_PROTO(struct va_format *vaf),
  59. TP_ARGS(vaf)
  60. );
  61. TRACE_EVENT(iwlwifi_dbg,
  62. TP_PROTO(u32 level, bool in_interrupt, const char *function,
  63. struct va_format *vaf),
  64. TP_ARGS(level, in_interrupt, function, vaf),
  65. TP_STRUCT__entry(
  66. __field(u32, level)
  67. __field(u8, in_interrupt)
  68. __string(function, function)
  69. __dynamic_array(char, msg, MAX_MSG_LEN)
  70. ),
  71. TP_fast_assign(
  72. __entry->level = level;
  73. __entry->in_interrupt = in_interrupt;
  74. __assign_str(function, function);
  75. WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
  76. MAX_MSG_LEN, vaf->fmt,
  77. *vaf->va) >= MAX_MSG_LEN);
  78. ),
  79. TP_printk("%s", __get_str(msg))
  80. );
  81. #endif /* __IWLWIFI_DEVICE_TRACE_MSG */
  82. #undef TRACE_INCLUDE_PATH
  83. #define TRACE_INCLUDE_PATH .
  84. #undef TRACE_INCLUDE_FILE
  85. #define TRACE_INCLUDE_FILE iwl-devtrace-msg
  86. #include <trace/define_trace.h>