summaryrefslogtreecommitdiff
path: root/samples/bpf/xdp_sample_user.h
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2021-08-21 03:19:55 +0300
committerAlexei Starovoitov <ast@kernel.org>2021-08-25 00:48:41 +0300
commit82c450803a917da6edb34a0a769d0b5a0b10990c (patch)
tree9c6a9e650c7f6afd3df163152c0d53a642df32a6 /samples/bpf/xdp_sample_user.h
parent451588764e2f3e3ab197b23c7958f750707e2a24 (diff)
downloadlinux-82c450803a917da6edb34a0a769d0b5a0b10990c.tar.xz
samples: bpf: Add xdp_exception tracepoint statistics support
This implements the retrieval and printing, as well the help output. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210821002010.845777-8-memxor@gmail.com
Diffstat (limited to 'samples/bpf/xdp_sample_user.h')
-rw-r--r--samples/bpf/xdp_sample_user.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/samples/bpf/xdp_sample_user.h b/samples/bpf/xdp_sample_user.h
index 1935a0e2f85b..aa28e4bdd628 100644
--- a/samples/bpf/xdp_sample_user.h
+++ b/samples/bpf/xdp_sample_user.h
@@ -11,6 +11,7 @@ enum stats_mask {
_SAMPLE_REDIRECT_MAP = 1U << 0,
SAMPLE_RX_CNT = 1U << 1,
SAMPLE_REDIRECT_ERR_CNT = 1U << 2,
+ SAMPLE_EXCEPTION_CNT = 1U << 5,
SAMPLE_REDIRECT_CNT = 1U << 7,
SAMPLE_REDIRECT_MAP_CNT = SAMPLE_REDIRECT_CNT | _SAMPLE_REDIRECT_MAP,
SAMPLE_REDIRECT_ERR_MAP_CNT = SAMPLE_REDIRECT_ERR_CNT | _SAMPLE_REDIRECT_MAP,
@@ -75,6 +76,8 @@ static inline char *safe_strncpy(char *dst, const char *src, size_t size)
__attach_tp(tp_xdp_redirect_map_err); \
if (mask & SAMPLE_REDIRECT_ERR_CNT) \
__attach_tp(tp_xdp_redirect_err); \
+ if (mask & SAMPLE_EXCEPTION_CNT) \
+ __attach_tp(tp_xdp_exception); \
return 0; \
}