trace.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #if !defined(__TRACE_ATH5K_H) || defined(TRACE_HEADER_MULTI_READ)
  2. #define __TRACE_ATH5K_H
  3. #include <linux/tracepoint.h>
  4. #if !defined(CONFIG_ATH5K_TRACER) || defined(__CHECKER__)
  5. #undef TRACE_EVENT
  6. #define TRACE_EVENT(name, proto, ...) \
  7. static inline void trace_ ## name(proto) {}
  8. #endif
  9. struct sk_buff;
  10. struct ath5k_txq;
  11. struct ath5k_tx_status;
  12. #undef TRACE_SYSTEM
  13. #define TRACE_SYSTEM ath5k
  14. TRACE_EVENT(ath5k_rx,
  15. TP_PROTO(struct ath5k_hw *priv, struct sk_buff *skb),
  16. TP_ARGS(priv, skb),
  17. TP_STRUCT__entry(
  18. __field(struct ath5k_hw *, priv)
  19. __field(unsigned long, skbaddr)
  20. __dynamic_array(u8, frame, skb->len)
  21. ),
  22. TP_fast_assign(
  23. __entry->priv = priv;
  24. __entry->skbaddr = (unsigned long) skb;
  25. memcpy(__get_dynamic_array(frame), skb->data, skb->len);
  26. ),
  27. TP_printk(
  28. "[%p] RX skb=%lx", __entry->priv, __entry->skbaddr
  29. )
  30. );
  31. TRACE_EVENT(ath5k_tx,
  32. TP_PROTO(struct ath5k_hw *priv, struct sk_buff *skb,
  33. struct ath5k_txq *q),
  34. TP_ARGS(priv, skb, q),
  35. TP_STRUCT__entry(
  36. __field(struct ath5k_hw *, priv)
  37. __field(unsigned long, skbaddr)
  38. __field(u8, qnum)
  39. __dynamic_array(u8, frame, skb->len)
  40. ),
  41. TP_fast_assign(
  42. __entry->priv = priv;
  43. __entry->skbaddr = (unsigned long) skb;
  44. __entry->qnum = (u8) q->qnum;
  45. memcpy(__get_dynamic_array(frame), skb->data, skb->len);
  46. ),
  47. TP_printk(
  48. "[%p] TX skb=%lx q=%d", __entry->priv, __entry->skbaddr,
  49. __entry->qnum
  50. )
  51. );
  52. TRACE_EVENT(ath5k_tx_complete,
  53. TP_PROTO(struct ath5k_hw *priv, struct sk_buff *skb,
  54. struct ath5k_txq *q, struct ath5k_tx_status *ts),
  55. TP_ARGS(priv, skb, q, ts),
  56. TP_STRUCT__entry(
  57. __field(struct ath5k_hw *, priv)
  58. __field(unsigned long, skbaddr)
  59. __field(u8, qnum)
  60. __field(u8, ts_status)
  61. __field(s8, ts_rssi)
  62. __field(u8, ts_antenna)
  63. ),
  64. TP_fast_assign(
  65. __entry->priv = priv;
  66. __entry->skbaddr = (unsigned long) skb;
  67. __entry->qnum = (u8) q->qnum;
  68. __entry->ts_status = ts->ts_status;
  69. __entry->ts_rssi = ts->ts_rssi;
  70. __entry->ts_antenna = ts->ts_antenna;
  71. ),
  72. TP_printk(
  73. "[%p] TX end skb=%lx q=%d stat=%x rssi=%d ant=%x",
  74. __entry->priv, __entry->skbaddr, __entry->qnum,
  75. __entry->ts_status, __entry->ts_rssi, __entry->ts_antenna
  76. )
  77. );
  78. #endif /* __TRACE_ATH5K_H */
  79. #if defined(CONFIG_ATH5K_TRACER) && !defined(__CHECKER__)
  80. #undef TRACE_INCLUDE_PATH
  81. #define TRACE_INCLUDE_PATH .
  82. #undef TRACE_INCLUDE_FILE
  83. #define TRACE_INCLUDE_FILE trace
  84. #include <trace/define_trace.h>
  85. #endif