Skip to content

Commit

Permalink
test/integration-ebpf: added integration tests for kretprobe & uretprobe
Browse files Browse the repository at this point in the history
Added integration test methods for kretprobe and uretprobe with their
appropriate contexts.
  • Loading branch information
tyrone-wu authored and alessandrod committed Apr 24, 2024
1 parent b84ede1 commit 6988dac
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/integration-ebpf/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use aya_ebpf::{
bindings::xdp_action,
macros::{kprobe, tracepoint, uprobe, xdp},
programs::{ProbeContext, TracePointContext, XdpContext},
macros::{kprobe, kretprobe, tracepoint, uprobe, uretprobe, xdp},
programs::{ProbeContext, RetProbeContext, TracePointContext, XdpContext},
};

#[xdp]
Expand All @@ -24,6 +24,11 @@ pub fn test_kprobe(_ctx: ProbeContext) -> u32 {
0
}

#[kretprobe]
pub fn test_kretprobe(_ctx: RetProbeContext) -> u32 {
0
}

#[tracepoint]
pub fn test_tracepoint(_ctx: TracePointContext) -> u32 {
0
Expand All @@ -34,6 +39,11 @@ pub fn test_uprobe(_ctx: ProbeContext) -> u32 {
0
}

#[uretprobe]
pub fn test_uretprobe(_ctx: RetProbeContext) -> u32 {
0
}

#[cfg(not(test))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
Expand Down

0 comments on commit 6988dac

Please sign in to comment.