xref: /openbmc/linux/drivers/net/wireless/ath/trace.h (revision c01406f8)
1e6664dffSSujith Manoharan /*
2e6664dffSSujith Manoharan  * Copyright (c) 2014 Qualcomm Atheros, Inc.
3e6664dffSSujith Manoharan  *
4e6664dffSSujith Manoharan  * Permission to use, copy, modify, and/or distribute this software for any
5e6664dffSSujith Manoharan  * purpose with or without fee is hereby granted, provided that the above
6e6664dffSSujith Manoharan  * copyright notice and this permission notice appear in all copies.
7e6664dffSSujith Manoharan  *
8e6664dffSSujith Manoharan  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9e6664dffSSujith Manoharan  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10e6664dffSSujith Manoharan  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11e6664dffSSujith Manoharan  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12e6664dffSSujith Manoharan  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13e6664dffSSujith Manoharan  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14e6664dffSSujith Manoharan  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15e6664dffSSujith Manoharan  */
16e6664dffSSujith Manoharan 
17e6664dffSSujith Manoharan #if !defined(_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
18e6664dffSSujith Manoharan #define _TRACE_H
19e6664dffSSujith Manoharan 
20e6664dffSSujith Manoharan #include <linux/tracepoint.h>
21e6664dffSSujith Manoharan #include "ath.h"
22e6664dffSSujith Manoharan 
23e6664dffSSujith Manoharan #undef TRACE_SYSTEM
24e6664dffSSujith Manoharan #define TRACE_SYSTEM ath
25e6664dffSSujith Manoharan 
26e6664dffSSujith Manoharan #if !defined(CONFIG_ATH_TRACEPOINTS)
27e6664dffSSujith Manoharan 
28e6664dffSSujith Manoharan #undef TRACE_EVENT
29e6664dffSSujith Manoharan #define TRACE_EVENT(name, proto, ...) static inline void trace_ ## name(proto) {}
30e6664dffSSujith Manoharan 
31e6664dffSSujith Manoharan #endif /* CONFIG_ATH_TRACEPOINTS */
32e6664dffSSujith Manoharan 
33e6664dffSSujith Manoharan TRACE_EVENT(ath_log,
34e6664dffSSujith Manoharan 
35e6664dffSSujith Manoharan 	    TP_PROTO(struct wiphy *wiphy,
36e6664dffSSujith Manoharan 		     struct va_format *vaf),
37e6664dffSSujith Manoharan 
38e6664dffSSujith Manoharan 	    TP_ARGS(wiphy, vaf),
39e6664dffSSujith Manoharan 
40e6664dffSSujith Manoharan 	    TP_STRUCT__entry(
41e6664dffSSujith Manoharan 		    __string(device, wiphy_name(wiphy))
42e6664dffSSujith Manoharan 		    __string(driver, KBUILD_MODNAME)
43*c01406f8SSteven Rostedt (Google) 		    __vstring(msg, vaf->fmt, vaf->va)
44e6664dffSSujith Manoharan 	    ),
45e6664dffSSujith Manoharan 
46e6664dffSSujith Manoharan 	    TP_fast_assign(
47e6664dffSSujith Manoharan 		    __assign_str(device, wiphy_name(wiphy));
48e6664dffSSujith Manoharan 		    __assign_str(driver, KBUILD_MODNAME);
49*c01406f8SSteven Rostedt (Google) 		    __assign_vstr(msg, vaf->fmt, vaf->va);
50e6664dffSSujith Manoharan 	    ),
51e6664dffSSujith Manoharan 
52e6664dffSSujith Manoharan 	    TP_printk(
53e6664dffSSujith Manoharan 		    "%s %s %s",
54e6664dffSSujith Manoharan 		    __get_str(driver),
55e6664dffSSujith Manoharan 		    __get_str(device),
56e6664dffSSujith Manoharan 		    __get_str(msg)
57e6664dffSSujith Manoharan 	    )
58e6664dffSSujith Manoharan );
59e6664dffSSujith Manoharan 
60e6664dffSSujith Manoharan #endif /* _TRACE_H || TRACE_HEADER_MULTI_READ */
61e6664dffSSujith Manoharan 
62e6664dffSSujith Manoharan #undef TRACE_INCLUDE_PATH
63e6664dffSSujith Manoharan #define TRACE_INCLUDE_PATH .
64e6664dffSSujith Manoharan #undef TRACE_INCLUDE_FILE
65e6664dffSSujith Manoharan #define TRACE_INCLUDE_FILE trace
66e6664dffSSujith Manoharan 
67e6664dffSSujith Manoharan /* This part must be outside protection */
68e6664dffSSujith Manoharan #include <trace/define_trace.h>
69