mt792x_trace.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: BSD-3-Clause-Clear */
  2. /*
  3. * Copyright (C) 2023 Lorenzo Bianconi <lorenzo@kernel.org>
  4. */
  5. #if !defined(__MT792X_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
  6. #define __MT792X_TRACE_H
  7. #include <linux/tracepoint.h>
  8. #include "mt792x.h"
  9. #undef TRACE_SYSTEM
  10. #define TRACE_SYSTEM mt792x
  11. #define MAXNAME 32
  12. #define DEV_ENTRY __array(char, wiphy_name, 32)
  13. #define DEV_ASSIGN strscpy(__entry->wiphy_name, \
  14. wiphy_name(mt76_hw(dev)->wiphy), MAXNAME)
  15. #define DEV_PR_FMT "%s"
  16. #define DEV_PR_ARG __entry->wiphy_name
  17. #define LP_STATE_PR_ARG __entry->lp_state ? "lp ready" : "lp not ready"
  18. TRACE_EVENT(lp_event,
  19. TP_PROTO(struct mt792x_dev *dev, u8 lp_state),
  20. TP_ARGS(dev, lp_state),
  21. TP_STRUCT__entry(
  22. DEV_ENTRY
  23. __field(u8, lp_state)
  24. ),
  25. TP_fast_assign(
  26. DEV_ASSIGN;
  27. __entry->lp_state = lp_state;
  28. ),
  29. TP_printk(
  30. DEV_PR_FMT " %s",
  31. DEV_PR_ARG, LP_STATE_PR_ARG
  32. )
  33. );
  34. #endif
  35. #undef TRACE_INCLUDE_PATH
  36. #define TRACE_INCLUDE_PATH .
  37. #undef TRACE_INCLUDE_FILE
  38. #define TRACE_INCLUDE_FILE mt792x_trace
  39. #include <trace/define_trace.h>