2 #define TRACE_SYSTEM xdp
4 #if !defined(_TRACE_XDP_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/netdevice.h>
8 #include <linux/filter.h>
9 #include <linux/tracepoint.h>
11 #define __XDP_ACT_MAP(FN) \
17 #define __XDP_ACT_TP_FN(x) \
18 TRACE_DEFINE_ENUM(XDP_##x);
19 #define __XDP_ACT_SYM_FN(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
),
33 __string(name
, dev
->name
)
34 __array(u8
, prog_tag
, 8)
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
);
45 TP_printk("prog=%s device=%s action=%s",
46 __print_hex_str(__entry
->prog_tag
, 8),
48 __print_symbolic(__entry
->act
, __XDP_ACT_SYM_TAB
))
51 #endif /* _TRACE_XDP_H */
53 #include <trace/define_trace.h>