From b5541316558efbcd6b65a16625ec2ad0fbabbb9d Mon Sep 17 00:00:00 2001 From: Frohlix Date: Mon, 11 Mar 2024 14:50:59 +0100 Subject: [PATCH 1/3] Use renamed aya-ebpf --- {{project-name}}-ebpf/Cargo.toml | 2 +- {{project-name}}-ebpf/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{project-name}}-ebpf/Cargo.toml b/{{project-name}}-ebpf/Cargo.toml index 17c08d7..01cfaa2 100644 --- a/{{project-name}}-ebpf/Cargo.toml +++ b/{{project-name}}-ebpf/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -aya-bpf = { git = "https://github.com/aya-rs/aya" } +aya-ebpf = { git = "https://github.com/aya-rs/aya" } aya-log-ebpf = { git = "https://github.com/aya-rs/aya" } {{ project-name }}-common = { path = "../{{ project-name }}-common" } diff --git a/{{project-name}}-ebpf/src/main.rs b/{{project-name}}-ebpf/src/main.rs index 0f13e39..8e7b73c 100644 --- a/{{project-name}}-ebpf/src/main.rs +++ b/{{project-name}}-ebpf/src/main.rs @@ -2,7 +2,7 @@ #![no_main] {% case program_type -%} {%- when "kprobe" %} -use aya_bpf::{macros::kprobe, programs::ProbeContext}; +use aya_ebpf::{macros::kprobe, programs::ProbeContext}; use aya_log_ebpf::info; #[kprobe] From f6c6a159fa30ed12ddd4153a6d7c8b30a0f53aa6 Mon Sep 17 00:00:00 2001 From: Frohlix Date: Mon, 11 Mar 2024 14:57:28 +0100 Subject: [PATCH 2/3] Use renamed Ebpf, EbpfLogger --- {{project-name}}/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{project-name}}/src/main.rs b/{{project-name}}/src/main.rs index 756fd87..19db213 100644 --- a/{{project-name}}/src/main.rs +++ b/{{project-name}}/src/main.rs @@ -39,8 +39,8 @@ use aya::programs::SocketFilter; {%- when "raw_tracepoint" -%} use aya::programs::RawTracePoint; {%- endcase %} -use aya::{include_bytes_aligned, Bpf}; -use aya_log::BpfLogger; +use aya::{include_bytes_aligned, Ebpf}; +use aya_log::EbpfLogger; {% if program_types_with_opts contains program_type -%} use clap::Parser; {% endif -%} @@ -86,14 +86,14 @@ async fn main() -> Result<(), anyhow::Error> { // like to specify the eBPF program at runtime rather than at compile-time, you can // reach for `Bpf::load_file` instead. #[cfg(debug_assertions)] - let mut bpf = Bpf::load(include_bytes_aligned!( + let mut bpf = Ebpf::load(include_bytes_aligned!( "../../target/bpfel-unknown-none/debug/{{project-name}}" ))?; #[cfg(not(debug_assertions))] let mut bpf = Bpf::load(include_bytes_aligned!( "../../target/bpfel-unknown-none/release/{{project-name}}" ))?; - if let Err(e) = BpfLogger::init(&mut bpf) { + if let Err(e) = EbpfLogger::init(&mut bpf) { // This can happen if you remove all log statements from your eBPF program. warn!("failed to initialize eBPF logger: {}", e); } From 3c043c555cb43421f270462ddc2c43213b94fd1b Mon Sep 17 00:00:00 2001 From: Frohlix Date: Mon, 11 Mar 2024 15:10:17 +0100 Subject: [PATCH 3/3] Fix missed Bpf - Ebpf rename --- {{project-name}}/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{project-name}}/src/main.rs b/{{project-name}}/src/main.rs index 19db213..c4e2697 100644 --- a/{{project-name}}/src/main.rs +++ b/{{project-name}}/src/main.rs @@ -90,7 +90,7 @@ async fn main() -> Result<(), anyhow::Error> { "../../target/bpfel-unknown-none/debug/{{project-name}}" ))?; #[cfg(not(debug_assertions))] - let mut bpf = Bpf::load(include_bytes_aligned!( + let mut bpf = Ebpf::load(include_bytes_aligned!( "../../target/bpfel-unknown-none/release/{{project-name}}" ))?; if let Err(e) = EbpfLogger::init(&mut bpf) {