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 strscpy(__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_PR_FMT " [%d:%d]"
24 #define TXID_PR_ARG __entry->wcid, __entry->pktid
26 DECLARE_EVENT_CLASS(dev_evt
,
27 TP_PROTO(struct mt76x02_dev
*dev
),
35 TP_printk(DEV_PR_FMT
, DEV_PR_ARG
)
38 DEFINE_EVENT(dev_evt
, mac_txstat_poll
,
39 TP_PROTO(struct mt76x02_dev
*dev
),
43 TRACE_EVENT(mac_txstat_fetch
,
44 TP_PROTO(struct mt76x02_dev
*dev
,
45 struct mt76x02_tx_status
*stat
),
52 __field(bool, success
)
54 __field(bool, ack_req
)
61 __entry
->success
= stat
->success
;
62 __entry
->aggr
= stat
->aggr
;
63 __entry
->ack_req
= stat
->ack_req
;
64 __entry
->wcid
= stat
->wcid
;
65 __entry
->pktid
= stat
->pktid
;
66 __entry
->rate
= stat
->rate
;
67 __entry
->retry
= stat
->retry
;
71 DEV_PR_FMT TXID_PR_FMT
72 " success:%d aggr:%d ack_req:%d"
73 " rate:%04x retry:%d",
74 DEV_PR_ARG
, TXID_PR_ARG
,
75 __entry
->success
, __entry
->aggr
, __entry
->ack_req
,
76 __entry
->rate
, __entry
->retry
82 #undef TRACE_INCLUDE_PATH
83 #define TRACE_INCLUDE_PATH .
84 #undef TRACE_INCLUDE_FILE
85 #define TRACE_INCLUDE_FILE mt76x02_trace
87 #include <trace/define_trace.h>