Skip to content

General README is missing install docs for eBPF #12

@imallona

Description

@imallona

Could the project README be updated to describe the eBPF installation in detail? So ebpf.md is part of it?

BTW, failing to do it due to

141 |     ebpf_tracker: Option<crate::ebpf::SyscallTracker>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SyscallTracker` cannot be formatted using `{:?}`

Dummy laptop (after having run the tracefs perms script, on a venv):

Details
[me@laptop virtenvs]$ cargo install denet --features ebpf
    Updating crates.io index
  Installing denet v0.4.2
    Updating crates.io index
     Locking 173 packages to latest compatible versions
      Adding aya v0.12.0 (available: v0.13.1)
      Adding colored v2.2.0 (available: v3.0.0)
      Adding procfs v0.17.0 (available: v0.18.0)
      Adding sysinfo v0.35.2 (available: v0.37.0)
      Adding tabled v0.16.0 (available: v0.20.0)
      Adding unicode-width v0.1.11 (available: v0.1.14)
  Downloaded allocator-api2 v0.2.21
  Downloaded aya-log-common v0.1.15
  Downloaded aya-log v0.2.1
  Downloaded core-error v0.0.0
  Downloaded assert_matches v1.5.0
  Downloaded equivalent v1.0.2
  Downloaded ahash v0.8.12
  Downloaded num_enum_derive v0.7.4
  Downloaded thiserror-impl v1.0.69
  Downloaded foldhash v0.1.5
  Downloaded bytes v1.10.1
  Downloaded thiserror v1.0.69
  Downloaded pin-project-lite v0.2.16
  Downloaded rustversion v1.0.22
  Downloaded once_cell v1.21.3
  Downloaded num_enum v0.7.4
  Downloaded socket2 v0.6.0
  Downloaded indexmap v2.11.1
  Downloaded aya-obj v0.2.1
  Downloaded aya-obj v0.1.0
  Downloaded aya v0.12.0
  Downloaded hashbrown v0.14.5
  Downloaded hashbrown v0.15.5
  Downloaded aya v0.13.1
  Downloaded zerocopy v0.8.27
  Downloaded object v0.32.2
  Downloaded object v0.36.7
  Downloaded tokio v1.47.1
  Downloaded 28 crates (3.0MiB) in 0.40s
   Compiling proc-macro2 v1.0.101
   Compiling unicode-ident v1.0.19
   Compiling version_check v0.9.5
   Compiling libc v0.2.175
   Compiling cfg-if v1.0.3
   Compiling autocfg v1.5.0
   Compiling bitflags v2.9.4
   Compiling memchr v2.7.5
   Compiling allocator-api2 v0.2.21
   Compiling log v0.4.28
   Compiling crc32fast v1.5.0
   Compiling thiserror v1.0.69
   Compiling once_cell v1.21.3
   Compiling zerocopy v0.8.27
   Compiling foldhash v0.1.5
   Compiling equivalent v1.0.2
   Compiling rustversion v1.0.22
   Compiling object v0.36.7
   Compiling syn v1.0.109
   Compiling bytes v1.10.1
   Compiling core-error v0.0.0
   Compiling proc-macro-error-attr v1.0.4
   Compiling ahash v0.8.12
   Compiling proc-macro-error v1.0.4
   Compiling num-traits v0.2.19
   Compiling lock_api v0.4.13
   Compiling parking_lot_core v0.9.11
   Compiling hashbrown v0.15.5
   Compiling utf8parse v0.2.2
   Compiling unicode-segmentation v1.12.0
   Compiling serde_core v1.0.223
   Compiling cfg_aliases v0.2.1
   Compiling signal-hook v0.3.18
   Compiling anstyle-parse v0.2.7
   Compiling nix v0.30.1
   Compiling smallvec v1.15.1
   Compiling rustix v1.1.2
   Compiling is_terminal_polyfill v1.70.1
   Compiling quote v1.0.40
   Compiling assert_matches v1.5.0
   Compiling convert_case v0.7.1
   Compiling anstyle v1.0.11
   Compiling syn v2.0.106
   Compiling pin-project-lite v0.2.16
   Compiling scopeguard v1.2.0
   Compiling rustix v0.38.44
   Compiling indexmap v2.11.1
   Compiling colorchoice v1.0.4
   Compiling adler2 v2.0.1
   Compiling iana-time-zone v0.1.64
   Compiling anstyle-query v1.1.4
   Compiling anstream v0.6.20
   Compiling miniz_oxide v0.8.9
   Compiling object v0.32.2
   Compiling chrono v0.4.42
   Compiling heck v0.5.0
   Compiling linux-raw-sys v0.11.0
   Compiling serde_json v1.0.145
   Compiling serde v1.0.223
   Compiling unicode-width v0.1.11
   Compiling procfs v0.17.0
   Compiling clap_lex v0.7.5
   Compiling lazy_static v1.5.0
   Compiling heck v0.4.1
   Compiling strsim v0.11.1
   Compiling linux-raw-sys v0.4.15
   Compiling fnv v1.0.7
   Compiling hex v0.4.3
   Compiling litrs v0.4.2
   Compiling mio v1.0.4
   Compiling socket2 v0.6.0
   Compiling signal-hook-registry v1.4.6
   Compiling bytecount v0.6.9
   Compiling tokio v1.47.1
   Compiling hashbrown v0.14.5
   Compiling procfs-core v0.17.0
   Compiling parking_lot v0.12.4
   Compiling papergrid v0.12.0
   Compiling document-features v0.2.11
   Compiling signal-hook-mio v0.2.4
   Compiling clap_builder v4.5.47
   Compiling flate2 v1.1.2
   Compiling itoa v1.0.15
   Compiling ryu v1.0.20
   Compiling denet v0.4.2
   Compiling ctrlc v3.5.0
   Compiling sysinfo v0.35.2
   Compiling colored v2.2.0
   Compiling thiserror-impl v1.0.69
   Compiling num_enum_derive v0.7.4
   Compiling derive_more-impl v2.0.1
   Compiling tabled_derive v0.8.0
   Compiling clap_derive v4.5.47
   Compiling serde_derive v1.0.223
   Compiling derive_more v2.0.1
   Compiling num_enum v0.7.4
   Compiling crossterm v0.29.0
   Compiling aya-log-common v0.1.15
   Compiling tabled v0.16.0
   Compiling aya-obj v0.1.0
   Compiling aya-obj v0.2.1
   Compiling clap v4.5.47
   Compiling aya v0.12.0
   Compiling aya v0.13.1
   Compiling aya-log v0.2.1
error[E0277]: `SyscallTracker` doesn't implement `std::fmt::Debug`
   --> /home/me/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/denet-0.4.2/src/core/process_monitor.rs:141:5
    |
124 | #[derive(Debug)]
    |          ----- in this derive macro expansion
...
141 |     ebpf_tracker: Option<crate::ebpf::SyscallTracker>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::fmt::Debug` is not implemented for `SyscallTracker`
    |
    = note: add `#[derive(Debug)]` to `SyscallTracker` or manually `impl std::fmt::Debug for SyscallTracker`
    = help: the trait `std::fmt::Debug` is implemented for `std::option::Option<T>`
help: consider annotating `SyscallTracker` with `#[derive(Debug)]`
   --> /home/me/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/denet-0.4.2/src/ebpf/syscall_tracker.rs:21:1
    |
21  + #[derive(Debug)]
22  | pub struct SyscallTracker {
    |

For more information about this error, try `rustc --explain E0277`.
warning: denet@0.4.2: Building with eBPF support - checking for clang...
warning: denet@0.4.2: ✓ clang found - compiling eBPF programs...
warning: denet@0.4.2: ✓ Compiled syscall_tracer.c -> syscall_tracer.o
warning: denet@0.4.2: ✓ Compiled simple_test.c -> simple_test.o
warning: denet@0.4.2: ✓ eBPF programs compiled successfully
error: could not compile `denet` (lib) due to 1 previous error
error: failed to compile `denet v0.4.2`, intermediate artifacts can be found at `/home/me/tmp/cargo-install5y5zY1`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
[me@laptop virtenvs]$ rustc --version
rustc 1.89.0 (29483883e 2025-08-04)
[me@laptop virtenvs]$ python --version
Python 3.12.3

Debug trace

Details
[me@laptop denet]$ cargo run --bin ebpf_diag --features ebpf -- --debug
warning: denet@0.4.2: Building with eBPF support - checking for clang...
warning: denet@0.4.2: ✓ clang found - compiling eBPF programs...
warning: denet@0.4.2: ✓ Compiled syscall_tracer.c -> syscall_tracer.o
warning: denet@0.4.2: ✓ Compiled simple_test.c -> simple_test.o
warning: denet@0.4.2: ✓ eBPF programs compiled successfully
   Compiling denet v0.4.2 (/home/imallona/src/denet)
error[E0277]: `SyscallTracker` doesn't implement `std::fmt::Debug`
   --> src/core/process_monitor.rs:141:5
    |
124 | #[derive(Debug)]
    |          ----- in this derive macro expansion
...
141 |     ebpf_tracker: Option<crate::ebpf::SyscallTracker>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SyscallTracker` cannot be formatted using `{:?}`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `SyscallTracker`, which is required by `std::option::Option<SyscallTracker>: std::fmt::Debug`
    = note: add `#[derive(Debug)]` to `SyscallTracker` or manually `impl std::fmt::Debug for SyscallTracker`
    = help: the trait `std::fmt::Debug` is implemented for `std::option::Option<T>`
    = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `SyscallTracker` with `#[derive(Debug)]`
   --> src/ebpf/syscall_tracker.rs:21:1
    |
21  + #[derive(Debug)]
22  | pub struct SyscallTracker {
    |

For more information about this error, try `rustc --explain E0277`.
The following warnings were emitted during compilation:

warning: denet@0.4.2: Building with eBPF support - checking for clang...
warning: denet@0.4.2: ✓ clang found - compiling eBPF programs...
warning: denet@0.4.2: ✓ Compiled syscall_tracer.c -> syscall_tracer.o
warning: denet@0.4.2: ✓ Compiled simple_test.c -> simple_test.o
warning: denet@0.4.2: ✓ eBPF programs compiled successfully

error: could not compile `denet` (lib) due to 1 previous error


$ rustc --explain E0277

You tried to use a type which doesn't implement some trait in a place which
expected that trait.

Erroneous code example:

// here we declare the Foo trait with a bar method
trait Foo {
    fn bar(&self);
}

// we now declare a function which takes an object implementing the Foo trait
fn some_func<T: Foo>(foo: T) {
    foo.bar();
}

fn main() {
    // we now call the method with the i32 type, which doesn't implement
    // the Foo trait
    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions