Add malloc logging tool

STATIC_YOINK("enable_memory_log");
This commit is contained in:
Justine Tunney 2022-05-26 23:17:19 -07:00
parent 7e9fb0a9f1
commit cb67223051
25 changed files with 502 additions and 78 deletions

View file

@ -0,0 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall __sys_gettid,0x13712b1b0101b0ba,globl,hidden

View file

@ -1,2 +0,0 @@
.include "o/libc/sysv/macros.internal.inc"
.scall break,0xffffff011fffffff,globl

View file

@ -1,2 +0,0 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_gettid,0xfffffffff211e0ba,globl,hidden

View file

@ -2054,7 +2054,7 @@ syscon nr __NR_modify_ldt 0x009a 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_pivot_root 0x009b 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR__sysctl 0x009c 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_prctl 0x009d 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_arch_prctl 0x009e 0xfff 0x00a5 0x00a5 0xfff 0xfff
syscon nr __NR_arch_prctl 0x009e 0x3000003 0x00a5 0x149 0x13d 0xfff # sysarch on freebsd, _lwp_setprivate on netbsd, __set_tcb on openbsd, thread_fast_set_cthread_self on xnu
syscon nr __NR_adjtimex 0x009f 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_umount2 0x00a6 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_swapon 0x00a7 0x2000055 0x0055 0xfff 0xfff 0xfff
@ -2065,7 +2065,7 @@ syscon nr __NR_iopl 0x00ac 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_ioperm 0x00ad 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_init_module 0x00af 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_delete_module 0x00b0 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_gettid 0x00ba 0x200011e 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_gettid 0x00ba 0x0100001b 432 299 311 0xfff # TODO(jart): thread_self_trap vs. gettid?
syscon nr __NR_readahead 0x00bb 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_setxattr 0x00bc 0x20000ec 0xfff 0xfff 0x177 0xfff
syscon nr __NR_fsetxattr 0x00be 0x20000ed 0xfff 0xfff 0x179 0xfff

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,TIOCGPTN,0x80045430,0,0x4004740f,0,0,0
.syscon pty,TIOCGPTN,0x80045430,0,0x4004740f,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon pty,TIOCSPTLCK,0x40045431,0,0,0,0,-1
.syscon pty,TIOCSPTLCK,0x40045431,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon nr,__NR_arch_prctl,0x009e,0xfff,0x00a5,0x00a5,0xfff,0xfff
.syscon nr,__NR_arch_prctl,0x009e,0x3000003,0x00a5,0x149,0x13d,0xfff

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon nr,__NR_gettid,0x00ba,0x200011e,0xfff,0xfff,0xfff,0xfff
.syscon nr,__NR_gettid,0x00ba,0x0100001b,432,299,311,0xfff

View file

@ -219,7 +219,7 @@ scall iopl 0xfffffffffffff0ac globl
scall ioperm 0xfffffffffffff0ad globl
scall init_module 0xfffffffffffff0af globl
scall delete_module 0xfffffffffffff0b0 globl
scall sys_gettid 0xfffffffff211e0ba globl hidden
scall __sys_gettid 0x13712b1b0101b0ba globl hidden # thread_self_trap (or gettid? on xnu), _lwp_self on netbsd, thr_self on freebsd, getthrid on openbsd
scall readahead 0xfffffffffffff0bb globl # consider fadvise() / madvise()
scall setxattr 0x177ffffff20ec0bc globl
scall fsetxattr 0x179ffffff20ed0be globl
@ -618,10 +618,10 @@ scall workq_open 0xfffffffff216ffff globl
scall write_nocancel 0xfffffffff218dfff globl
scall writev_nocancel 0xfffffffff219cfff globl
#──────────────────────────FREEBSD───────────────────────────
scall _umtx_op 0xffffff1c6fffffff globl
scall abort2 0xffffff1cffffffff globl
scall afs3_syscall 0xffffff179fffffff globl
scall bindat 0xffffff21afffffff globl
scall break 0xffffff011fffffff globl
scall cap_enter 0xffffff204fffffff globl
scall cap_fcntls_get 0xffffff219fffffff globl
scall cap_fcntls_limit 0xffffff218fffffff globl
@ -816,7 +816,6 @@ scall __acl_aclcheck_link 0xffffff1acfffffff globl
scall __mac_syscall 0xfffffffff217dfff globl
scall __acl_set_file 0xffffff15cfffffff globl
scall __acl_delete_file 0xffffff15ffffffff globl
scall _umtx_op 0xffffff1c6fffffff globl
scall __semwait_signal_nocancel 0xfffffffff21a7fff globl
scall __old_semwait_signal_nocancel 0xfffffffff2173fff globl
scall sctp_peeloff 0xffffff1d7fffffff globl