2 * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
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.
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.
17 #if !defined(__MT76_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
18 #define __MT76_TRACE_H
20 #include <linux/tracepoint.h>
24 #define TRACE_SYSTEM mt76
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
32 #define REG_ENTRY __field(u32, reg) __field(u32, val)
33 #define REG_ASSIGN __entry->reg = reg; __entry->val = val
34 #define REG_PR_FMT " %04x=%08x"
35 #define REG_PR_ARG __entry->reg, __entry->val
37 DECLARE_EVENT_CLASS(dev_reg_evt
,
38 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
39 TP_ARGS(dev
, reg
, val
),
49 DEV_PR_FMT REG_PR_FMT
,
50 DEV_PR_ARG
, REG_PR_ARG
54 DEFINE_EVENT(dev_reg_evt
, reg_rr
,
55 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
56 TP_ARGS(dev
, reg
, val
)
59 DEFINE_EVENT(dev_reg_evt
, reg_wr
,
60 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
61 TP_ARGS(dev
, reg
, val
)
66 #undef TRACE_INCLUDE_PATH
67 #define TRACE_INCLUDE_PATH .
68 #undef TRACE_INCLUDE_FILE
69 #define TRACE_INCLUDE_FILE trace
71 #include <trace/define_trace.h>