| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: ISC */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name> |
|---|
| 3 | | - * |
|---|
| 4 | | - * Permission to use, copy, modify, and/or distribute this software for any |
|---|
| 5 | | - * purpose with or without fee is hereby granted, provided that the above |
|---|
| 6 | | - * copyright notice and this permission notice appear in all copies. |
|---|
| 7 | | - * |
|---|
| 8 | | - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|---|
| 9 | | - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|---|
| 10 | | - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|---|
| 11 | | - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|---|
| 12 | | - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|---|
| 13 | | - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|---|
| 14 | | - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | |
|---|
| 17 | 6 | #if !defined(__MT76_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) |
|---|
| .. | .. |
|---|
| 24 | 13 | #define TRACE_SYSTEM mt76 |
|---|
| 25 | 14 | |
|---|
| 26 | 15 | #define MAXNAME 32 |
|---|
| 27 | | -#define DEV_ENTRY __array(char, wiphy_name, 32) |
|---|
| 28 | | -#define DEV_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(dev->hw->wiphy), MAXNAME) |
|---|
| 29 | | -#define DEV_PR_FMT "%s" |
|---|
| 30 | | -#define DEV_PR_ARG __entry->wiphy_name |
|---|
| 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 |
|---|
| 31 | 21 | |
|---|
| 32 | 22 | #define REG_ENTRY __field(u32, reg) __field(u32, val) |
|---|
| 33 | 23 | #define REG_ASSIGN __entry->reg = reg; __entry->val = val |
|---|
| 34 | 24 | #define REG_PR_FMT " %04x=%08x" |
|---|
| 35 | 25 | #define REG_PR_ARG __entry->reg, __entry->val |
|---|
| 26 | + |
|---|
| 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 |
|---|
| 36 | 31 | |
|---|
| 37 | 32 | DECLARE_EVENT_CLASS(dev_reg_evt, |
|---|
| 38 | 33 | TP_PROTO(struct mt76_dev *dev, u32 reg, u32 val), |
|---|
| .. | .. |
|---|
| 42 | 37 | REG_ENTRY |
|---|
| 43 | 38 | ), |
|---|
| 44 | 39 | TP_fast_assign( |
|---|
| 45 | | - DEV_ASSIGN; |
|---|
| 40 | + DEVICE_ASSIGN; |
|---|
| 46 | 41 | REG_ASSIGN; |
|---|
| 47 | 42 | ), |
|---|
| 48 | 43 | TP_printk( |
|---|
| .. | .. |
|---|
| 61 | 56 | TP_ARGS(dev, reg, val) |
|---|
| 62 | 57 | ); |
|---|
| 63 | 58 | |
|---|
| 59 | +TRACE_EVENT(dev_irq, |
|---|
| 60 | + TP_PROTO(struct mt76_dev *dev, u32 val, u32 mask), |
|---|
| 61 | + |
|---|
| 62 | + TP_ARGS(dev, val, mask), |
|---|
| 63 | + |
|---|
| 64 | + TP_STRUCT__entry( |
|---|
| 65 | + DEV_ENTRY |
|---|
| 66 | + __field(u32, val) |
|---|
| 67 | + __field(u32, mask) |
|---|
| 68 | + ), |
|---|
| 69 | + |
|---|
| 70 | + TP_fast_assign( |
|---|
| 71 | + DEVICE_ASSIGN; |
|---|
| 72 | + __entry->val = val; |
|---|
| 73 | + __entry->mask = mask; |
|---|
| 74 | + ), |
|---|
| 75 | + |
|---|
| 76 | + TP_printk( |
|---|
| 77 | + DEV_PR_FMT " %08x & %08x", |
|---|
| 78 | + DEV_PR_ARG, __entry->val, __entry->mask |
|---|
| 79 | + ) |
|---|
| 80 | +); |
|---|
| 81 | + |
|---|
| 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 |
|---|
| 88 | + ), |
|---|
| 89 | + TP_fast_assign( |
|---|
| 90 | + DEVICE_ASSIGN; |
|---|
| 91 | + TXID_ASSIGN; |
|---|
| 92 | + ), |
|---|
| 93 | + TP_printk( |
|---|
| 94 | + DEV_PR_FMT TXID_PR_FMT, |
|---|
| 95 | + DEV_PR_ARG, TXID_PR_ARG |
|---|
| 96 | + ) |
|---|
| 97 | +); |
|---|
| 98 | + |
|---|
| 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) |
|---|
| 102 | +); |
|---|
| 103 | + |
|---|
| 64 | 104 | #endif |
|---|
| 65 | 105 | |
|---|
| 66 | 106 | #undef TRACE_INCLUDE_PATH |
|---|