libbpf-tools: update readahead for libbpf 1.0
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 17 Dec 2021 22:32:30 +0000 (14:32 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 20 Dec 2021 21:21:26 +0000 (13:21 -0800)
Switch to libbpf 1.0 mode and adapt libbpf API usage accordingly.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
libbpf-tools/readahead.c

index 2ab654e0ed558b7c58fce7b7f5c25c46ce127fce..c55b0dbbac44bd2386531f1fde60de3be975853e 100644 (file)
@@ -110,14 +110,9 @@ int main(int argc, char **argv)
        if (err)
                return err;
 
+       libbpf_set_strict_mode(LIBBPF_STRICT_ALL);
        libbpf_set_print(libbpf_print_fn);
 
-       err = bump_memlock_rlimit();
-       if (err) {
-               fprintf(stderr, "failed to increase rlimit: %d\n", err);
-               return 1;
-       }
-
        obj = readahead_bpf__open();
        if (!obj) {
                fprintf(stderr, "failed to open BPF object\n");