]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - include/trace/events/xdp.h
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) \
18 #define __XDP_ACT_TP_FN(x) \
19 TRACE_DEFINE_ENUM(XDP_##x);
20 #define __XDP_ACT_SYM_FN(x) \
22 #define __XDP_ACT_SYM_TAB \
23 __XDP_ACT_MAP(__XDP_ACT_SYM_FN) { -1, 0 }
24 __XDP_ACT_MAP(__XDP_ACT_TP_FN
)
26 TRACE_EVENT(xdp_exception
,
28 TP_PROTO(const struct net_device
*dev
,
29 const struct bpf_prog
*xdp
, u32 act
),
31 TP_ARGS(dev
, xdp
, act
),
34 __string(name
, dev
->name
)
35 __array(u8
, prog_tag
, 8)
40 BUILD_BUG_ON(sizeof(__entry
->prog_tag
) != sizeof(xdp
->tag
));
41 memcpy(__entry
->prog_tag
, xdp
->tag
, sizeof(xdp
->tag
));
42 __assign_str(name
, dev
->name
);
46 TP_printk("prog=%s device=%s action=%s",
47 __print_hex_str(__entry
->prog_tag
, 8),
49 __print_symbolic(__entry
->act
, __XDP_ACT_SYM_TAB
))
52 TRACE_EVENT(xdp_redirect
,
54 TP_PROTO(const struct net_device
*from
,
55 const struct net_device
*to
,
56 const struct bpf_prog
*xdp
, u32 act
),
58 TP_ARGS(from
, to
, xdp
, act
),
61 __string(name_from
, from
->name
)
62 __string(name_to
, to
->name
)
63 __array(u8
, prog_tag
, 8)
68 BUILD_BUG_ON(sizeof(__entry
->prog_tag
) != sizeof(xdp
->tag
));
69 memcpy(__entry
->prog_tag
, xdp
->tag
, sizeof(xdp
->tag
));
70 __assign_str(name_from
, from
->name
);
71 __assign_str(name_to
, to
->name
);
75 TP_printk("prog=%s from=%s to=%s action=%s",
76 __print_hex_str(__entry
->prog_tag
, 8),
77 __get_str(name_from
), __get_str(name_to
),
78 __print_symbolic(__entry
->act
, __XDP_ACT_SYM_TAB
))
80 #endif /* _TRACE_XDP_H */
82 #include <trace/define_trace.h>