]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: bpf_program__pin: add special case for instances.nr == 1
authorStanislav Fomichev <sdf@google.com>
Fri, 9 Nov 2018 16:21:42 +0000 (08:21 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 10 Nov 2018 23:56:10 +0000 (15:56 -0800)
commit5333e9c3ba5333e853cc4ba379f57f250244112b
tree0546f050a5173c376a319e7fff09dae12abf535a
parentd8c7d850da597b671d31dc58b6705dc39fd5c2ca
libbpf: bpf_program__pin: add special case for instances.nr == 1

When bpf_program has only one instance, don't create a subdirectory with
per-instance pin files (<prog>/0). Instead, just create a single pin file
for that single instance. This simplifies object pinning by not creating
unnecessary subdirectories.

This can potentially break existing users that depend on the case
where '/0' is always created. However, I couldn't find any serious
usage of bpf_program__pin inside the kernel tree and I suppose there
should be none outside.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c