Fix unchanged Bpf reference. Would check sock_map latter.

pull/106/head
pdliyan 6 months ago
parent bc61bdeeba
commit 628e6a4f81

@ -324,7 +324,7 @@ fn try_{{crate_name}}(ctx: RawTracePointContext) -> Result<i32, i32> {
}
{%- when "perf_event" %}
use aya_ebpf::{
helpers::bpf_get_smp_processor_id, macros::perf_event, programs::PerfEventContext, BpfContext,
helpers::bpf_get_smp_processor_id, macros::perf_event, programs::PerfEventContext, EbpfContext,
};
use aya_log_ebpf::info;

@ -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!(
let mut bpf = Ebpf::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);
}

Loading…
Cancel
Save