From: Song Chen Date: Sat, 2 Apr 2022 08:57:08 +0000 (+0800) Subject: sample: bpf: syscall_tp_user: Print result of verify_map X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=35f91d1fe106cd474ac0463157d012c675385e18;p=linux.git sample: bpf: syscall_tp_user: Print result of verify_map At the end of the test, we already print out prog : map ids <...> <...> Value is the number read from kernel through bpf map, further print out verify map: val:<...> will help users to understand the program runs successfully. Signed-off-by: Song Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1648889828-12417-1-git-send-email-chensong_2000@189.cn --- diff --git a/samples/bpf/syscall_tp_user.c b/samples/bpf/syscall_tp_user.c index a0ebf1833ed37..c55383068384a 100644 --- a/samples/bpf/syscall_tp_user.c +++ b/samples/bpf/syscall_tp_user.c @@ -36,6 +36,9 @@ static void verify_map(int map_id) fprintf(stderr, "failed: map #%d returns value 0\n", map_id); return; } + + printf("verify map:%d val: %d\n", map_id, val); + val = 0; if (bpf_map_update_elem(map_id, &key, &val, BPF_ANY) != 0) { fprintf(stderr, "map_update failed: %s\n", strerror(errno));