mt76: move mac_txdone tracepoint in mt76 module
Move mac_txdone tracepoint in common code in order to be reused by mt7603 and mt7615 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
a3f657ec1f
commit
5498974bd5
|
@ -4,6 +4,7 @@
|
||||||
#include <linux/timekeeping.h>
|
#include <linux/timekeeping.h>
|
||||||
#include "mt7603.h"
|
#include "mt7603.h"
|
||||||
#include "mac.h"
|
#include "mac.h"
|
||||||
|
#include "../trace.h"
|
||||||
|
|
||||||
#define MT_PSE_PAGE_SIZE 128
|
#define MT_PSE_PAGE_SIZE 128
|
||||||
|
|
||||||
|
@ -1193,6 +1194,8 @@ mt7603_mac_add_txs_skb(struct mt7603_dev *dev, struct mt7603_sta *sta, int pid,
|
||||||
if (pid < MT_PACKET_ID_FIRST)
|
if (pid < MT_PACKET_ID_FIRST)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
trace_mac_txdone(mdev, sta->wcid.idx, pid);
|
||||||
|
|
||||||
mt76_tx_status_lock(mdev, &list);
|
mt76_tx_status_lock(mdev, &list);
|
||||||
skb = mt76_tx_status_skb_get(mdev, &sta->wcid, pid, &list);
|
skb = mt76_tx_status_skb_get(mdev, &sta->wcid, pid, &list);
|
||||||
if (skb) {
|
if (skb) {
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <linux/etherdevice.h>
|
#include <linux/etherdevice.h>
|
||||||
#include <linux/timekeeping.h>
|
#include <linux/timekeeping.h>
|
||||||
#include "mt7615.h"
|
#include "mt7615.h"
|
||||||
|
#include "../trace.h"
|
||||||
#include "../dma.h"
|
#include "../dma.h"
|
||||||
#include "mac.h"
|
#include "mac.h"
|
||||||
|
|
||||||
|
@ -1218,6 +1219,8 @@ static bool mt7615_mac_add_txs_skb(struct mt7615_dev *dev,
|
||||||
if (pid < MT_PACKET_ID_FIRST)
|
if (pid < MT_PACKET_ID_FIRST)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
trace_mac_txdone(mdev, sta->wcid.idx, pid);
|
||||||
|
|
||||||
mt76_tx_status_lock(mdev, &list);
|
mt76_tx_status_lock(mdev, &list);
|
||||||
skb = mt76_tx_status_skb_get(mdev, &sta->wcid, pid, &list);
|
skb = mt76_tx_status_skb_get(mdev, &sta->wcid, pid, &list);
|
||||||
if (skb) {
|
if (skb) {
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include "mt76x02.h"
|
#include "mt76x02.h"
|
||||||
#include "mt76x02_trace.h"
|
#include "mt76x02_trace.h"
|
||||||
|
#include "trace.h"
|
||||||
|
|
||||||
void mt76x02_mac_reset_counters(struct mt76x02_dev *dev)
|
void mt76x02_mac_reset_counters(struct mt76x02_dev *dev)
|
||||||
{
|
{
|
||||||
|
@ -910,7 +911,7 @@ void mt76x02_tx_complete_skb(struct mt76_dev *mdev, enum mt76_txq_id qid,
|
||||||
|
|
||||||
txwi_ptr = mt76_get_txwi_ptr(mdev, e->txwi);
|
txwi_ptr = mt76_get_txwi_ptr(mdev, e->txwi);
|
||||||
txwi = (struct mt76x02_txwi *)txwi_ptr;
|
txwi = (struct mt76x02_txwi *)txwi_ptr;
|
||||||
trace_mac_txdone_add(dev, txwi->wcid, txwi->pktid);
|
trace_mac_txdone(mdev, txwi->wcid, txwi->pktid);
|
||||||
|
|
||||||
mt76_tx_complete_skb(mdev, e->skb);
|
mt76_tx_complete_skb(mdev, e->skb);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#define DEV_PR_ARG __entry->wiphy_name
|
#define DEV_PR_ARG __entry->wiphy_name
|
||||||
|
|
||||||
#define TXID_ENTRY __field(u8, wcid) __field(u8, pktid)
|
#define TXID_ENTRY __field(u8, wcid) __field(u8, pktid)
|
||||||
#define TXID_ASSIGN __entry->wcid = wcid; __entry->pktid = pktid
|
|
||||||
#define TXID_PR_FMT " [%d:%d]"
|
#define TXID_PR_FMT " [%d:%d]"
|
||||||
#define TXID_PR_ARG __entry->wcid, __entry->pktid
|
#define TXID_PR_ARG __entry->wcid, __entry->pktid
|
||||||
|
|
||||||
|
@ -36,28 +35,6 @@ DECLARE_EVENT_CLASS(dev_evt,
|
||||||
TP_printk(DEV_PR_FMT, DEV_PR_ARG)
|
TP_printk(DEV_PR_FMT, DEV_PR_ARG)
|
||||||
);
|
);
|
||||||
|
|
||||||
DECLARE_EVENT_CLASS(dev_txid_evt,
|
|
||||||
TP_PROTO(struct mt76x02_dev *dev, u8 wcid, u8 pktid),
|
|
||||||
TP_ARGS(dev, wcid, pktid),
|
|
||||||
TP_STRUCT__entry(
|
|
||||||
DEV_ENTRY
|
|
||||||
TXID_ENTRY
|
|
||||||
),
|
|
||||||
TP_fast_assign(
|
|
||||||
DEV_ASSIGN;
|
|
||||||
TXID_ASSIGN;
|
|
||||||
),
|
|
||||||
TP_printk(
|
|
||||||
DEV_PR_FMT TXID_PR_FMT,
|
|
||||||
DEV_PR_ARG, TXID_PR_ARG
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
DEFINE_EVENT(dev_txid_evt, mac_txdone_add,
|
|
||||||
TP_PROTO(struct mt76x02_dev *dev, u8 wcid, u8 pktid),
|
|
||||||
TP_ARGS(dev, wcid, pktid)
|
|
||||||
);
|
|
||||||
|
|
||||||
DEFINE_EVENT(dev_evt, mac_txstat_poll,
|
DEFINE_EVENT(dev_evt, mac_txstat_poll,
|
||||||
TP_PROTO(struct mt76x02_dev *dev),
|
TP_PROTO(struct mt76x02_dev *dev),
|
||||||
TP_ARGS(dev)
|
TP_ARGS(dev)
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#define CREATE_TRACE_POINTS
|
#define CREATE_TRACE_POINTS
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(mac_txdone);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(dev_irq);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(dev_irq);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#define MAXNAME 32
|
#define MAXNAME 32
|
||||||
#define DEV_ENTRY __array(char, wiphy_name, 32)
|
#define DEV_ENTRY __array(char, wiphy_name, 32)
|
||||||
#define DEV_ASSIGN strlcpy(__entry->wiphy_name, \
|
#define DEVICE_ASSIGN strlcpy(__entry->wiphy_name, \
|
||||||
wiphy_name(dev->hw->wiphy), MAXNAME)
|
wiphy_name(dev->hw->wiphy), MAXNAME)
|
||||||
#define DEV_PR_FMT "%s"
|
#define DEV_PR_FMT "%s"
|
||||||
#define DEV_PR_ARG __entry->wiphy_name
|
#define DEV_PR_ARG __entry->wiphy_name
|
||||||
|
@ -24,6 +24,11 @@
|
||||||
#define REG_PR_FMT " %04x=%08x"
|
#define REG_PR_FMT " %04x=%08x"
|
||||||
#define REG_PR_ARG __entry->reg, __entry->val
|
#define REG_PR_ARG __entry->reg, __entry->val
|
||||||
|
|
||||||
|
#define TXID_ENTRY __field(u8, wcid) __field(u8, pktid)
|
||||||
|
#define TXID_ASSIGN __entry->wcid = wcid; __entry->pktid = pktid
|
||||||
|
#define TXID_PR_FMT " [%d:%d]"
|
||||||
|
#define TXID_PR_ARG __entry->wcid, __entry->pktid
|
||||||
|
|
||||||
DECLARE_EVENT_CLASS(dev_reg_evt,
|
DECLARE_EVENT_CLASS(dev_reg_evt,
|
||||||
TP_PROTO(struct mt76_dev *dev, u32 reg, u32 val),
|
TP_PROTO(struct mt76_dev *dev, u32 reg, u32 val),
|
||||||
TP_ARGS(dev, reg, val),
|
TP_ARGS(dev, reg, val),
|
||||||
|
@ -32,7 +37,7 @@ DECLARE_EVENT_CLASS(dev_reg_evt,
|
||||||
REG_ENTRY
|
REG_ENTRY
|
||||||
),
|
),
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
DEV_ASSIGN;
|
DEVICE_ASSIGN;
|
||||||
REG_ASSIGN;
|
REG_ASSIGN;
|
||||||
),
|
),
|
||||||
TP_printk(
|
TP_printk(
|
||||||
|
@ -63,7 +68,7 @@ TRACE_EVENT(dev_irq,
|
||||||
),
|
),
|
||||||
|
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
DEV_ASSIGN;
|
DEVICE_ASSIGN;
|
||||||
__entry->val = val;
|
__entry->val = val;
|
||||||
__entry->mask = mask;
|
__entry->mask = mask;
|
||||||
),
|
),
|
||||||
|
@ -74,6 +79,28 @@ TRACE_EVENT(dev_irq,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
DECLARE_EVENT_CLASS(dev_txid_evt,
|
||||||
|
TP_PROTO(struct mt76_dev *dev, u8 wcid, u8 pktid),
|
||||||
|
TP_ARGS(dev, wcid, pktid),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
DEV_ENTRY
|
||||||
|
TXID_ENTRY
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
DEVICE_ASSIGN;
|
||||||
|
TXID_ASSIGN;
|
||||||
|
),
|
||||||
|
TP_printk(
|
||||||
|
DEV_PR_FMT TXID_PR_FMT,
|
||||||
|
DEV_PR_ARG, TXID_PR_ARG
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
DEFINE_EVENT(dev_txid_evt, mac_txdone,
|
||||||
|
TP_PROTO(struct mt76_dev *dev, u8 wcid, u8 pktid),
|
||||||
|
TP_ARGS(dev, wcid, pktid)
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef TRACE_INCLUDE_PATH
|
#undef TRACE_INCLUDE_PATH
|
||||||
|
|
Loading…
Reference in New Issue