Commit 35f91d1f authored by Song Chen's avatar Song Chen Committed by Andrii Nakryiko

sample: bpf: syscall_tp_user: Print result of verify_map

At the end of the test, we already print out
    prog <prog number>: map ids <...> <...>
Value is the number read from kernel through bpf map, further print out
    verify map:<map id> val:<...>
will help users to understand the program runs successfully.
Signed-off-by: default avatarSong Chen <chensong_2000@189.cn>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1648889828-12417-1-git-send-email-chensong_2000@189.cn
parent e93f3999
...@@ -36,6 +36,9 @@ static void verify_map(int map_id) ...@@ -36,6 +36,9 @@ static void verify_map(int map_id)
fprintf(stderr, "failed: map #%d returns value 0\n", map_id); fprintf(stderr, "failed: map #%d returns value 0\n", map_id);
return; return;
} }
printf("verify map:%d val: %d\n", map_id, val);
val = 0; val = 0;
if (bpf_map_update_elem(map_id, &key, &val, BPF_ANY) != 0) { if (bpf_map_update_elem(map_id, &key, &val, BPF_ANY) != 0) {
fprintf(stderr, "map_update failed: %s\n", strerror(errno)); fprintf(stderr, "map_update failed: %s\n", strerror(errno));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment