From 6988dac1599d675ab525851cde4771c1123f51aa Mon Sep 17 00:00:00 2001 From: tyrone-wu Date: Tue, 26 Mar 2024 02:43:09 +0000 Subject: [PATCH] test/integration-ebpf: added integration tests for kretprobe & uretprobe Added integration test methods for kretprobe and uretprobe with their appropriate contexts. --- test/integration-ebpf/src/test.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/integration-ebpf/src/test.rs b/test/integration-ebpf/src/test.rs index 40b0de87..88f01e89 100644 --- a/test/integration-ebpf/src/test.rs +++ b/test/integration-ebpf/src/test.rs @@ -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] @@ -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 @@ -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) -> ! {