1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) B.A.T.M.A.N. contributors:
7 #if !defined(_NET_BATMAN_ADV_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
8 #define _NET_BATMAN_ADV_TRACE_H_
12 #include <linux/netdevice.h>
13 #include <linux/percpu.h>
14 #include <linux/printk.h>
15 #include <linux/tracepoint.h>
18 #define TRACE_SYSTEM batadv
20 /* provide dummy function when tracing is disabled */
21 #if !defined(CONFIG_BATMAN_ADV_TRACING)
24 #define TRACE_EVENT(name, proto, ...) \
25 static inline void trace_ ## name(proto) {}
27 #endif /* CONFIG_BATMAN_ADV_TRACING */
29 TRACE_EVENT(batadv_dbg
,
31 TP_PROTO(struct batadv_priv
*bat_priv
,
32 struct va_format
*vaf
),
34 TP_ARGS(bat_priv
, vaf
),
37 __string(device
, bat_priv
->soft_iface
->name
)
38 __string(driver
, KBUILD_MODNAME
)
39 __vstring(msg
, vaf
->fmt
, vaf
->va
)
45 __assign_vstr(msg
, vaf
->fmt
, vaf
->va
);
56 #endif /* _NET_BATMAN_ADV_TRACE_H_ || TRACE_HEADER_MULTI_READ */
58 #undef TRACE_INCLUDE_PATH
59 #define TRACE_INCLUDE_PATH .
60 #undef TRACE_INCLUDE_FILE
61 #define TRACE_INCLUDE_FILE trace
63 /* This part must be outside protection */
64 #include <trace/define_trace.h>