mirror of
https://github.com/torvalds/linux.git
synced 2026-08-15 03:46:23 +02:00
As discussed in [0], stop emitting static variables in BPF skeletons to avoid
issues with name-conflicting static variables across multiple
statically-linked BPF object files.
Users using static variables to pass data between BPF programs and user-space
should do a trivial one-time switch according to the following simple rules:
- read-only `static volatile const` variables should be converted to
`volatile const`;
- read/write `static volatile` variables should just drop `static volatile`
modifiers to become global variables/symbols. To better handle older Clang
versions, such newly converted global variables should be explicitly
initialized with a specific value or `= 0`/`= {}`, whichever is
appropriate.
[0] https://lore.kernel.org/bpf/CAEf4BzZo7_r-hsNvJt3w3kyrmmBJj7ghGY8+k4nvKF0KLjma=w@mail.gmail.com/T/#m664d4b0d6b31ac8b2669360e0fc2d6962e9f5ec1
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210507054119.270888-5-andrii@kernel.org
|
||
|---|---|---|
| .. | ||
| bash-completion | ||
| Documentation | ||
| skeleton | ||
| .gitignore | ||
| btf_dumper.c | ||
| btf.c | ||
| cfg.c | ||
| cfg.h | ||
| cgroup.c | ||
| common.c | ||
| feature.c | ||
| gen.c | ||
| iter.c | ||
| jit_disasm.c | ||
| json_writer.c | ||
| json_writer.h | ||
| link.c | ||
| main.c | ||
| main.h | ||
| Makefile | ||
| map_perf_ring.c | ||
| map.c | ||
| net.c | ||
| netlink_dumper.c | ||
| netlink_dumper.h | ||
| perf.c | ||
| pids.c | ||
| prog.c | ||
| struct_ops.c | ||
| tracelog.c | ||
| xlated_dumper.c | ||
| xlated_dumper.h | ||