Merge tag 'iommu-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
[linux/fpc-iii.git] / net / batman-adv / trace.h
bloba87547570b4e0172af8af524ae5ab5b1680f175b
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2010-2020 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/bug.h>
13 #include <linux/kernel.h>
14 #include <linux/netdevice.h>
15 #include <linux/percpu.h>
16 #include <linux/printk.h>
17 #include <linux/tracepoint.h>
19 #undef TRACE_SYSTEM
20 #define TRACE_SYSTEM batadv
22 /* provide dummy function when tracing is disabled */
23 #if !defined(CONFIG_BATMAN_ADV_TRACING)
25 #undef TRACE_EVENT
26 #define TRACE_EVENT(name, proto, ...) \
27 static inline void trace_ ## name(proto) {}
29 #endif /* CONFIG_BATMAN_ADV_TRACING */
31 #define BATADV_MAX_MSG_LEN 256
33 TRACE_EVENT(batadv_dbg,
35 TP_PROTO(struct batadv_priv *bat_priv,
36 struct va_format *vaf),
38 TP_ARGS(bat_priv, vaf),
40 TP_STRUCT__entry(
41 __string(device, bat_priv->soft_iface->name)
42 __string(driver, KBUILD_MODNAME)
43 __dynamic_array(char, msg, BATADV_MAX_MSG_LEN)
46 TP_fast_assign(
47 __assign_str(device, bat_priv->soft_iface->name);
48 __assign_str(driver, KBUILD_MODNAME);
49 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
50 BATADV_MAX_MSG_LEN,
51 vaf->fmt,
52 *vaf->va) >= BATADV_MAX_MSG_LEN);
55 TP_printk(
56 "%s %s %s",
57 __get_str(driver),
58 __get_str(device),
59 __get_str(msg)
63 #endif /* _NET_BATMAN_ADV_TRACE_H_ || TRACE_HEADER_MULTI_READ */
65 #undef TRACE_INCLUDE_PATH
66 #define TRACE_INCLUDE_PATH .
67 #undef TRACE_INCLUDE_FILE
68 #define TRACE_INCLUDE_FILE trace
70 /* This part must be outside protection */
71 #include <trace/define_trace.h>