diff options
| author | Alexei Starovoitov <[email protected]> | 2024-07-22 12:21:22 -0700 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2024-07-29 13:09:14 -0700 |
| commit | e2854bc37344f40a47c6e04a222e65d2669e64dd (patch) | |
| tree | 120a17e784ca02ef0cfdd75aecc71ff839e06be5 /tools/testing/selftests/bpf/progs/unsupported_ops.c | |
| parent | 0d7c06125cea53b3d86d685d790b03b9ae9d6336 (diff) | |
| parent | 4009c95fede6b783802ad01f264a7a0541f5ea60 (diff) | |
Merge branch 'bpf-retire-the-unsupported_ops-usage-in-struct_ops'
Martin KaFai Lau says:
====================
bpf: Retire the unsupported_ops usage in struct_ops
From: Martin KaFai Lau <[email protected]>
This series retires the unsupported_ops usage and depends on the
null-ness check on the cfi_stubs instead.
Please see individual patches for details.
v2:
- Fixed a gcc compiler warning on Patch 1.
====================
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/unsupported_ops.c')
| -rw-r--r-- | tools/testing/selftests/bpf/progs/unsupported_ops.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/unsupported_ops.c b/tools/testing/selftests/bpf/progs/unsupported_ops.c new file mode 100644 index 000000000000..9180365a3568 --- /dev/null +++ b/tools/testing/selftests/bpf/progs/unsupported_ops.c @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ + +#include <vmlinux.h> +#include <bpf/bpf_tracing.h> +#include "bpf_misc.h" +#include "../bpf_testmod/bpf_testmod.h" + +char _license[] SEC("license") = "GPL"; + +SEC("struct_ops/unsupported_ops") +__failure +__msg("attach to unsupported member unsupported_ops of struct bpf_testmod_ops") +int BPF_PROG(unsupported_ops) +{ + return 0; +} + +SEC(".struct_ops.link") +struct bpf_testmod_ops testmod = { + .unsupported_ops = (void *)unsupported_ops, +}; |