Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / include / trace / events / xdp.h
blob1b61357d3f575ab8b3c5debd487714cb1430b2b5
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM xdp
4 #if !defined(_TRACE_XDP_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_XDP_H
7 #include <linux/netdevice.h>
8 #include <linux/filter.h>
9 #include <linux/tracepoint.h>
11 #define __XDP_ACT_MAP(FN) \
12 FN(ABORTED) \
13 FN(DROP) \
14 FN(PASS) \
15 FN(TX)
17 #define __XDP_ACT_TP_FN(x) \
18 TRACE_DEFINE_ENUM(XDP_##x);
19 #define __XDP_ACT_SYM_FN(x) \
20 { XDP_##x, #x },
21 #define __XDP_ACT_SYM_TAB \
22 __XDP_ACT_MAP(__XDP_ACT_SYM_FN) { -1, 0 }
23 __XDP_ACT_MAP(__XDP_ACT_TP_FN)
25 TRACE_EVENT(xdp_exception,
27 TP_PROTO(const struct net_device *dev,
28 const struct bpf_prog *xdp, u32 act),
30 TP_ARGS(dev, xdp, act),
32 TP_STRUCT__entry(
33 __string(name, dev->name)
34 __array(u8, prog_tag, 8)
35 __field(u32, act)
38 TP_fast_assign(
39 BUILD_BUG_ON(sizeof(__entry->prog_tag) != sizeof(xdp->tag));
40 memcpy(__entry->prog_tag, xdp->tag, sizeof(xdp->tag));
41 __assign_str(name, dev->name);
42 __entry->act = act;
45 TP_printk("prog=%s device=%s action=%s",
46 __print_hex_str(__entry->prog_tag, 8),
47 __get_str(name),
48 __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB))
51 #endif /* _TRACE_XDP_H */
53 #include <trace/define_trace.h>