Skip to content

Commit

Permalink
use aya-log's 'info' macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitris committed Oct 27, 2022
1 parent 4bd88cd commit 10d1a6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions tcbpftest-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ unsafe fn try_tcbpftest(ctx: TcContext) -> Result<i32, i64> {
unsafe {
EVENTS.output(&ctx, &log_entry, 0);
}
info!(&ctx, "packet:");
Ok(0)
}

Expand Down
2 changes: 2 additions & 0 deletions tcbpftest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ async fn main() -> Result<(), anyhow::Error> {
for buf in buffers.iter_mut().take(events.read) {
let ptr = buf.as_ptr() as *const PacketLog;
let data = unsafe { ptr.read_unaligned() };
/*
println!(
"LOG: LEN {}, CTX_LEN {}, UDP_LEN {}, SRC_IP {}, DEST_IP {}, ETH_PROTO 0x{:X}, ETH_PROTO2 0x{:X}, IP_PROTO {}, REMOTE_PORT {}, REMOTE_PORT2 {}, LOCAL_PORT {}, LOCAL_PORT2 {}",
data.len,
Expand All @@ -81,6 +82,7 @@ async fn main() -> Result<(), anyhow::Error> {
data.local_port,
data.local_port2,
);
*/
}
}
});
Expand Down

0 comments on commit 10d1a6a

Please sign in to comment.