-
-
Notifications
You must be signed in to change notification settings - Fork 487
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Would like to start showing my appreciation to this repo and Eunomia in general.
TBH it can be also a typo, but the README.md is still a bit confusing. When tracing the helloworld
project on the args
directory this command is written on the README sudo bpftrace -e 'uprobe:args/target/release/helloworld:_ZN10helloworld4main17h2dce92cb81426b91E ...
.
I see two issues:
- The symbol corresponds to the
main
function not thehello
function - The
hello
function gets inlined inrelease
build mode (I have not confirmed this, but cannot find it usingnm
)
building the binary in debug mode and tracing the hello
function both with uprobe
and uretprobe
gives the "expected" output
To Reproduce
cargo build
nm target/debug/helloworld | grep hello
0000000000008ce0 t _ZN10helloworld4main17h0fc2ef2e3559c5e9E
0000000000008c30 t _ZN10helloworld5hello17h2e3af3f12b54c6c3E
Expected behavior
sudo bpftrace -e 'uprobe:target/debug/helloworld:_ZN10helloworld5hello17h2e3af3f12b54c6c3E { printf("Function hello-world called\n"); }'
Function hello-world called
Function hello-world called
Function hello-world called
the above output comes from running
./target/debug/helloworld 1 2 3
Hello, world! 1 in 4
return value: 5
Hello, world! 2 in 4
return value: 6
Hello, world! 3 in 4
return value: 7
Similarly
sudo bpftrace -e 'uretprobe:target/debug/helloworld:_ZN10helloworld5hello17h2e3af3f12b54c6c3E { printf("Function hello-world called. Return vale %d\n", retval); }'
Attaching 1 probe...
Function hello-world called. Return vale 5
Function hello-world called. Return vale 6
Function hello-world called. Return vale 7
Desktop (please complete the following information):
- OS: wsl2
- Version rust edition 2024
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working