trace_msg.h 1.2 KB

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