diff --git a/bpf/aya-bpf/src/programs/probe.rs b/bpf/aya-bpf/src/programs/probe.rs index 77d9334b..c2c6e5bf 100644 --- a/bpf/aya-bpf/src/programs/probe.rs +++ b/bpf/aya-bpf/src/programs/probe.rs @@ -44,6 +44,17 @@ impl ProbeContext { T::from_argument(unsafe { &*self.regs }, n) } + /// Returns the `n`th stack argument to passed to the probe function, starting from 0. + /// + /// # Examples + /// + /// ```no_run + /// + /// ``` + pub fn stack_arg(&self, n: usize) -> Option { + T::from_stack_argument(unsafe { &*self.regs }, n) + } + /// Returns the return value of the probed function. /// /// # Examples