We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attach the following program:
// SPDX-License-Identifier: GPL-2.0 #include <vmlinux.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h> SEC("uretprobe/./example/simple_uretprobe_test/victim:simple_add") int BPF_URETPROBE(simple_probe, long ret) { bpf_printk("Ret=%ld\n", ret); return 0; } SEC("uretprobe/./example/simple_uretprobe_test/victim:simple_add") int BPF_URETPROBE(simple_probe2, long ret) { bpf_printk("Ret2=%ld\n", ret); return 0; } char LICENSE[] SEC("license") = "GPL";
victim:
#include <cstdint> #include <fcntl.h> #include <iostream> #include <ostream> #include <unistd.h> extern "C" int64_t simple_add(int64_t a, int64_t b) { return a + b; } int main() { while (true) { for (int i = 1; i <= 10; i++) { for (int j = 1; j <= 10; j++) { int32_t ret = simple_add(i, j); std::cout << i << " + " << j << " = " << ret << std::endl; usleep(1000 * 500); } } } return 0; }
Will lead to the following output:
Ret2=1 Ret=2 1 + 1 = 2 Ret2=1 Ret=3 1 + 2 = 3 Ret2=1 Ret=4 1 + 3 = 4 Ret2=1 Ret=5 1 + 4 = 5
Where ret2 prints the first argument, not the return value, so it seems to be attached as uprobe
The text was updated successfully, but these errors were encountered:
Officeyutong
Successfully merging a pull request may close this issue.
Attach the following program:
victim:
Will lead to the following output:
Where ret2 prints the first argument, not the return value, so it seems to be attached as uprobe
The text was updated successfully, but these errors were encountered: