fix: only include panic-handler on bpf target

reviewable/pr1229/r16
Thomas Eizinger 2 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]
//!
//! use aya_ebpf::{macros::tracepoint, programs::TracePointContext};
//! #[cfg(not(test))]
//! #[cfg(target_arch = "bpf")]
//! extern crate ebpf_panic;
//!
//! #[tracepoint]

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

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

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

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

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

@ -2,7 +2,7 @@
#![no_main]
use aya_ebpf::{bindings::xdp_action, macros::xdp, programs::XdpContext};
#[cfg(not(test))]
#[cfg(target_arch = "bpf")]
extern crate ebpf_panic;
// 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,
programs::RawTracePointContext,
};
#[cfg(not(test))]
#[cfg(target_arch = "bpf")]
extern crate ebpf_panic;
use integration_common::raw_tracepoint::SysEnterEvent;

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save