Skip to content

Instantly share code, notes, and snippets.

@notorca notorca/glibc
Created Mar 29, 2019

Embed
What would you like to do?
strace for glibc and jmalloc
$ strastrace ./lemirebenchmark
execve("./lemirebenchmark", ["./lemirebenchmark"], 0xfffff846f1b0 /* 26 vars */) = 0
brk(NULL) = 0xaaaacfa9a000
faccessat(AT_FDCWD, "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=61995, ...}) = 0
mmap(NULL, 61995, PROT_READ, MAP_PRIVATE, 3, 0) = 0xffff8e057000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/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\267\0\1\0\0\0\360\23\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1836744, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff8e092000
mmap(NULL, 1535784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff8dee0000
mprotect(0xffff8e03e000, 65536, PROT_NONE) = 0
mmap(0xffff8e04e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15e000) = 0xffff8e04e000
mmap(0xffff8e054000, 12072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffff8e054000
close(3) = 0
mprotect(0xffff8e04e000, 16384, PROT_READ) = 0
mprotect(0xaaaab1814000, 4096, PROT_READ) = 0
mprotect(0xffff8e096000, 4096, PROT_READ) = 0
munmap(0xffff8e057000, 61995) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
brk(NULL) = 0xaaaacfa9a000
brk(0xaaaacfabb000) = 0xaaaacfabb000
write(1, "create(): ", 10create(): ) = 10
mmap(NULL, 184320, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff8deb3000
mremap(0xffff8deb3000, 184320, 368640, MREMAP_MAYMOVE) = 0xffff8de59000
mremap(0xffff8de59000, 368640, 733184, MREMAP_MAYMOVE) = 0xffff8dda6000
mremap(0xffff8dda6000, 733184, 1462272, MREMAP_MAYMOVE) = 0xffff8dc41000
mremap(0xffff8dc41000, 1462272, 2920448, MREMAP_MAYMOVE) = 0xffff8d978000
mremap(0xffff8d978000, 2920448, 5840896, MREMAP_MAYMOVE) = 0xffff8d3e6000
mremap(0xffff8d3e6000, 5840896, 11677696, MREMAP_MAYMOVE) = 0xffff8c8c3000
mremap(0xffff8c8c3000, 11677696, 23351296, MREMAP_MAYMOVE) = 0xffff8b27e000
munmap(0xffff8b27e000, 23351296) = 0
brk(0xaaaacfafe000) = 0xaaaacfafe000
brk(0xaaaacfbc6000) = 0xaaaacfbc6000
brk(0xaaaacfcd1000) = 0xaaaacfcd1000
brk(0xaaaacfee8000) = 0xaaaacfee8000
brk(0xaaaad0314000) = 0xaaaad0314000
brk(0xaaaad0b6e000) = 0xaaaad0b6e000
brk(0xaaaad1c21000) = 0xaaaad1c21000
write(1, " 45.418000 ms\n", 14 45.418000 ms
) = 14
exit_group(0) = ?
+++ exited with 0 +++
$ strace ./lemirebenchmark
execve("./lemirebenchmark", ["./lemirebenchmark"], 0xffffe3713960 /* 26 vars */) = 0
brk(NULL) = 0xaaaac2e4a000
faccessat(AT_FDCWD, "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/aarch64/libjemalloc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/tls/aarch64", 0xffffe45b06b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/libjemalloc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/tls", 0xffffe45b06b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/aarch64/libjemalloc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/aarch64", 0xffffe45b06b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libjemalloc.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\200r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=469392, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff92c53000
mmap(NULL, 2693624, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff92996000
mprotect(0xffff92a03000, 61440, PROT_NONE) = 0
mmap(0xffff92a12000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6c000) = 0xffff92a12000
mmap(0xffff92a19000, 2157048, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffff92a19000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0P\313\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=731096, ...}) = 0
mmap(NULL, 794648, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff928d3000
mprotect(0xffff92984000, 65536, PROT_NONE) = 0
mmap(0xffff92994000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb1000) = 0xffff92994000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\260\243\10\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=14915688, ...}) = 0
mmap(NULL, 1749992, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff92727000
mprotect(0xffff928b4000, 61440, PROT_NONE) = 0
mmap(0xffff928c3000, 53248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18c000) = 0xffff928c3000
mmap(0xffff928d0000, 9192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffff928d0000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\230`\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=160328, ...}) = 0
mmap(NULL, 188760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff926f8000
mprotect(0xffff92712000, 61440, PROT_NONE) = 0
mmap(0xffff92721000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0xffff92721000
mmap(0xffff92723000, 12632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffff92723000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\240\r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=18392, ...}) = 0
mmap(NULL, 82016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff926e3000
mprotect(0xffff926e7000, 61440, PROT_NONE) = 0
mmap(0xffff926f6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0xffff926f6000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/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\267\0\1\0\0\0\360\23\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1836744, ...}) = 0
mmap(NULL, 1535784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff9256c000
mprotect(0xffff926ca000, 65536, PROT_NONE) = 0
mmap(0xffff926da000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15e000) = 0xffff926da000
mmap(0xffff926e0000, 12072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffff926e0000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\0'\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=747592, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff92c51000
mmap(NULL, 148264, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff92547000
mprotect(0xffff9255a000, 65536, PROT_NONE) = 0
mmap(0xffff9256a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0xffff9256a000
close(3) = 0
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff92c4d000
mprotect(0xffff926da000, 16384, PROT_READ) = 0
mprotect(0xffff9256a000, 4096, PROT_READ) = 0
mprotect(0xffff926f6000, 4096, PROT_READ) = 0
mprotect(0xffff92721000, 4096, PROT_READ) = 0
mprotect(0xffff92994000, 4096, PROT_READ) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff92c4b000
mprotect(0xffff928c3000, 49152, PROT_READ) = 0
mprotect(0xffff92a12000, 24576, PROT_READ) = 0
mprotect(0xaaaab471b000, 4096, PROT_READ) = 0
mprotect(0xffff92c57000, 4096, PROT_READ) = 0
set_tid_address(0xffff92c4d0e0) = 977
set_robust_list(0xffff92c4d0f0, 24) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0xffff926fdac8, sa_mask=[], sa_flags=SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0xffff926fdb90, sa_mask=[], sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/etc/malloc.conf", 0xffffe45b0820, 4096) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/sys/vm/overcommit_memory", O_RDONLY|O_CLOEXEC) = 3
read(3, "0", 1) = 1
close(3) = 0
openat(AT_FDCWD, "/sys/kernel/mm/transparent_hugepage/enabled", O_RDONLY) = -1 ENOENT (No such file or directory)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff92c4a000
madvise(0xffff92c4a000, 4096, MADV_FREE) = 0
munmap(0xffff92c4a000, 4096) = 0
mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff92347000
munmap(0xffff92347000, 2097152) = 0
mmap(NULL, 4190208, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff92148000
munmap(0xffff92148000, 753664) = 0
munmap(0xffff92400000, 1339392) = 0
brk(NULL) = 0xaaaac2e4a000
mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff92000000
mmap(NULL, 4194304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff91c00000
sched_getaffinity(977, 128, [0, 1, 2, 3]) = 8
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0
write(1, "create(): ", 10create(): ) = 10
mmap(NULL, 3670016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff91880000
mmap(NULL, 7340032, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff91180000
mmap(NULL, 14680064, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff90380000
mmap(NULL, 29360128, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xffff8e780000
write(1, " 66.990000 ms\n", 14 66.990000 ms
) = 14
exit_group(0) = ?
+++ exited with 0 +++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.