File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
tools/testing/selftests/bpf Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: GPL-2.0
2+
3+ #include <test_progs.h>
4+ #include "tracing_btf_ids.skel.h"
5+
6+ void test_tracing_btf_ids (void )
7+ {
8+ int btf_id ;
9+
10+ // `migrate_disable` depends on `CONFIG_SMP`, may not exists
11+ btf_id = libbpf_find_vmlinux_btf_id ("migrate_disable" , BPF_TRACE_FENTRY );
12+ if (btf_id <= 0 )
13+ return ;
14+
15+ RUN_TESTS (tracing_btf_ids );
16+ }
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: GPL-2.0
2+
3+ #include <linux/bpf.h>
4+ #include <bpf/bpf_helpers.h>
5+ #include <bpf/bpf_tracing.h>
6+ #include "bpf_misc.h"
7+
8+ char _license [] SEC ("license" ) = "GPL" ;
9+
10+ SEC ("fentry/migrate_disable" )
11+ __failure __msg ("Attaching tracing to __btf_id function 'migrate_disable' is rejected." )
12+ int BPF_PROG (btf_ids )
13+ {
14+ return 0 ;
15+ }
You can’t perform that action at this time.
0 commit comments