From 23ef443b24e4a3c563697e027c94513c902d6c2c Mon Sep 17 00:00:00 2001 From: pdliyan Date: Tue, 4 Jul 2023 20:35:05 +0800 Subject: [PATCH] add sarg without comment. --- bpf/aya-bpf/src/programs/probe.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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