Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / drivers / net / wireless / brcm80211 / brcmsmac / brcms_trace_events.h
1 /*
2  * Copyright (c) 2011 Broadcom Corporation
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 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.
15  */
16
17 #undef TRACE_SYSTEM
18 #define TRACE_SYSTEM brcmsmac
19
20 #if !defined(__TRACE_BRCMSMAC_H) || defined(TRACE_HEADER_MULTI_READ)
21
22 #define __TRACE_BRCMSMAC_H
23
24 #include <linux/tracepoint.h>
25 #include "mac80211_if.h"
26
27 #ifndef CONFIG_BRCMDBG
28 #undef TRACE_EVENT
29 #define TRACE_EVENT(name, proto, ...) \
30 static inline void trace_ ## name(proto) {}
31 #endif
32
33 /*
34  * We define a tracepoint, its arguments, its printk format and its
35  * 'fast binary record' layout.
36  */
37 TRACE_EVENT(brcms_timer,
38         /* TPPROTO is the prototype of the function called by this tracepoint */
39         TP_PROTO(struct brcms_timer *t),
40         /*
41          * TPARGS(firstarg, p) are the parameters names, same as found in the
42          * prototype.
43          */
44         TP_ARGS(t),
45         /*
46          * Fast binary tracing: define the trace record via TP_STRUCT__entry().
47          * You can think about it like a regular C structure local variable
48          * definition.
49          */
50         TP_STRUCT__entry(
51                 __field(uint, ms)
52                 __field(uint, set)
53                 __field(uint, periodic)
54         ),
55         TP_fast_assign(
56                 __entry->ms = t->ms;
57                 __entry->set = t->set;
58                 __entry->periodic = t->periodic;
59         ),
60         TP_printk(
61                 "ms=%u set=%u periodic=%u",
62                 __entry->ms, __entry->set, __entry->periodic
63         )
64 );
65
66 TRACE_EVENT(brcms_dpc,
67         TP_PROTO(unsigned long data),
68         TP_ARGS(data),
69         TP_STRUCT__entry(
70                 __field(unsigned long, data)
71         ),
72         TP_fast_assign(
73                 __entry->data = data;
74         ),
75         TP_printk(
76                 "data=%p",
77                 (void *)__entry->data
78         )
79 );
80
81 #endif /* __TRACE_BRCMSMAC_H */
82
83 #ifdef CONFIG_BRCMDBG
84
85 #undef TRACE_INCLUDE_PATH
86 #define TRACE_INCLUDE_PATH .
87 #undef TRACE_INCLUDE_FILE
88 #define TRACE_INCLUDE_FILE brcms_trace_events
89
90 #include <trace/define_trace.h>
91
92 #endif /* CONFIG_BRCMDBG */