Skip to content

Commit

Permalink
misc: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoNardi committed Jan 13, 2023
1 parent 6acbe4f commit c41ad7f
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -3,5 +3,3 @@
.vscode
.idea
*.swp

compile_commands.json
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bpf-common/Cargo.toml
Expand Up @@ -12,7 +12,7 @@ test-utils = []

[dependencies]
aya = { version = "0.11.0", features = ["async_tokio"] }
bytes = "1.1.0"
bytes = "1.3.0"
thiserror = "1"
tokio = { version = "1", features = ["full"] }
tokio-fd = "0.3.0"
Expand Down
4 changes: 0 additions & 4 deletions bpf-common/src/program.rs
Expand Up @@ -363,15 +363,11 @@ impl Program {
);
}
for buffer in buffers.iter_mut().take(events.read) {
// dbg!(buffer.len());
// dbg!(event_size);
let mut buffer =
std::mem::replace(buffer, BytesMut::with_capacity(buffer_size));
let ptr = buffer.as_ptr() as *const RawBpfEvent<T>;
let raw = unsafe { ptr.read_unaligned() };
buffer.advance(event_size);
// dbg!(buffer.len());
// dbg!(raw.buffer.buffer_len);
// NOTE: read buffer will be padded. Eg. if the eBPF program
// writes 3 bytes, we'll read 4, with the forth being a 0.
// This is why we need buffer_len and can't rely on the
Expand Down
1 change: 0 additions & 1 deletion modules/file-system-monitor/Cargo.toml
Expand Up @@ -14,7 +14,6 @@ pulsar-core = { path = "../../pulsar-core" }
nix = "0.24.0"
tokio = { version = "1", features = ["full"] }
log = "0.4"
bytes = "1.3.0"

[build-dependencies]
bpf-common = { path = "../../bpf-common", features = ["build"] }
1 change: 0 additions & 1 deletion modules/logger/Cargo.toml
Expand Up @@ -10,5 +10,4 @@ bpf-common = { path = "../../bpf-common" }

tokio = { version = "1", features = ["full"] }
log = "0.4"
bytes = "1.1"
chrono = "0.4.23"
1 change: 0 additions & 1 deletion pulsar-core/Cargo.toml
Expand Up @@ -17,4 +17,3 @@ anyhow = "1.0.53"
log = "0.4"
thiserror = "1.0.30"
nix = "0.24.0"
bytes = "1.3.0"
2 changes: 1 addition & 1 deletion pulsar-core/src/pdk/module.rs
Expand Up @@ -264,7 +264,7 @@ where
fn try_into_payload(data: BpfEvent<Self>) -> Result<Payload, Self::Error>;
}

/// This allows to teat a ModuleSender as a bpf_common::Sender<T> for any T which
/// This allows to treat a ModuleSender as a bpf_common::Sender<T> for any T which
/// can be converted into a Payload. This allows probes to send Pulsar events despite
/// not knowing anything about Pulsar.
impl<T: IntoPayload> bpf_common::BpfSender<T> for ModuleSender {
Expand Down

0 comments on commit c41ad7f

Please sign in to comment.