trace_msg.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Portions of this file
  4. * Copyright (C) 2019 Intel Corporation
  5. */
  6. #ifdef CONFIG_MAC80211_MESSAGE_TRACING
  7. #if !defined(__MAC80211_MSG_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
  8. #define __MAC80211_MSG_DRIVER_TRACE
  9. #include <linux/tracepoint.h>
  10. #include <net/mac80211.h>
  11. #include "ieee80211_i.h"
  12. #undef TRACE_SYSTEM
  13. #define TRACE_SYSTEM mac80211_msg
  14. #define MAX_MSG_LEN 120
  15. DECLARE_EVENT_CLASS(mac80211_msg_event,
  16. TP_PROTO(struct va_format *vaf),
  17. TP_ARGS(vaf),
  18. TP_STRUCT__entry(
  19. __dynamic_array(char, msg, MAX_MSG_LEN)
  20. ),
  21. TP_fast_assign(
  22. WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
  23. MAX_MSG_LEN, vaf->fmt,
  24. *vaf->va) >= MAX_MSG_LEN);
  25. ),
  26. TP_printk("%s", __get_str(msg))
  27. );
  28. DEFINE_EVENT(mac80211_msg_event, mac80211_info,
  29. TP_PROTO(struct va_format *vaf),
  30. TP_ARGS(vaf)
  31. );
  32. DEFINE_EVENT(mac80211_msg_event, mac80211_dbg,
  33. TP_PROTO(struct va_format *vaf),
  34. TP_ARGS(vaf)
  35. );
  36. DEFINE_EVENT(mac80211_msg_event, mac80211_err,
  37. TP_PROTO(struct va_format *vaf),
  38. TP_ARGS(vaf)
  39. );
  40. #endif /* !__MAC80211_MSG_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
  41. #undef TRACE_INCLUDE_PATH
  42. #define TRACE_INCLUDE_PATH .
  43. #undef TRACE_INCLUDE_FILE
  44. #define TRACE_INCLUDE_FILE trace_msg
  45. #include <trace/define_trace.h>
  46. #endif