fix: only include panic-handler on bpf target

reviewable/pr1229/r16
Thomas Eizinger 3 weeks ago
parent 4c5fbef869
commit ef181058b0
No known key found for this signature in database
GPG Key ID: 05633CD77196CAF3

@ -16,7 +16,7 @@
//! #![no_std] //! #![no_std]
//! //!
//! use aya_ebpf::{macros::tracepoint, programs::TracePointContext}; //! use aya_ebpf::{macros::tracepoint, programs::TracePointContext};
//! #[cfg(not(test))] //! #[cfg(target_arch = "bpf")]
//! extern crate ebpf_panic; //! extern crate ebpf_panic;
//! //!
//! #[tracepoint] //! #[tracepoint]

@ -8,7 +8,7 @@ use aya_ebpf::{
programs::ProbeContext, programs::ProbeContext,
}; };
use integration_common::bpf_probe_read::{RESULT_BUF_LEN, TestResult}; use integration_common::bpf_probe_read::{RESULT_BUF_LEN, TestResult};
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
fn read_str_bytes( fn read_str_bytes(

@ -5,7 +5,7 @@ use core::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use aya_ebpf::{macros::uprobe, programs::ProbeContext}; use aya_ebpf::{macros::uprobe, programs::ProbeContext};
use aya_log_ebpf::{debug, error, info, trace, warn}; use aya_log_ebpf::{debug, error, info, trace, warn};
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[uprobe] #[uprobe]

@ -9,7 +9,7 @@ use aya_ebpf::{
maps::{Array, HashMap}, maps::{Array, HashMap},
programs::SkBuffContext, programs::SkBuffContext,
}; };
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
// Introduced in kernel v3.19. // Introduced in kernel v3.19.

@ -9,7 +9,7 @@ use aya_ebpf::{
maps::HashMap, maps::HashMap,
programs::XdpContext, programs::XdpContext,
}; };
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
use network_types::{ use network_types::{
eth::{EthHdr, EtherType}, eth::{EthHdr, EtherType},

@ -2,7 +2,7 @@
#![no_main] #![no_main]
use aya_ebpf::{bindings::xdp_action, macros::xdp, programs::XdpContext}; use aya_ebpf::{bindings::xdp_action, macros::xdp, programs::XdpContext};
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[xdp] #[xdp]

@ -2,7 +2,7 @@
#![no_main] #![no_main]
use aya_ebpf::{bindings::xdp_action, macros::xdp, programs::XdpContext}; use aya_ebpf::{bindings::xdp_action, macros::xdp, programs::XdpContext};
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
// Note: the `frags` attribute causes this probe to be incompatible with kernel versions < 5.18.0. // Note: the `frags` attribute causes this probe to be incompatible with kernel versions < 5.18.0.

@ -6,7 +6,7 @@ use aya_ebpf::{
maps::Array, maps::Array,
programs::RawTracePointContext, programs::RawTracePointContext,
}; };
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
use integration_common::raw_tracepoint::SysEnterEvent; use integration_common::raw_tracepoint::SysEnterEvent;

@ -7,7 +7,7 @@ use aya_ebpf::{
maps::{Array, CpuMap, DevMap, DevMapHash, XskMap}, maps::{Array, CpuMap, DevMap, DevMapHash, XskMap},
programs::XdpContext, programs::XdpContext,
}; };
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[map] #[map]

@ -8,7 +8,7 @@ use aya_ebpf::{
maps::Array, maps::Array,
programs::ProbeContext, programs::ProbeContext,
}; };
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[map] #[map]

@ -7,7 +7,7 @@ use aya_ebpf::{
programs::ProbeContext, programs::ProbeContext,
}; };
use integration_common::ring_buf::Registers; use integration_common::ring_buf::Registers;
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[map] #[map]

@ -5,7 +5,7 @@
#![no_main] #![no_main]
use aya_ebpf::{macros::socket_filter, programs::SkBuffContext}; use aya_ebpf::{macros::socket_filter, programs::SkBuffContext};
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
// Introduced in kernel v3.19. // Introduced in kernel v3.19.

@ -9,7 +9,7 @@ use aya_ebpf::{
programs::ProbeContext, programs::ProbeContext,
}; };
use integration_common::strncmp::TestResult; use integration_common::strncmp::TestResult;
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[map] #[map]

@ -2,7 +2,7 @@
#![no_main] #![no_main]
use aya_ebpf::{bindings::tcx_action_base::TCX_NEXT, macros::classifier, programs::TcContext}; use aya_ebpf::{bindings::tcx_action_base::TCX_NEXT, macros::classifier, programs::TcContext};
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[classifier] #[classifier]

@ -8,7 +8,7 @@ use aya_ebpf::{
FlowDissectorContext, ProbeContext, RetProbeContext, TracePointContext, XdpContext, FlowDissectorContext, ProbeContext, RetProbeContext, TracePointContext, XdpContext,
}, },
}; };
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[xdp] #[xdp]

@ -4,7 +4,7 @@
#![no_main] #![no_main]
use aya_ebpf::{macros::tracepoint, programs::TracePointContext}; use aya_ebpf::{macros::tracepoint, programs::TracePointContext};
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[tracepoint] #[tracepoint]

@ -7,7 +7,7 @@ use aya_ebpf::{
maps::RingBuf, maps::RingBuf,
programs::ProbeContext, programs::ProbeContext,
}; };
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
#[map] #[map]

@ -2,7 +2,7 @@
#![no_main] #![no_main]
use aya_ebpf::{bindings::xdp_action::XDP_PASS, macros::xdp, programs::XdpContext}; use aya_ebpf::{bindings::xdp_action::XDP_PASS, macros::xdp, programs::XdpContext};
#[cfg(not(test))] #[cfg(target_arch = "bpf")]
extern crate ebpf_panic; extern crate ebpf_panic;
macro_rules! probe { macro_rules! probe {

Loading…
Cancel
Save