Linux??strace????????
???????????? ???????[ 2015/3/20 15:23:11 ] ????????Linux ?????? ??? ???
???????
????strace?????????????????????????ú???????????? ??Linux???磬?????????????????豸???????????????????豸(?????????????????????????????)????????????????л???????????? ???????÷???????豸??strace???????????????????????????????????????????????????????
???????????????
root@ubuntu:/usr# strace cat /dev/null
execve("/bin/cat"?? ["cat"?? "/dev/null"]?? [/* 22 vars */]) = 0
brk(0) = 0xab1000
access("/etc/ld.so.nohwcap"?? F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL?? 8192?? PROT_READ|PROT_WRITE?? MAP_PRIVATE|MAP_ANONYMOUS?? -1?? 0) = 0x7f29379a7000
access("/etc/ld.so.preload"?? R_OK) = -1 ENOENT (No such file or directory)
...
brk(0) = 0xab1000
brk(0xad2000) = 0xad2000
fstat(1?? {st_mode=S_IFCHR|0620?? st_rdev=makedev(136?? 0)?? ...}) = 0
open("/dev/null"?? O_RDONLY) = 3
fstat(3?? {st_mode=S_IFCHR|0666?? st_rdev=makedev(1?? 3)?? ...}) = 0
read(3?? ""?? 32768) = 0
close(3) = 0
close(1) = 0
close(2) = 0
exit_group(0) = ?
???????ж???????????????????????????????????????????????????????????
????strace ?????Щ?????????????????????????strace ????????????????????????κ??????????????????
????strace????
????-c ????????????????е???????????????????.
????-d ???strace?????????????????.
????-f ??????fork?????????????????.
????-ff ?????-o filename???????н???????????????????filename.pid?У?pid????????????.
????-F ???????vfork????.??-f???vfork????????.
????-h ??????????????.
????-i ????????????????.
????-q ??????????????????.
????-r ???????????????????????????.
????-t ??????е????????????????.
????-tt ??????е?????????????????????.
????-ttt ???????????????????.
????-T ?????????????????.
????-v ??????е???????.?Щ???ù???????????????????????????????????????????????.
????-V ???strace??汾???.
????-x ????????????????????????
????-xx ????????????????????????.
????-a column
???????÷?????????λ??.??? ?40.
????-e expr
??????????????????????????θ???.???????:
????[qualifier=][!]value1[??value2]...
????qualifier????? trace??abbrev??verbose??raw??signal??read??write??????.value???????????????????.???? qualifier?? trace.????????????.????:
????-eopen????? -e trace=open??????????open????.??-etrace!=open??????????open?????????????.?????????????? all ?? none.
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11