This commit adds 2 new methods to aya::sys
- bpf_pin_object
- bpf_get_object
Which allow the pinning and retrieval of programs/maps to bpffs.
It adds a `Program.pin` API, such that a loaded program can be pinned.
For map pinning, the user must ensure the `pinning u32` in the
`bpf_map_def` is set to 1, maps will be pinned using a new builder API.
BpfLoader::new().map_pin_path("/sys/fs/bpf/myapp").load_file("myapp.o")
This will pin all maps whose definition requests pinning to path + name.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
This commit adds a github action that will
- check out aya and libbpf
- run xtask codegen
- if there is a diff, open commit changes to the codegen branch
- if changes were comitted, open a pull-request
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
The size of Unknown should be ty_size, otherwise when it is encountered,
we never advance the cursor and it creates an infinite loop.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
rustup install nightly --component rust-src
gives:
```
error: Found argument '--component' which wasn't expected, or isn't valid in this context
USAGE:
rustup install [FLAGS] [OPTIONS] <toolchain>...
For more information try --help
```
The correct command seems to be `rustup toolchain install nightly --component rust-src`.
qdisc_detach_program can be used to detach all the programs that have
the given name. It's useful when you want to detach programs that were
attached by some other process (eg. iproute2), or when you want to
detach programs that were previously left attached because the program
that attached them was killed.
The type casting introduces an allocation, this will cause compiling failure when linking final bpf target.
So remove this casting to fix this issue.
BTW, the following is the failure I met:
= note: 07:24:12 [ERROR] fatal error: "unable to allocate function return #1"
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Running pass 'Function Pass Manager' on module 'trace_bpf-001a275b17e9eb12'.
1. Running pass 'BPF DAG->DAG Pattern Instruction Selection' on function '@_ZN7aya_bpf4maps11stack_trace10StackTrace11get_stackid17h32b649bc3780c0aaE'
Signed-off-by: Tw <wei.tan@intel.com>