きっとなにかの時に使えると思う、、
# yum install strace
$ strace -o log echo test
$ cat log
execve("/bin/echo", ["echo", "test"], [/* 34 vars */]) = 0
brk(0) = 0x2141000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f11b22e2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f11b22e1000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=65792, ...}) = 0
mmap(NULL, 65792, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f11b22d0000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\353\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1820040, ...}) = 0
mmap(NULL, 3594344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f11b1d57000
mprotect(0x7f11b1ebb000, 2097152, PROT_NONE) = 0
mmap(0x7f11b20bb000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x164000) = 0x7f11b20bb000
mmap(0x7f11b20c0000, 18536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f11b20c0000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f11b22cf000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f11b22ce000
arch_prctl(ARCH_SET_FS, 0x7f11b22ce6f0) = 0
mprotect(0x7f11b20bb000, 16384, PROT_READ) = 0
mprotect(0x7f11b22e3000, 4096, PROT_READ) = 0
munmap(0x7f11b22d0000, 65792) = 0
brk(0) = 0x2141000
brk(0x2162000) = 0x2162000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=84748752, ...}) = 0
mmap(NULL, 84748752, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f11acc84000
close(3) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f11b22e0000
write(1, "test\n", 5) = 5
close(1) = 0
munmap(0x7f11b22e0000, 4096) = 0
close(2) = 0
exit_group(0) = ?
0 件のコメント:
コメントを投稿