Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
strace ping baidu.com, default setting
$ strace -t ping baidu.com
21:08:23 execve("/bin/ping", ["ping", "baidu.com"], [/* 29 vars */]) = 0
21:08:23 brk(0) = 0x7f64d70e7000
21:08:23 fcntl(0, F_GETFD) = 0
21:08:23 fcntl(1, F_GETFD) = 0
21:08:23 fcntl(2, F_GETFD) = 0
21:08:23 access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory)
21:08:23 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f64d6e78000
21:08:23 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
21:08:23 open("/etc/ld.so.cache", O_RDONLY) = 3
21:08:23 fstat(3, {st_mode=S_IFREG|0644, st_size=68446, ...}) = 0
21:08:23 mmap(NULL, 68446, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f64d6e67000
21:08:23 close(3) = 0
21:08:23 open("/lib64/libidn.so.11", O_RDONLY) = 3
21:08:23 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0/`\2718\0\0\0"..., 832) = 832
21:08:23 fstat(3, {st_mode=S_IFREG|0755, st_size=209088, ...}) = 0
21:08:23 mmap(NULL, 2301736, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f64d6a28000
21:08:23 mprotect(0x7f64d6a5a000, 2093056, PROT_NONE) = 0
21:08:23 mmap(0x7f64d6c59000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7f64d6c59000
21:08:23 close(3) = 0
21:08:23 open("/lib64/libc.so.6", O_RDONLY) = 3
21:08:23 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\355\241\2618\0\0\0"..., 832) = 832
21:08:23 fstat(3, {st_mode=S_IFREG|0755, st_size=1979000, ...}) = 0
21:08:23 mmap(NULL, 3803304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f64d6687000
21:08:23 mprotect(0x7f64d681e000, 2097152, PROT_NONE) = 0
21:08:23 mmap(0x7f64d6a1e000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x197000) = 0x7f64d6a1e000
21:08:23 mmap(0x7f64d6a23000, 18600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f64d6a23000
21:08:23 close(3) = 0
21:08:23 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f64d6e66000
21:08:23 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f64d6e65000
21:08:23 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f64d6e64000
21:08:23 arch_prctl(ARCH_SET_FS, 0x7f64d6e65700) = 0
21:08:23 mprotect(0x7f64d6a1e000, 16384, PROT_READ) = 0
21:08:23 mprotect(0x7f64d6e79000, 4096, PROT_READ) = 0
21:08:23 munmap(0x7f64d6e67000, 68446) = 0
21:08:23 brk(0) = 0x7f64d70e7000
21:08:23 brk(0x7f64d7108000) = 0x7f64d7108000
21:08:23 open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
21:08:23 fstat(3, {st_mode=S_IFREG|0644, st_size=99158704, ...}) = 0
21:08:23 mmap(NULL, 99158704, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f64d07f6000
21:08:23 close(3) = 0
21:08:23 socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = -1 EPERM (Operation not permitted)
21:08:23 getuid() = 500
21:08:23 setuid(500) = 0
21:08:23 getpid() = 194596
21:08:23 open("/etc/resolv.conf", O_RDONLY) = 3
21:08:23 fstat(3, {st_mode=S_IFREG|0644, st_size=160, ...}) = 0
21:08:23 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f64d6e77000
21:08:23 read(3, "search umops.us\nnameserver 1.1.1"..., 4096) = 160
21:08:23 read(3, "", 4096) = 0
21:08:23 close(3) = 0
21:08:23 munmap(0x7f64d6e77000, 4096) = 0
21:08:23 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
21:08:23 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
21:08:23 close(3) = 0
21:08:23 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
21:08:23 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
21:08:23 close(3) = 0
21:08:23 open("/etc/nsswitch.conf", O_RDONLY) = 3
21:08:23 fstat(3, {st_mode=S_IFREG|0644, st_size=1688, ...}) = 0
21:08:23 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f64d6e77000
21:08:23 read(3, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1688
21:08:23 read(3, "", 4096) = 0
21:08:23 close(3) = 0
21:08:23 munmap(0x7f64d6e77000, 4096) = 0
21:08:23 open("/etc/ld.so.cache", O_RDONLY) = 3
21:08:23 fstat(3, {st_mode=S_IFREG|0644, st_size=68446, ...}) = 0
21:08:23 mmap(NULL, 68446, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f64d6e67000
21:08:23 close(3) = 0
21:08:23 open("/lib64/libnss_files.so.2", O_RDONLY) = 3
21:08:23 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360!\0\0\0\0\0\0"..., 832) = 832
21:08:23 fstat(3, {st_mode=S_IFREG|0755, st_size=65928, ...}) = 0
21:08:23 mmap(NULL, 2151824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f64d05e8000
21:08:23 mprotect(0x7f64d05f4000, 2097152, PROT_NONE) = 0
21:08:23 mmap(0x7f64d07f4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f64d07f4000
21:08:23 close(3) = 0
21:08:23 mprotect(0x7f64d07f4000, 4096, PROT_READ) = 0
21:08:23 munmap(0x7f64d6e67000, 68446) = 0
21:08:23 open("/etc/host.conf", O_RDONLY) = 3
21:08:23 fstat(3, {st_mode=S_IFREG|0644, st_size=9, ...}) = 0
21:08:23 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f64d6e77000
21:08:23 read(3, "multi on\n", 4096) = 9
21:08:23 read(3, "", 4096) = 0
21:08:23 close(3) = 0
21:08:23 munmap(0x7f64d6e77000, 4096) = 0
21:08:23 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3
21:08:23 fcntl(3, F_GETFD) = 0x1 (flags FD_CLOEXEC)
21:08:23 fstat(3, {st_mode=S_IFREG|0644, st_size=98, ...}) = 0
21:08:23 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f64d6e77000
21:08:23 read(3, "127.0.0.1 \t\tlocalhost.localdom"..., 4096) = 98
21:08:23 read(3, "", 4096) = 0
21:08:23 close(3) = 0
21:08:23 munmap(0x7f64d6e77000, 4096) = 0
21:08:23 open("/etc/ld.so.cache", O_RDONLY) = 3
21:08:23 fstat(3, {st_mode=S_IFREG|0644, st_size=68446, ...}) = 0
21:08:23 mmap(NULL, 68446, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f64d6e67000
21:08:23 close(3) = 0
21:08:23 open("/lib64/libnss_dns.so.2", O_RDONLY) = 3
21:08:23 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\20\0\0\0\0\0\0"..., 832) = 832
21:08:23 fstat(3, {st_mode=S_IFREG|0755, st_size=27424, ...}) = 0
21:08:23 mmap(NULL, 2117880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f64d03e2000
21:08:23 mprotect(0x7f64d03e7000, 2093056, PROT_NONE) = 0
21:08:23 mmap(0x7f64d05e6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f64d05e6000
21:08:23 close(3) = 0
21:08:23 open("/lib64/libresolv.so.2", O_RDONLY) = 3
21:08:23 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\00009\20096\0\0\0"..., 832) = 832
21:08:23 fstat(3, {st_mode=S_IFREG|0755, st_size=113952, ...}) = 0
21:08:23 mmap(NULL, 2202248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f64d01c8000
21:08:23 mprotect(0x7f64d01de000, 2097152, PROT_NONE) = 0
21:08:23 mmap(0x7f64d03de000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f64d03de000
21:08:23 mmap(0x7f64d03e0000, 6792, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f64d03e0000
21:08:23 close(3) = 0
21:08:23 mprotect(0x7f64d03de000, 4096, PROT_READ) = 0
21:08:23 mprotect(0x7f64d05e6000, 4096, PROT_READ) = 0
21:08:23 munmap(0x7f64d6e67000, 68446) = 0
21:08:23 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
21:08:23 connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("1.1.1.1")}, 16) = 0
21:08:23 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
21:08:23 sendto(3, "\220z\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:08:23 poll([{fd=3, events=POLLIN}], 1, 5000) = 0 (Timeout)
21:08:28 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 4
21:08:28 connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("2.2.2.2")}, 16) = 0
21:08:28 poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
21:08:28 sendto(4, "\220z\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:08:28 poll([{fd=4, events=POLLIN}], 1, 3000) = 0 (Timeout)
21:08:31 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 5
21:08:31 connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("3.3.3.3")}, 16) = 0
21:08:31 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
21:08:31 sendto(5, "\220z\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:08:31 poll([{fd=5, events=POLLIN}], 1, 6000) = 0 (Timeout)
21:08:37 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
21:08:37 sendto(3, "\220z\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:08:37 poll([{fd=3, events=POLLIN}], 1, 5000) = 0 (Timeout)
21:08:42 poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
21:08:42 sendto(4, "\220z\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:08:42 poll([{fd=4, events=POLLIN}], 1, 3000) = 0 (Timeout)
21:08:45 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
21:08:45 sendto(5, "\220z\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:08:45 poll([{fd=5, events=POLLIN}], 1, 6000) = 0 (Timeout)
21:08:51 close(3) = 0
21:08:51 close(4) = 0
21:08:51 close(5) = 0
21:08:51 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
21:08:51 connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("1.1.1.1")}, 16) = 0
21:08:51 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
21:08:51 sendto(3, "\257a\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:08:51 poll([{fd=3, events=POLLIN}], 1, 5000) = 0 (Timeout)
21:08:56 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 4
21:08:56 connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("2.2.2.2")}, 16) = 0
21:08:56 poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
21:08:56 sendto(4, "\257a\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:08:56 poll([{fd=4, events=POLLIN}], 1, 3000) = 0 (Timeout)
21:08:59 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 5
21:08:59 connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("3.3.3.3")}, 16) = 0
21:08:59 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
21:08:59 sendto(5, "\257a\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:08:59 poll([{fd=5, events=POLLIN}], 1, 6000) = 0 (Timeout)
21:09:05 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
21:09:05 sendto(3, "\257a\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:09:05 poll([{fd=3, events=POLLIN}], 1, 5000) = 0 (Timeout)
21:09:10 poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
21:09:10 sendto(4, "\257a\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:09:10 poll([{fd=4, events=POLLIN}], 1, 3000) = 0 (Timeout)
21:09:13 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
21:09:13 sendto(5, "\257a\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:09:13 poll([{fd=5, events=POLLIN}], 1, 6000) = 0 (Timeout)
21:09:19 close(3) = 0
21:09:19 close(4) = 0
21:09:19 close(5) = 0
21:09:19 write(2, "ping: unknown host baidu.com\n", 29ping: unknown host baidu.com
) = 29
21:09:19 exit_group(2) = ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment