Skip to content
New issue

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

Which events does simple C-program uses to fire USDT probe? #6

Open
ValchukDmitry opened this issue Oct 28, 2019 · 2 comments
Open
Assignees

Comments

@ValchukDmitry
Copy link

No description provided.

@ValchukDmitry ValchukDmitry self-assigned this Oct 28, 2019
@ValchukDmitry
Copy link
Author

Here is strace of simple program, which fires USDT probe:

execve("./result", ["./result"], [/* 81 vars */]) = 0
brk(NULL)                               = 0x1946000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
...
open("tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("libc.so.6", O_RDONLY|O_CLOEXEC)   = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=181605, ...}) = 0
mmap(NULL, 181605, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f70b2e86000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f70b2e85000
mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f70b28c4000
mprotect(0x7f70b2a84000, 2097152, PROT_NONE) = 0
mmap(0x7f70b2c84000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f70b2c84000
mmap(0x7f70b2c8a000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f70b2c8a000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f70b2e84000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f70b2e83000
arch_prctl(ARCH_SET_FS, 0x7f70b2e84700) = 0
mprotect(0x7f70b2c84000, 16384, PROT_READ) = 0
mprotect(0x600000, 4096, PROT_READ)     = 0
mprotect(0x7f70b2eb3000, 4096, PROT_READ) = 0
munmap(0x7f70b2e86000, 181605)          = 0
exit_group(0)                           = ?

@AntonKozlov
Copy link
Member

Had anyone listened for the event?

https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
It seems that without a listener a tracepoint is just a sequence of nops and we need to attach something to turn the sequence into actual reporting code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants