WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / wireless / mediatek / mt76 / trace.h
blobc3d0ef8e28903855b5510cb0eae2b220b2f52592
1 /* SPDX-License-Identifier: ISC */
2 /*
3 * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
4 */
6 #if !defined(__MT76_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define __MT76_TRACE_H
9 #include <linux/tracepoint.h>
10 #include "mt76.h"
12 #undef TRACE_SYSTEM
13 #define TRACE_SYSTEM mt76
15 #define MAXNAME 32
16 #define DEV_ENTRY __array(char, wiphy_name, 32)
17 #define DEVICE_ASSIGN strlcpy(__entry->wiphy_name, \
18 wiphy_name(dev->hw->wiphy), MAXNAME)
19 #define DEV_PR_FMT "%s"
20 #define DEV_PR_ARG __entry->wiphy_name
22 #define REG_ENTRY __field(u32, reg) __field(u32, val)
23 #define REG_ASSIGN __entry->reg = reg; __entry->val = val
24 #define REG_PR_FMT " %04x=%08x"
25 #define REG_PR_ARG __entry->reg, __entry->val
27 #define TXID_ENTRY __field(u8, wcid) __field(u8, pktid)
28 #define TXID_ASSIGN __entry->wcid = wcid; __entry->pktid = pktid
29 #define TXID_PR_FMT " [%d:%d]"
30 #define TXID_PR_ARG __entry->wcid, __entry->pktid
32 DECLARE_EVENT_CLASS(dev_reg_evt,
33 TP_PROTO(struct mt76_dev *dev, u32 reg, u32 val),
34 TP_ARGS(dev, reg, val),
35 TP_STRUCT__entry(
36 DEV_ENTRY
37 REG_ENTRY
39 TP_fast_assign(
40 DEVICE_ASSIGN;
41 REG_ASSIGN;
43 TP_printk(
44 DEV_PR_FMT REG_PR_FMT,
45 DEV_PR_ARG, REG_PR_ARG
49 DEFINE_EVENT(dev_reg_evt, reg_rr,
50 TP_PROTO(struct mt76_dev *dev, u32 reg, u32 val),
51 TP_ARGS(dev, reg, val)
54 DEFINE_EVENT(dev_reg_evt, reg_wr,
55 TP_PROTO(struct mt76_dev *dev, u32 reg, u32 val),
56 TP_ARGS(dev, reg, val)
59 TRACE_EVENT(dev_irq,
60 TP_PROTO(struct mt76_dev *dev, u32 val, u32 mask),
62 TP_ARGS(dev, val, mask),
64 TP_STRUCT__entry(
65 DEV_ENTRY
66 __field(u32, val)
67 __field(u32, mask)
70 TP_fast_assign(
71 DEVICE_ASSIGN;
72 __entry->val = val;
73 __entry->mask = mask;
76 TP_printk(
77 DEV_PR_FMT " %08x & %08x",
78 DEV_PR_ARG, __entry->val, __entry->mask
82 DECLARE_EVENT_CLASS(dev_txid_evt,
83 TP_PROTO(struct mt76_dev *dev, u8 wcid, u8 pktid),
84 TP_ARGS(dev, wcid, pktid),
85 TP_STRUCT__entry(
86 DEV_ENTRY
87 TXID_ENTRY
89 TP_fast_assign(
90 DEVICE_ASSIGN;
91 TXID_ASSIGN;
93 TP_printk(
94 DEV_PR_FMT TXID_PR_FMT,
95 DEV_PR_ARG, TXID_PR_ARG
99 DEFINE_EVENT(dev_txid_evt, mac_txdone,
100 TP_PROTO(struct mt76_dev *dev, u8 wcid, u8 pktid),
101 TP_ARGS(dev, wcid, pktid)
104 #endif
106 #undef TRACE_INCLUDE_PATH
107 #define TRACE_INCLUDE_PATH .
108 #undef TRACE_INCLUDE_FILE
109 #define TRACE_INCLUDE_FILE trace
111 #include <trace/define_trace.h>