Created
March 10, 2021 12:50
-
-
Save adamse/3db69c14a377b15c0c795167713088f5 to your computer and use it in GitHub Desktop.
who called mmap?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo perf probe -x /nix/store/3wa1xwnfv8ada1za1r8m4vmsiz1jifqq-glibc-2.32-35/lib/libc.so.6 '--add=mmap%return $retval' | |
Added new event: | |
probe_libc:mmap__return (on mmap%return in /nix/store/3wa1xwnfv8ada1za1r8m4vmsiz1jifqq-glibc-2.32-35/lib/libc-2.32.so with $retval) | |
You can now use it in all perf tools, such as: | |
perf record -e probe_libc:mmap__return -aR sleep 1 | |
$ sudo perf record -e probe_libc:mmap__return -g -aR `which ghc` -e 'putStrLn "hej"' | |
$ sudo perf script | |
ghc 1196781 [001] 320274.285711: probe_libc:mmap__return: (7fab15bcd400 <- 7fab15b0aad4) arg1=0x7fab15915000 | |
7fab15b0aad4 _nl_load_locale_from_archive+0x4d4 (/nix/store/3wa1xwnfv8ada1za1r8m4vmsiz1jifqq-glibc-2.32-35/lib/libc-2.32.so) | |
7fab15b098e4 _nl_find_locale+0xe4 (/nix/store/3wa1xwnfv8ada1za1r8m4vmsiz1jifqq-glibc-2.32-35/lib/libc-2.32.so) | |
7fab15b092cb setlocale+0x18b (/nix/store/3wa1xwnfv8ada1za1r8m4vmsiz1jifqq-glibc-2.32-35/lib/libc-2.32.so) | |
4ae9b7 [unknown] ([unknown]) | |
fc8e40fffc8e40ff [unknown] ([unknown]) | |
... | |
# arg1 is the return value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment