Commit Graph

6 Commits (14a844256a5140c45cb12b05c265a245b6022f9e)

Author SHA1 Message Date
Friday Ortiz ab38afe95d
perf_event: support hardware breakpoints
Implement `PerfEventConfig::Breakpoint`, allowing users to attach
hardware breakpoints. Generate `HW_BREAKPOINT_*` and `struct
bpf_perf_event_data` in support of this feature and update the type of
`PerfEventContext` accordingly.

Add a test exercising R, W, RW, and X breakpoints. Note that R
breakpoints are unsupported on x86, and this is asserted in the test.

Extend the VM integration test harness and supporting infrastructure
(e.g. `download_kernel_images.sh`) to download kernel debug packages and
mount `System.map` in initramfs. This is needed (at least) on the aarch
6.1 Debian kernel which was not compiled with `CONFIG_KALLSYMS_ALL=y`
for some reason, and the locations of globals are not available in
kallsyms. To attach breakpoints to these symbols in the test pipeline,
we need to read them from System.map and apply the KASLR offset to get
their real address. The `System.map` file is not provided in the kernel
package by default, so we need to extract it from the corresponding
debug package. The KASLR offset is computed using `gunzip` which appears
in kallsyms on all Debian kernels tested.

Co-authored-by: Tamir Duberstein <tamird@gmail.com>
7 days ago
Tamir Duberstein c8f14b18d4 codegen: tidy up
Move some code out of a loop, where it appears to be nonsense.
10 months ago
Tamir Duberstein 9198335100 codegen: remove outdated workaround
bindgen can handle these macros now.
10 months ago
Tyrone Wu 366c599c20 codegen: cgroup_iter_order NFPROTO* nf_inet_hooks
Adds the following to codegen:
- `bpf_cgroup_iter_order`: used in `bpf_link_info.iter.group.order`
- `NFPROTO_*`: used in `bpf_link_info.netfilter.pf`
- `nf_inet_hooks`: used in `bpf_link_info.netfilter.hooknum`

Include `linux/netfilter.h` in `linux_wrapper.h` for `NFPROTO_*` and
`nf_inet_hooks` to generate.
1 year ago
Dave Tucker 02124002c8 .github: Add clang-format
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Shenghui Ye 81bc307dce aya-obj: migrate bindgen destination
Aya::obj depends on bindgen generated files, and we start
by migrating bindgen generated files.

This commit adds the new aya-obj crate to the workplace
and migrates generated files into the crate. We use core
instead of std in an effort to make the final crate no_std.

Bindgen was run against libbpf v1.0.1.

Refs: #473
3 years ago