Merge tag 'hwmon-for-v6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / net / batman-adv / trace.h
blob6b816cf1a953bba1b7d636ac42b62d93393ddced
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) B.A.T.M.A.N. contributors:
4 * Sven Eckelmann
5 */
7 #if !defined(_NET_BATMAN_ADV_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
8 #define _NET_BATMAN_ADV_TRACE_H_
10 #include "main.h"
12 #include <linux/netdevice.h>
13 #include <linux/percpu.h>
14 #include <linux/printk.h>
15 #include <linux/tracepoint.h>
17 #undef TRACE_SYSTEM
18 #define TRACE_SYSTEM batadv
20 /* provide dummy function when tracing is disabled */
21 #if !defined(CONFIG_BATMAN_ADV_TRACING)
23 #undef TRACE_EVENT
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),
36 TP_STRUCT__entry(
37 __string(device, bat_priv->soft_iface->name)
38 __string(driver, KBUILD_MODNAME)
39 __vstring(msg, vaf->fmt, vaf->va)
42 TP_fast_assign(
43 __assign_str(device);
44 __assign_str(driver);
45 __assign_vstr(msg, vaf->fmt, vaf->va);
48 TP_printk(
49 "%s %s %s",
50 __get_str(driver),
51 __get_str(device),
52 __get_str(msg)
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>