This feature is useful if someone wants to view the log contents
of a program that is already running. For e.g. a pinned program
or an XDP program attached to a net interface.
Force bpf-linker to always be rebuilt/relinked. Before this change we
were always installing latest llvm from brew, but not always rebuilding
bpf-linker, which could lead to:
Run cargo install bpf-linker --git https://github.com/aya-rs/bpf-linker.git --rev 821f92990074cb7e950e25129dcd55e20424cede --no-default-features
Updating git repository `https://github.com/aya-rs/bpf-linker.git`
Ignored package `bpf-linker v0.9.10 (https://github.com/aya-rs/bpf-linker.git?rev=821f92990074cb7e950e25129dcd55e20424cede#821f9299)` is already installed, use --force to override
And then:
warning: integration-test@0.1.0: error: linking with `bpf-linker` failed: signal: 6 (SIGABRT)
warning: integration-test@0.1.0: = note: dyld[17642]: Library not loaded: '/usr/local/opt/z3/lib/libz3.4.12.dylib'
warning: integration-test@0.1.0: Referenced from: '/Users/runner/.cargo/bin/bpf-linker'
Added logic in expand function in both kprobe.rs and uprobe.rs for valid
macros. Now, kprobe & uprobe proc macros only accept ProbeContext, and
kretprobe & uretprobe only accept RetProbeContext.
Ref: #700
Created retprobe.rs to hold RetProbeContext and moved the ret from
ProbeContext in probe.rs into RetProbeContext. Now, only kprobe (which
uses ProbeContext) can access args, and kretprobe (which uses
RetProbeContext) can access ret.
Fixes: #700
```
warning: casting `u8` to `u64` may become silently lossy if you later change the type
warning: casting `u16` to `u64` may become silently lossy if you later change the type
warning: casting `u32` to `u64` may become silently lossy if you later change the type
warning: casting `i64` to `u64` may lose the sign of the value
warning: casting `i8` to `i64` may become silently lossy if you later change the type
warning: casting `i64` to `u64` may lose the sign of the value
warning: casting `i16` to `i64` may become silently lossy if you later change the type
warning: casting `i32` to `i64` may become silently lossy if you later change the type
--> ebpf/aya-ebpf/src/helpers.rs:753:27
|
753 | PrintkArg(x as $via as u64)
| ^
...
759 | / impl_integer_promotion!(
760 | | char: via u64,
761 | | u8: via u64,
762 | | u16: via u64,
... |
770 | | isize: via i64,
771 | | );
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
= note: this warning originates in the macro `impl_integer_promotion` (in Nightly builds, run with -Z macro-backtrace for more info)
```
Pass an array of bytes instead of u64 to avoid clippy sign warnings.
If a bpf syscall fails, it would be useful to know if this is due to
not having enough permissions or that the kernel does not have BPF support.
Ubuntu kernels are compiled without `CONFIG_BPF_LIRC_MODE2` so this is
important for https://github.com/seanyoung/cir/ : I would like to
present a useful error saying your kernel does not support BPF IR
decoders, go fix your kernel.
Also, when removing all BPF programs using `cir config --clear` then
if there is no support for BPF, there is nothing to clear and the
syscall error can be ignored.
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: #914
This PR includes the licenses files in the crate workspace subdirectory.
Without this, they won't be showing on crates.io and would be giving out
errors on tooling such as rust2rpm.
Signed-off-by: Daniel Mellado <dmellado@redhat.com>
And BpfLoader to EbpfLoader.
This also adds type aliases to preserve the use of the old names, making
updating to a new Aya release less of a burden. These aliases are marked
as deprecated since we'll likely remove them in a later release.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>