mt76x02_trace.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* SPDX-License-Identifier: ISC */
  2. /*
  3. * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
  4. */
  5. #if !defined(__MT76x02_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
  6. #define __MT76x02_TRACE_H
  7. #include <linux/tracepoint.h>
  8. #include "mt76x02.h"
  9. #undef TRACE_SYSTEM
  10. #define TRACE_SYSTEM mt76x02
  11. #define MAXNAME 32
  12. #define DEV_ENTRY __array(char, wiphy_name, 32)
  13. #define DEV_ASSIGN strlcpy(__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 TXID_ENTRY __field(u8, wcid) __field(u8, pktid)
  18. #define TXID_PR_FMT " [%d:%d]"
  19. #define TXID_PR_ARG __entry->wcid, __entry->pktid
  20. DECLARE_EVENT_CLASS(dev_evt,
  21. TP_PROTO(struct mt76x02_dev *dev),
  22. TP_ARGS(dev),
  23. TP_STRUCT__entry(
  24. DEV_ENTRY
  25. ),
  26. TP_fast_assign(
  27. DEV_ASSIGN;
  28. ),
  29. TP_printk(DEV_PR_FMT, DEV_PR_ARG)
  30. );
  31. DEFINE_EVENT(dev_evt, mac_txstat_poll,
  32. TP_PROTO(struct mt76x02_dev *dev),
  33. TP_ARGS(dev)
  34. );
  35. TRACE_EVENT(mac_txstat_fetch,
  36. TP_PROTO(struct mt76x02_dev *dev,
  37. struct mt76x02_tx_status *stat),
  38. TP_ARGS(dev, stat),
  39. TP_STRUCT__entry(
  40. DEV_ENTRY
  41. TXID_ENTRY
  42. __field(bool, success)
  43. __field(bool, aggr)
  44. __field(bool, ack_req)
  45. __field(u16, rate)
  46. __field(u8, retry)
  47. ),
  48. TP_fast_assign(
  49. DEV_ASSIGN;
  50. __entry->success = stat->success;
  51. __entry->aggr = stat->aggr;
  52. __entry->ack_req = stat->ack_req;
  53. __entry->wcid = stat->wcid;
  54. __entry->pktid = stat->pktid;
  55. __entry->rate = stat->rate;
  56. __entry->retry = stat->retry;
  57. ),
  58. TP_printk(
  59. DEV_PR_FMT TXID_PR_FMT
  60. " success:%d aggr:%d ack_req:%d"
  61. " rate:%04x retry:%d",
  62. DEV_PR_ARG, TXID_PR_ARG,
  63. __entry->success, __entry->aggr, __entry->ack_req,
  64. __entry->rate, __entry->retry
  65. )
  66. );
  67. #endif
  68. #undef TRACE_INCLUDE_PATH
  69. #define TRACE_INCLUDE_PATH .
  70. #undef TRACE_INCLUDE_FILE
  71. #define TRACE_INCLUDE_FILE mt76x02_trace
  72. #include <trace/define_trace.h>