xref: /freebsd/sys/contrib/dev/athk/trace.h (revision 1da7f3f6f72b2245e458fc7195733268ae4a1136)
1 /*
2  * Copyright (c) 2014 Qualcomm Atheros, Inc.
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
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.
15  */
16 
17 #if !defined(_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
18 #define _TRACE_H
19 
20 #include <linux/tracepoint.h>
21 #include "ath.h"
22 
23 #undef TRACE_SYSTEM
24 #define TRACE_SYSTEM ath
25 
26 #if !defined(CONFIG_ATH_TRACEPOINTS)
27 
28 #undef TRACE_EVENT
29 #define TRACE_EVENT(name, proto, ...) static inline void trace_ ## name(proto) {}
30 
31 #endif /* CONFIG_ATH_TRACEPOINTS */
32 
33 TRACE_EVENT(ath_log,
34 
35 	    TP_PROTO(struct wiphy *wiphy,
36 		     struct va_format *vaf),
37 
38 	    TP_ARGS(wiphy, vaf),
39 
40 	    TP_STRUCT__entry(
41 		    __string(device, wiphy_name(wiphy))
42 		    __string(driver, KBUILD_MODNAME)
43 		    __vstring(msg, vaf->fmt, vaf->va)
44 	    ),
45 
46 	    TP_fast_assign(
47 		    __assign_str(device, wiphy_name(wiphy));
48 		    __assign_str(driver, KBUILD_MODNAME);
49 		    __assign_vstr(msg, vaf->fmt, vaf->va);
50 	    ),
51 
52 	    TP_printk(
53 		    "%s %s %s",
54 		    __get_str(driver),
55 		    __get_str(device),
56 		    __get_str(msg)
57 	    )
58 );
59 
60 #endif /* _TRACE_H || TRACE_HEADER_MULTI_READ */
61 
62 #undef TRACE_INCLUDE_PATH
63 #define TRACE_INCLUDE_PATH .
64 #undef TRACE_INCLUDE_FILE
65 #define TRACE_INCLUDE_FILE trace
66 
67 /* This part must be outside protection */
68 #include <trace/define_trace.h>
69