]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h
96a962abc89a7929375ed854582d9dbd10275ce0
2 * Copyright (c) 2011 Broadcom Corporation
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 ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #if !defined(__TRACE_BRCMSMAC_H) || defined(TRACE_HEADER_MULTI_READ)
19 #define __TRACE_BRCMSMAC_H
21 #include <linux/types.h>
22 #include <linux/device.h>
23 #include <linux/tracepoint.h>
24 #include "mac80211_if.h"
26 #ifndef CONFIG_BRCM_TRACING
28 #define TRACE_EVENT(name, proto, ...) \
29 static inline void trace_ ## name(proto) {}
30 #undef DECLARE_EVENT_CLASS
31 #define DECLARE_EVENT_CLASS(...)
33 #define DEFINE_EVENT(evt_class, name, proto, ...) \
34 static inline void trace_ ## name(proto) {}
38 #define TRACE_SYSTEM brcmsmac
41 * We define a tracepoint, its arguments, its printk format and its
42 * 'fast binary record' layout.
44 TRACE_EVENT(brcms_timer
,
45 /* TPPROTO is the prototype of the function called by this tracepoint */
46 TP_PROTO(struct brcms_timer
*t
),
48 * TPARGS(firstarg, p) are the parameters names, same as found in the
53 * Fast binary tracing: define the trace record via TP_STRUCT__entry().
54 * You can think about it like a regular C structure local variable
60 __field(uint
, periodic
)
64 __entry
->set
= t
->set
;
65 __entry
->periodic
= t
->periodic
;
68 "ms=%u set=%u periodic=%u",
69 __entry
->ms
, __entry
->set
, __entry
->periodic
73 TRACE_EVENT(brcms_dpc
,
74 TP_PROTO(unsigned long data
),
77 __field(unsigned long, data
)
89 #define TRACE_SYSTEM brcmsmac_tx
91 TRACE_EVENT(brcms_txdesc
,
92 TP_PROTO(const struct device
*dev
,
93 void *txh
, size_t txh_len
),
94 TP_ARGS(dev
, txh
, txh_len
),
96 __string(dev
, dev_name(dev
))
97 __dynamic_array(u8
, txh
, txh_len
)
100 __assign_str(dev
, dev_name(dev
));
101 memcpy(__get_dynamic_array(txh
), txh
, txh_len
);
103 TP_printk("[%s] txdesc", __get_str(dev
))
106 TRACE_EVENT(brcms_txstatus
,
107 TP_PROTO(const struct device
*dev
, u16 framelen
, u16 frameid
,
108 u16 status
, u16 lasttxtime
, u16 sequence
, u16 phyerr
,
110 TP_ARGS(dev
, framelen
, frameid
, status
, lasttxtime
, sequence
, phyerr
,
113 __string(dev
, dev_name(dev
))
114 __field(u16
, framelen
)
115 __field(u16
, frameid
)
117 __field(u16
, lasttxtime
)
118 __field(u16
, sequence
)
120 __field(u16
, ackphyrxsh
)
123 __assign_str(dev
, dev_name(dev
));
124 __entry
->framelen
= framelen
;
125 __entry
->frameid
= frameid
;
126 __entry
->status
= status
;
127 __entry
->lasttxtime
= lasttxtime
;
128 __entry
->sequence
= sequence
;
129 __entry
->phyerr
= phyerr
;
130 __entry
->ackphyrxsh
= ackphyrxsh
;
132 TP_printk("[%s] FrameId %#04x TxStatus %#04x LastTxTime %#04x "
133 "Seq %#04x PHYTxStatus %#04x RxAck %#04x",
134 __get_str(dev
), __entry
->frameid
, __entry
->status
,
135 __entry
->lasttxtime
, __entry
->sequence
, __entry
->phyerr
,
140 #define TRACE_SYSTEM brcmsmac_msg
142 #define MAX_MSG_LEN 100
144 DECLARE_EVENT_CLASS(brcms_msg_event
,
145 TP_PROTO(struct va_format
*vaf
),
148 __dynamic_array(char, msg
, MAX_MSG_LEN
)
151 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg
),
152 MAX_MSG_LEN
, vaf
->fmt
,
153 *vaf
->va
) >= MAX_MSG_LEN
);
155 TP_printk("%s", __get_str(msg
))
158 DEFINE_EVENT(brcms_msg_event
, brcms_info
,
159 TP_PROTO(struct va_format
*vaf
),
163 DEFINE_EVENT(brcms_msg_event
, brcms_warn
,
164 TP_PROTO(struct va_format
*vaf
),
168 DEFINE_EVENT(brcms_msg_event
, brcms_err
,
169 TP_PROTO(struct va_format
*vaf
),
173 DEFINE_EVENT(brcms_msg_event
, brcms_crit
,
174 TP_PROTO(struct va_format
*vaf
),
178 TRACE_EVENT(brcms_dbg
,
179 TP_PROTO(u32 level
, const char *func
, struct va_format
*vaf
),
180 TP_ARGS(level
, func
, vaf
),
184 __dynamic_array(char, msg
, MAX_MSG_LEN
)
187 __entry
->level
= level
;
188 __assign_str(func
, func
);
189 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg
),
190 MAX_MSG_LEN
, vaf
->fmt
,
191 *vaf
->va
) >= MAX_MSG_LEN
);
193 TP_printk("%s: %s", __get_str(func
), __get_str(msg
))
196 #endif /* __TRACE_BRCMSMAC_H */
198 #ifdef CONFIG_BRCM_TRACING
200 #undef TRACE_INCLUDE_PATH
201 #define TRACE_INCLUDE_PATH .
202 #undef TRACE_INCLUDE_FILE
203 #define TRACE_INCLUDE_FILE brcms_trace_events
205 #include <trace/define_trace.h>
207 #endif /* CONFIG_BRCM_TRACING */