???????
????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.