Commit Graph

9 Commits (6ab7475fa66d1b8155487dfc548645e2b8ee20c6)

Author SHA1 Message Date
Tamir Duberstein 0a144a0e69
integration-test: remove all sleeps 1 year ago
Tamir Duberstein 54c90ec72c
integration-test: De-duplicate BTF relocation test 1 year ago
Tamir Duberstein 71bc3ea0b5
integration-test: avoid reliance on kernel headers
This should allow us to build on any system.
1 year ago
Tamir Duberstein b46fb616be
integration-test: fix BTF relocation test
The struct_flavors test previously expected the same thing with and
without relocations. It now expects different values.

Also rename an enum variant "u64" to "S64". This was a typo. Turns out
that U32 is a type that exists in kernel headers, so all enum values are
suffixed with "_VAL".

Remove stdlib.h and the call to exit(). This alone makes the test fail
with a poisoned relocation. Bringing over the map definition makes the
test work again.
1 year ago
Tamir Duberstein 72afd877b5
integration-test: clang-format C files 1 year ago
Dave Tucker 79ea64ca7f aya: Fix (func|line)_info multiple progs in section
This commit fixes the (func|line)_info when we have multiple programs in
the same section. The integration test reloc.bpf.c serves as our test
case here. This required filtering down the (func|line)_info to only
that in scope of the current symbol + then adjusting the offets to
appease the kernel.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
Tamir Duberstein dca5e6c167
integration-test: Remove runtime toolchain deps
Move the use of clang and llvm-objcopy from run-time to build-time. This
allows the integration tests to run on VMs with simpler userlands.

Create a new CI job to build the integration tests separately from
running them. Ship them from that job to the runner job using github
actions artifacts.
1 year ago
Dave Tucker bf7fdff1ce aya: Find programs using the symbol table
This makes a few changes to the way that Aya reads the ELF object
files.

1. To find programs in a section, we use the symbols table. This allows
   for cases where multiple programs could appear in the same section.
2. When parsing our ELF file we build symbols_by_section_index as an
   optimization as we use it for legacy maps, BTF maps and now programs.

As a result of theses changes the "NAME" used in `bpf.prog_mut("NAME")`
is now ALWAYS the same as the function name in the eBPF code, making the
user experience more consistent.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
Tamir Duberstein 8c61fc9ea6
integration-test: compile C probes using build.rs
- Add libbpf as a submodule. This prevents having to plumb its location
  around (which can't be passed to Cargo build scripts) and also
  controls the version against which codegen has run.
- Move bpf written in C to the integration-test crate and define
  constants for each probe.
- Remove magic; each C source file must be directly enumerated in the
  build script and in lib.rs.
1 year ago