History

bpf: Fix build failure for kernel/trace/bpf_trace.c with CONFIG_NET=n

When CONFIG_NET is not defined, I hit the following build error: kernel/trace/bpf_trace.o:(.rodata+0x110): undefined reference to `bpf_prog_test_run_raw_tp' Commit 1b4d60ec162f ("bpf: Enable BPF_PROG_TEST_RUN for raw_tracepoint") added test_run support for raw_tracepoint in /kernel/trace/bpf_trace.c. But the test_run function bpf_prog_test_run_raw_tp is defined in net/bpf/test_run.c, only available with CONFIG_NET=y. Adding a CONFIG_NET guard for .test_run = bpf_prog_test_run_raw_tp; fixed the above build issue.

Yonghong Song committed 6 years ago

Commit ebfb4d41 parent 49a2a4d1 file · +2 −0Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/trace/bpf_trace.c+2−0
@@ -1780,7 +1780,9 @@ const struct bpf_verifier_ops raw_tracepoint_verifier_ops = { · 1779 unmodified lines
17801780 };
17811781
17821782 const struct bpf_prog_ops raw_tracepoint_prog_ops = {
1783+#ifdef CONFIG_NET
17831784 .test_run = bpf_prog_test_run_raw_tp,
1785+#endif
17841786 };
17851787
17861788 const struct bpf_verifier_ops tracing_verifier_ops = {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t