8000 Tags · cigarl/ebpf · GitHub
[go: up one dir, main page]

Skip to content

Tags

Tags

v0.15.0

Toggle v0.15.0's commit message
program: don't return error when kmod BTF is disabled

In kernels where the flag CONFIG_DEBUG_INFO_BTF_MODULES is not set,
including kernels 5.10 and below (because the flag was introduced in 5.11),
loading a program that attaches to kernel module functions and relied on
CORE failed because the module's BTF is not available.

This fix allows the program to run, obviously only as long as it only
relies on the kernel's BTF and not on the specific module's BTF.

Fixes: cilium#1436
Signed-off-by: Ori Shussman <orishuss@gmail.com>

v0.14.0

Toggle v0.14.0's commit message
link: add Iterator

Add an iterator for links that loops over all links in the system.

Signed-off-by: Charalampos (Babis) Stylianopoulos <charalampos.stylianopoulos@emnify.com>

v0.13.2

Toggle v0.13.2's commit message
btf: fix race in mutableTypes.copy

We reference mt.copiedTypeIDs during copy to be able to figure out
the correct ID for a copied type. This access can currently race
with mutableTypes.add since we don't protect mt.copiedTypeIDs.

Take a read lock to prevent modification.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

v0.13.1

Toggle v0.13.1's commit message
btf: fix race due to concurrent read access

Up until the introduction of lazy copying, reading from a Spec
concurrently was safe. Now a read may trigger a copy and a write
into the Spec, therefore causing a race on mutableTypes.

Fix this by introducing a mutex which protects access to the
mutable state. We need to be a bit careful here: copying in
mutableTypes.add happens piecemeal, so we need to take a lock
for the whole duration of modifyGraph.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

v0.13.0

Toggle v0.13.0's commit message
map: rename BatchCursor to MapBatchCursor

All of the other map related types have this prefix, so make
BatchCursor the same.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

v0.12.3

Toggle v0.12.3's commit message
btf: Replace `binary.Read` with manual parsing in `readAndInflateTypes`

During profiling `binary.Read` uses up a significant amount of CPU time.
This seems to be due to it using reflection to calculate the amount of
bytes to read at runtime and not caching these results.

By doing manual `io.ReadFull` calls, pre-calculating struct sizes and
reusing types and buffers where possible, we can reduce the CPU time
spent in `readAndInflateTypes` by almost 25%.

```
goos: linux
goarch: amd64
pkg: github.com/cilium/ebpf/btf
cpu: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
                │ before.txt  │          after.txt           │
                │   sec/op    │   sec/op     vs base         │
ParseVmlinux-16   46.08m ± 1%   34.59m ± 2%  -24.93% (n=100)

                │  before.txt  │           after.txt           │
                │     B/op     │     B/op      vs base         │
ParseVmlinux-16   26.65Mi ± 0%   23.49Mi ± 0%  -11.87% (n=100)

                │ before.txt  │          after.txt           │
                │  allocs/op  │  allocs/op   vs base         │
ParseVmlinux-16   467.5k ± 0%   267.7k ± 0%  -42.73% (n=100)
```

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>

v0.12.2

Toggle v0.12.2's commit message
sysenc: refuse to unmarshal into undersized dst

Unmarshal currently doesn't check that unmarshaling actually
consumes to full buffer. This means that looking uint16 from an
uint32 value doesn't return an error.

Fixes cilium#1157

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

v0.12.1

Toggle v0.12.1's commit message
btf,info: Fix bad instruction offset when parsing infos from kernel

When BTF ext info is encoded in ELF the instruction offsets are in
bytes, but when you pass them to the kernel they must be instruction
indices. Therefore we divide the offset by the instruction size in
the parsing logic for ELF.

This was missed during the initial implementation of reading back BTF
ext info from the kernel. This would cause an error when loading
back ext info which was not a multiple of the instruction size or
a bad instruction offset if it was.

Fix this by making LoadLineInfos and LoadFuncInfos work on the kernel
format which contains instruction offsets while the ELF parser uses
bytes instead.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
Co-developed-by: Lorenz Bauer <lmb@isovalent.com>

v0.12.0

Toggle v0.12.0's commit message
CI: remove obsolete structcheck rules

structcheck was obsoleted a while ago. Remove the obsolete exclude
rules.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

v0.11.0

Toggle v0.11.0's commit message
features: fix unsupported progtype/helper probes

By enabling feature probes for the program types Tracing, Extension, LSM
and StructOps within the HaveProgramType API, we overlooked that this
would cause false negative results when using these types with the
HaveProgramHelper API. To probe for these program types we craft
specialized ProgramSpecs, but don't do the same when probing for these
types in combination with an arbitrary helper. For now we should return
an inconclusive error from the HaveProgramHelper API until we find a
better way to probe for helpers with these program types.

Fixes: cilium#1082

Signed-off-by: Robin Gögge <r.goegge@isovalent.com>
0