1 /* SPDX-License-Identifier: ISC */
3 * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
6 #if !defined(__MT76x02_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define __MT76x02_TRACE_H
9 #include <linux/tracepoint.h>
13 #define TRACE_SYSTEM mt76x02
16 #define DEV_ENTRY __array(char, wiphy_name, 32)
17 #define DEV_ASSIGN strlcpy(__entry->wiphy_name, \
18 wiphy_name(mt76_hw(dev)->wiphy), MAXNAME)
19 #define DEV_PR_FMT "%s"
20 #define DEV_PR_ARG __entry->wiphy_name
22 #define TXID_ENTRY __field(u8, wcid) __field(u8, pktid)
23 #define TXID_ASSIGN __entry->wcid = wcid; __entry->pktid = pktid
24 #define TXID_PR_FMT " [%d:%d]"
25 #define TXID_PR_ARG __entry->wcid, __entry->pktid
27 DECLARE_EVENT_CLASS(dev_evt
,
28 TP_PROTO(struct mt76x02_dev
*dev
),
36 TP_printk(DEV_PR_FMT
, DEV_PR_ARG
)
39 DECLARE_EVENT_CLASS(dev_txid_evt
,
40 TP_PROTO(struct mt76x02_dev
*dev
, u8 wcid
, u8 pktid
),
41 TP_ARGS(dev
, wcid
, pktid
),
51 DEV_PR_FMT TXID_PR_FMT
,
52 DEV_PR_ARG
, TXID_PR_ARG
56 DEFINE_EVENT(dev_txid_evt
, mac_txdone_add
,
57 TP_PROTO(struct mt76x02_dev
*dev
, u8 wcid
, u8 pktid
),
58 TP_ARGS(dev
, wcid
, pktid
)
61 DEFINE_EVENT(dev_evt
, mac_txstat_poll
,
62 TP_PROTO(struct mt76x02_dev
*dev
),
66 TRACE_EVENT(mac_txstat_fetch
,
67 TP_PROTO(struct mt76x02_dev
*dev
,
68 struct mt76x02_tx_status
*stat
),
75 __field(bool, success
)
77 __field(bool, ack_req
)
84 __entry
->success
= stat
->success
;
85 __entry
->aggr
= stat
->aggr
;
86 __entry
->ack_req
= stat
->ack_req
;
87 __entry
->wcid
= stat
->wcid
;
88 __entry
->pktid
= stat
->pktid
;
89 __entry
->rate
= stat
->rate
;
90 __entry
->retry
= stat
->retry
;
94 DEV_PR_FMT TXID_PR_FMT
95 " success:%d aggr:%d ack_req:%d"
96 " rate:%04x retry:%d",
97 DEV_PR_ARG
, TXID_PR_ARG
,
98 __entry
->success
, __entry
->aggr
, __entry
->ack_req
,
99 __entry
->rate
, __entry
->retry
104 TP_PROTO(struct mt76x02_dev
*dev
, u32 val
, u32 mask
),
106 TP_ARGS(dev
, val
, mask
),
117 __entry
->mask
= mask
;
121 DEV_PR_FMT
" %08x & %08x",
122 DEV_PR_ARG
, __entry
->val
, __entry
->mask
128 #undef TRACE_INCLUDE_PATH
129 #define TRACE_INCLUDE_PATH .
130 #undef TRACE_INCLUDE_FILE
131 #define TRACE_INCLUDE_FILE mt76x02_trace
133 #include <trace/define_trace.h>