1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */
5 #include <bpf/bpf_tracing.h>
6 #include <bpf/bpf_helpers.h>
7 #include <bpf/bpf_core_read.h>
8 #include "bpf_experimental.h"
10 /* BTF load should fail as bpf_rb_root __contains this type and points to
11 * 'node', but 'node' is not a bpf_rb_node
16 struct bpf_list_node node;
19 #define private(name) SEC(".data." #name) __hidden __attribute__((aligned(8)))
20 private(A) struct bpf_spin_lock glock;
21 private(A) struct bpf_rb_root groot __contains(node_data, node);
24 long rbtree_api_add__wrong_node_type(void *ctx)
28 n = bpf_obj_new(typeof(*n));
32 bpf_spin_lock(&glock);
33 bpf_rbtree_first(&groot);
34 bpf_spin_unlock(&glock);
38 char _license[] SEC("license") = "GPL";