1 /* SPDX-License-Identifier: ISC */
3 * Copyright (C) 2018 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
6 #if !defined(__MT76_USB_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define __MT76_USB_TRACE_H
9 #include <linux/tracepoint.h>
13 #define TRACE_SYSTEM mt76_usb
16 #define DEV_ENTRY __array(char, wiphy_name, 32)
17 #define DEV_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 "reg:0x%04x=0x%08x"
25 #define REG_PR_ARG __entry->reg, __entry->val
27 DECLARE_EVENT_CLASS(dev_reg_evt
,
28 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
29 TP_ARGS(dev
, reg
, val
),
39 DEV_PR_FMT REG_PR_FMT
,
40 DEV_PR_ARG
, REG_PR_ARG
44 DEFINE_EVENT(dev_reg_evt
, usb_reg_rr
,
45 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
46 TP_ARGS(dev
, reg
, val
)
49 DEFINE_EVENT(dev_reg_evt
, usb_reg_wr
,
50 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
51 TP_ARGS(dev
, reg
, val
)
54 DECLARE_EVENT_CLASS(urb_transfer
,
55 TP_PROTO(struct mt76_dev
*dev
, struct urb
*u
),
58 DEV_ENTRY
__field(unsigned int, pipe
) __field(u32
, len
)
62 __entry
->pipe
= u
->pipe
;
63 __entry
->len
= u
->transfer_buffer_length
;
65 TP_printk(DEV_PR_FMT
"p:%08x len:%u",
66 DEV_PR_ARG
, __entry
->pipe
, __entry
->len
)
69 DEFINE_EVENT(urb_transfer
, submit_urb
,
70 TP_PROTO(struct mt76_dev
*dev
, struct urb
*u
),
74 DEFINE_EVENT(urb_transfer
, rx_urb
,
75 TP_PROTO(struct mt76_dev
*dev
, struct urb
*u
),
81 #undef TRACE_INCLUDE_PATH
82 #define TRACE_INCLUDE_PATH .
83 #undef TRACE_INCLUDE_FILE
84 #define TRACE_INCLUDE_FILE usb_trace
86 #include <trace/define_trace.h>