summaryrefslogtreecommitdiff
path: root/kernel/module.c
diff options
context:
space:
mode:
authorMatt Mullins <mmullins@fb.com>2018-12-12 16:42:37 -0800
committerAlexei Starovoitov <ast@kernel.org>2018-12-18 14:08:12 -0800
commita38d1107f937ca95dcf820161ef44ea683d6a0b1 (patch)
tree6fe1371db87f368a635d6d4aa7ef58031a940cf7 /kernel/module.c
parenta137401d85129953a1713d443216eb6b1074c12e (diff)
downloadlwn-a38d1107f937ca95dcf820161ef44ea683d6a0b1.tar.gz
lwn-a38d1107f937ca95dcf820161ef44ea683d6a0b1.zip
bpf: support raw tracepoints in modules
Distributions build drivers as modules, including network and filesystem drivers which export numerous tracepoints. This enables bpf(BPF_RAW_TRACEPOINT_OPEN) to attach to those tracepoints. Signed-off-by: Matt Mullins <mmullins@fb.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 49a405891587..06ec68f08387 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3093,6 +3093,11 @@ static int find_module_sections(struct module *mod, struct load_info *info)
sizeof(*mod->tracepoints_ptrs),
&mod->num_tracepoints);
#endif
+#ifdef CONFIG_BPF_EVENTS
+ mod->bpf_raw_events = section_objs(info, "__bpf_raw_tp_map",
+ sizeof(*mod->bpf_raw_events),
+ &mod->num_bpf_raw_events);
+#endif
#ifdef HAVE_JUMP_LABEL
mod->jump_entries = section_objs(info, "__jump_table",
sizeof(*mod->jump_entries),