x86/xen: resume timer irqs early
[linux/fpc-iii.git] / drivers / net / wireless / ath / ath10k / trace.h
blob85e806bf7257ca231e21ace94a1abf8f9d83290a
1 /*
2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #if !defined(_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
20 #include <linux/tracepoint.h>
22 #define _TRACE_H_
24 /* create empty functions when tracing is disabled */
25 #if !defined(CONFIG_ATH10K_TRACING)
26 #undef TRACE_EVENT
27 #define TRACE_EVENT(name, proto, ...) \
28 static inline void trace_ ## name(proto) {}
29 #undef DECLARE_EVENT_CLASS
30 #define DECLARE_EVENT_CLASS(...)
31 #undef DEFINE_EVENT
32 #define DEFINE_EVENT(evt_class, name, proto, ...) \
33 static inline void trace_ ## name(proto) {}
34 #endif /* !CONFIG_ATH10K_TRACING || __CHECKER__ */
36 #undef TRACE_SYSTEM
37 #define TRACE_SYSTEM ath10k
39 #define ATH10K_MSG_MAX 200
41 DECLARE_EVENT_CLASS(ath10k_log_event,
42 TP_PROTO(struct va_format *vaf),
43 TP_ARGS(vaf),
44 TP_STRUCT__entry(
45 __dynamic_array(char, msg, ATH10K_MSG_MAX)
47 TP_fast_assign(
48 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
49 ATH10K_MSG_MAX,
50 vaf->fmt,
51 *vaf->va) >= ATH10K_MSG_MAX);
53 TP_printk("%s", __get_str(msg))
56 DEFINE_EVENT(ath10k_log_event, ath10k_log_err,
57 TP_PROTO(struct va_format *vaf),
58 TP_ARGS(vaf)
61 DEFINE_EVENT(ath10k_log_event, ath10k_log_warn,
62 TP_PROTO(struct va_format *vaf),
63 TP_ARGS(vaf)
66 DEFINE_EVENT(ath10k_log_event, ath10k_log_info,
67 TP_PROTO(struct va_format *vaf),
68 TP_ARGS(vaf)
71 TRACE_EVENT(ath10k_log_dbg,
72 TP_PROTO(unsigned int level, struct va_format *vaf),
73 TP_ARGS(level, vaf),
74 TP_STRUCT__entry(
75 __field(unsigned int, level)
76 __dynamic_array(char, msg, ATH10K_MSG_MAX)
78 TP_fast_assign(
79 __entry->level = level;
80 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
81 ATH10K_MSG_MAX,
82 vaf->fmt,
83 *vaf->va) >= ATH10K_MSG_MAX);
85 TP_printk("%s", __get_str(msg))
88 TRACE_EVENT(ath10k_log_dbg_dump,
89 TP_PROTO(const char *msg, const char *prefix,
90 const void *buf, size_t buf_len),
92 TP_ARGS(msg, prefix, buf, buf_len),
94 TP_STRUCT__entry(
95 __string(msg, msg)
96 __string(prefix, prefix)
97 __field(size_t, buf_len)
98 __dynamic_array(u8, buf, buf_len)
101 TP_fast_assign(
102 __assign_str(msg, msg);
103 __assign_str(prefix, prefix);
104 __entry->buf_len = buf_len;
105 memcpy(__get_dynamic_array(buf), buf, buf_len);
108 TP_printk(
109 "%s/%s\n", __get_str(prefix), __get_str(msg)
113 TRACE_EVENT(ath10k_wmi_cmd,
114 TP_PROTO(int id, void *buf, size_t buf_len),
116 TP_ARGS(id, buf, buf_len),
118 TP_STRUCT__entry(
119 __field(unsigned int, id)
120 __field(size_t, buf_len)
121 __dynamic_array(u8, buf, buf_len)
124 TP_fast_assign(
125 __entry->id = id;
126 __entry->buf_len = buf_len;
127 memcpy(__get_dynamic_array(buf), buf, buf_len);
130 TP_printk(
131 "id %d len %zu",
132 __entry->id,
133 __entry->buf_len
137 TRACE_EVENT(ath10k_wmi_event,
138 TP_PROTO(int id, void *buf, size_t buf_len),
140 TP_ARGS(id, buf, buf_len),
142 TP_STRUCT__entry(
143 __field(unsigned int, id)
144 __field(size_t, buf_len)
145 __dynamic_array(u8, buf, buf_len)
148 TP_fast_assign(
149 __entry->id = id;
150 __entry->buf_len = buf_len;
151 memcpy(__get_dynamic_array(buf), buf, buf_len);
154 TP_printk(
155 "id %d len %zu",
156 __entry->id,
157 __entry->buf_len
161 #endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
163 /* we don't want to use include/trace/events */
164 #undef TRACE_INCLUDE_PATH
165 #define TRACE_INCLUDE_PATH .
166 #undef TRACE_INCLUDE_FILE
167 #define TRACE_INCLUDE_FILE trace
169 /* This part must be outside protection */
170 #include <trace/define_trace.h>