Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Remove usage of deprecated feature probing APIs

Switch to libbpf_probe_*() APIs instead of the deprecated ones.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20220202225916.3313522-5-andrii@kernel.org

authored by

Andrii Nakryiko and committed by
Daniel Borkmann
32e608f8 a9a8ac59

+3 -3
+1 -1
tools/testing/selftests/bpf/test_maps.c
··· 738 738 sizeof(key), sizeof(value), 739 739 6, NULL); 740 740 if (fd < 0) { 741 - if (!bpf_probe_map_type(BPF_MAP_TYPE_SOCKMAP, 0)) { 741 + if (!libbpf_probe_bpf_map_type(BPF_MAP_TYPE_SOCKMAP, NULL)) { 742 742 printf("%s SKIP (unsupported map type BPF_MAP_TYPE_SOCKMAP)\n", 743 743 __func__); 744 744 skips++;
+2 -2
tools/testing/selftests/bpf/test_verifier.c
··· 456 456 457 457 static bool skip_unsupported_map(enum bpf_map_type map_type) 458 458 { 459 - if (!bpf_probe_map_type(map_type, 0)) { 459 + if (!libbpf_probe_bpf_map_type(map_type, NULL)) { 460 460 printf("SKIP (unsupported map type %d)\n", map_type); 461 461 skips++; 462 462 return true; ··· 1180 1180 * bpf_probe_prog_type won't give correct answer 1181 1181 */ 1182 1182 if (fd_prog < 0 && prog_type != BPF_PROG_TYPE_TRACING && 1183 - !bpf_probe_prog_type(prog_type, 0)) { 1183 + !libbpf_probe_bpf_prog_type(prog_type, NULL)) { 1184 1184 printf("SKIP (unsupported program type %d)\n", prog_type); 1185 1185 skips++; 1186 1186 goto close_fds;