]> Git Repo - linux.git/commitdiff
sample: bpf: syscall_tp_user: Print result of verify_map
authorSong Chen <[email protected]>
Sat, 2 Apr 2022 08:57:08 +0000 (16:57 +0800)
committerAndrii Nakryiko <[email protected]>
Mon, 4 Apr 2022 21:43:57 +0000 (14:43 -0700)
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: Song Chen <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
samples/bpf/syscall_tp_user.c

index a0ebf1833ed37c929e14d6cd6bac8af189a8039e..c55383068384ad20e5e076a216ea670d5d6955d1 100644 (file)
@@ -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));
This page took 0.059644 seconds and 4 git commands to generate.