Commit Graph

32 Commits (8830c0bc20c6e3dbbddf63533d4623fcd45dd9af)

Author SHA1 Message Date
tyrone-wu b23973dd9c xtask: corrected bpf to ebpf for path to aya-ebpf-bindings in codegen
Currently, when running `cargo +nightly xtask codegen` locally and in
the codegen GHA workflow, an error occurs with only "Error: bindgen
failed" displayed.

This was due to a path using "bpf/..." instead of "ebpf/...". It is now
corrected to "ebpf", and bindgen fails should now display a more direct
message on why it failed.

Fixes: 
Tamir Duberstein d16e607fd4
rustfmt: group_imports = "StdExternalCrate"
High time we stop debating this; let the robots do the work.
Andrew Werner 15b3c459ae xtask: ensure libbpf submodule is initialized
Libbpf is used by xtasks, in the command, ensure that the submodules
are initialized. This eases the user-experience so that users don't
need to think about the submodule, while retaining all the benefits
of using a submodule vs forcing the user to manually check out libbpf
and stick it in some pre-defined place.

We use the symbol pointing to libbpf in xtask in the build script
to avoid repeating this constant.

Also, we install git in the vm so that we can init the submodule
when we build in the vm.
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.
Tuetuopay 23e7c65244 xtask: generate userspace bindings for bpf_{cpu,dev}map_val
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: 
Dmitry Savintsev 055d94f58b fix uninlined_format_args clippy issues
Dmitry Savintsev d0424fb091 fix clippy needless_borrow warning
Dave Tucker bc088921b8 codgen: Add bpf_link_type
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Dave Tucker a0641c15e4 codegen: Add bpf_map_info and bpf_link_info
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Dave Tucker aaa20cc1fd aya-gen: Rename to aya-tool
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
William Findlay 777e6a2a5d xtask/codegen: generate bindings for BPF_RINGBUF types
gianluigi d35680f30c Add riscv64 architecture support to xtask/codegen
Dave Tucker 19af687480 codegen: add btf_decl_tag
This is required to add support for BTF_KIND_DECL_TAG

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Ubuntu 0beb0c501f Add bpf_lpm_trie_key to aya codegen to generate bindings
Dave Tucker f8021c33fc codegen: Add bindings for BPF_F flags
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Dave Tucker 23d1920854 codegen: add bindings for btf structs
This adds `bpf_btf_info` which can be used to get BPF information via a
syscall. It also adds `btf_line_info` and `btf_func_info` which are
required to parse the line and func info sections of BTF

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Alessandro Decina eb654d1e3e xtask: codegen: fix bindings for archs other than x86
alessandrod 03e9935358 Bump libbpf to 92c1e61a605410b16d6330fdd4a7a4e03add86d4
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Alessandro Decina 7af1cf136c aya: generate bindings for more perf types
Alessandro Decina 4fcb1d75b9 aya-gen: bump bindgen to 0.59
Alessandro Decina 2d16843d5d xtask: clippy warnings
Simone Margaritelli 8311abfdcb
added support for armv7-unknown-linux-gnueabi and armv7-unknown-linux-gnueabihf
* new: added support for armv7-unknown-linux-gnueabi (closes alessandrod/aya/issues/22)

* fix: replaced custom type defintions with proper libc types

* fix: fixed pointless parameter binding

* new: added linker for armv7-unknown-linux-gnueabihf to cargo config
Alessandro Decina 8cd669ca9a xtask: fix include paths for kernel headers bundled with libbpf
Arnabjyoti Kalita 6974d349e8
programs: add support for attaching and detaching TC programs
This change adds support for attaching TC programs directly from aya, without
having to use iproute2/tc.
Alessandro Decina c44393d59b xtask: codegen: use uapi kernel headers from libbpf
libbpf periodically syncs uapi headers from the kernel. Use those to
generate bindings so that we don't have to rely on distro packages
when we cut releases.
Alessandro Decina d9634ae945 aya: add maps::StackTraceMap
Map type for BPF_MAP_TYPE_STACK_TRACE.
Alessandro Decina f9554d6db5 aya: fix bindings for PERF_EVENT_IOC_{ENABLE|DISABLE|SET_BPF}
Alessandro Decina 92b4ed2664 aya: add support for function calls
Alessandro Decina 29f2d9b2d9 aya: switch to rustified enums
Alessandro Decina f0444233b3 xtask: rework command line
xtask codegen --libbpf-dir <libbpf-dir> [SUBCOMMAND]

If SUBCOMMAND (eg aya or aya-bpf-bindings) is not given, codegen
everything.
Alessandro Decina fb0c8f0bc9 xtask: add code generator for aya