Current `[a-z_]+` regex allows upper case such as `NET_dev`, `netDev`
or even `NET_DEV` when one of `a-z` or `_` contains in the string. It
should be disallowed.
This patch fixes it.
This change removes the differentiation between release and dev profiles
for eBPF programs. There is no way eBPF programs can be debugged and
building them with dev profile just makes them slower and often unable
to be verified. They should be always built with the release profile.
After this change, `cargo xtask build-ebpf` is going to build eBPF
programs with release profile. And the userspace program is going to
include eBPF program bytes from target/release/. Regardless of which
profile is being used in the userspace program.
`cargo xtask build-ebpf` has the --profile argument which can be
optionally used (i.e. for user-defined profiles), but by default the
value of that option is `release`.
Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
Avoid unused_imports warning for std::convert::TryFrom.
Conditionally import it only when it is needed -
in sk_msg programs.
remove unused `std::convert::TryFrom` import to avoid the warning in the generated projects:
```
warning: unused import: `TryFrom`
--> myapp/src/main.rs:4:15
|
4 | convert::{TryFrom,TryInto},
| ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: `myapp` (bin "myapp") generated 1 warning
```
This new subcommand provides a convenient way to run your aya application.
Features include:
- automatic compilation of userspace + bpf code
- support for user-defined runners, defaulting to `sudo -E` for convenience
- no need to run `sudo cargo run` (gross) or `sudo target/debug/myapp` (also gross),
it just works
- an optional `-p` flag which automatically supplies the correct --path flag to the
application
- support for trailing args after a final -- which are passed to the application,
cargo run-style
My original patch was broken for crates with names-like-this, since it would incorrectly
add underscores instead of dashes to the pathname. This patch fixes the problem.
The project structure was messing with rust-analyzer's ability to correctly find the
Cargo.toml for the {{project-name}}-ebpf crate. This patch fixes it by manually defining
the project structure in both vscode and neovim.
Signed-off-by: William Findlay <william@williamfindlay.com>