Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
strace -t ping baidu.com(options timeout:1)
$ strace -t ping baidu.com
21:25:06 execve("/bin/ping", ["ping", "baidu.com"], [/* 29 vars */]) = 0
21:25:06 brk(0) = 0x7fb70fcc2000
21:25:06 fcntl(0, F_GETFD) = 0
21:25:06 fcntl(1, F_GETFD) = 0
21:25:06 fcntl(2, F_GETFD) = 0
21:25:06 access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory)
21:25:06 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb70f5ec000
21:25:06 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
21:25:06 open("/etc/ld.so.cache", O_RDONLY) = 3
21:25:06 fstat(3, {st_mode=S_IFREG|0644, st_size=68446, ...}) = 0
21:25:06 mmap(NULL, 68446, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb70f5db000
21:25:06 close(3) = 0
21:25:06 open("/lib64/libidn.so.11", O_RDONLY) = 3
21:25:06 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:25:06 fstat(3, {st_mode=S_IFREG|0755, st_size=209088, ...}) = 0
21:25:06 mmap(NULL, 2301736, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb70f19c000
21:25:06 mprotect(0x7fb70f1ce000, 2093056, PROT_NONE) = 0
21:25:06 mmap(0x7fb70f3cd000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7fb70f3cd000
21:25:06 close(3) = 0
21:25:06 open("/lib64/libc.so.6", O_RDONLY) = 3
21:25:06 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:25:06 fstat(3, {st_mode=S_IFREG|0755, st_size=1979000, ...}) = 0
21:25:06 mmap(NULL, 3803304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb70edfb000
21:25:06 mprotect(0x7fb70ef92000, 2097152, PROT_NONE) = 0
21:25:06 mmap(0x7fb70f192000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x197000) = 0x7fb70f192000
21:25:06 mmap(0x7fb70f197000, 18600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb70f197000
21:25:06 close(3) = 0
21:25:06 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb70f5da000
21:25:06 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb70f5d9000
21:25:06 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb70f5d8000
21:25:06 arch_prctl(ARCH_SET_FS, 0x7fb70f5d9700) = 0
21:25:06 mprotect(0x7fb70f192000, 16384, PROT_READ) = 0
21:25:06 mprotect(0x7fb70f5ed000, 4096, PROT_READ) = 0
21:25:06 munmap(0x7fb70f5db000, 68446) = 0
21:25:06 brk(0) = 0x7fb70fcc2000
21:25:06 brk(0x7fb70fce3000) = 0x7fb70fce3000
21:25:06 open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
21:25:06 fstat(3, {st_mode=S_IFREG|0644, st_size=99158704, ...}) = 0
21:25:06 mmap(NULL, 99158704, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb708f6a000
21:25:06 close(3) = 0
21:25:06 socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = -1 EPERM (Operation not permitted)
21:25:06 getuid() = 500
21:25:06 setuid(500) = 0
21:25:06 getpid() = 194742
21:25:06 open("/etc/resolv.conf", O_RDONLY) = 3
21:25:06 fstat(3, {st_mode=S_IFREG|0644, st_size=178, ...}) = 0
21:25:06 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb70f5eb000
21:25:06 read(3, "search umops.us\nnameserver 1.1.1"..., 4096) = 178
21:25:06 read(3, "", 4096) = 0
21:25:06 close(3) = 0
21:25:06 munmap(0x7fb70f5eb000, 4096) = 0
21:25:06 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
21:25:06 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
21:25:06 close(3) = 0
21:25:06 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
21:25:06 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
21:25:06 close(3) = 0
21:25:06 open("/etc/nsswitch.conf", O_RDONLY) = 3
21:25:06 fstat(3, {st_mode=S_IFREG|0644, st_size=1688, ...}) = 0
21:25:06 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb70f5eb000
21:25:06 read(3, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1688
21:25:06 read(3, "", 4096) = 0
21:25:06 close(3) = 0
21:25:06 munmap(0x7fb70f5eb000, 4096) = 0
21:25:06 open("/etc/ld.so.cache", O_RDONLY) = 3
21:25:06 fstat(3, {st_mode=S_IFREG|0644, st_size=68446, ...}) = 0
21:25:06 mmap(NULL, 68446, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb70f5db000
21:25:06 close(3) = 0
21:25:06 open("/lib64/libnss_files.so.2", O_RDONLY) = 3
21:25:06 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:25:06 fstat(3, {st_mode=S_IFREG|0755, st_size=65928, ...}) = 0
21:25:06 mmap(NULL, 2151824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb708d5c000
21:25:06 mprotect(0x7fb708d68000, 2097152, PROT_NONE) = 0
21:25:06 mmap(0x7fb708f68000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7fb708f68000
21:25:06 close(3) = 0
21:25:06 mprotect(0x7fb708f68000, 4096, PROT_READ) = 0
21:25:06 munmap(0x7fb70f5db000, 68446) = 0
21:25:06 open("/etc/host.conf", O_RDONLY) = 3
21:25:06 fstat(3, {st_mode=S_IFREG|0644, st_size=9, ...}) = 0
21:25:06 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb70f5eb000
21:25:06 read(3, "multi on\n", 4096) = 9
21:25:06 read(3, "", 4096) = 0
21:25:06 close(3) = 0
21:25:06 munmap(0x7fb70f5eb000, 4096) = 0
21:25:06 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3
21:25:06 fcntl(3, F_GETFD) = 0x1 (flags FD_CLOEXEC)
21:25:06 fstat(3, {st_mode=S_IFREG|0644, st_size=98, ...}) = 0
21:25:06 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb70f5eb000
21:25:06 read(3, "127.0.0.1 \t\tlocalhost.localdom"..., 4096) = 98
21:25:06 read(3, "", 4096) = 0
21:25:06 close(3) = 0
21:25:06 munmap(0x7fb70f5eb000, 4096) = 0
21:25:06 open("/etc/ld.so.cache", O_RDONLY) = 3
21:25:06 fstat(3, {st_mode=S_IFREG|0644, st_size=68446, ...}) = 0
21:25:06 mmap(NULL, 68446, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb70f5db000
21:25:06 close(3) = 0
21:25:06 open("/lib64/libnss_dns.so.2", O_RDONLY) = 3
21:25:06 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:25:06 fstat(3, {st_mode=S_IFREG|0755, st_size=27424, ...}) = 0
21:25:06 mmap(NULL, 2117880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb708b56000
21:25:06 mprotect(0x7fb708b5b000, 2093056, PROT_NONE) = 0
21:25:06 mmap(0x7fb708d5a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7fb708d5a000
21:25:06 close(3) = 0
21:25:06 open("/lib64/libresolv.so.2", O_RDONLY) = 3
21:25:06 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:25:06 fstat(3, {st_mode=S_IFREG|0755, st_size=113952, ...}) = 0
21:25:06 mmap(NULL, 2202248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb70893c000
21:25:06 mprotect(0x7fb708952000, 2097152, PROT_NONE) = 0
21:25:06 mmap(0x7fb708b52000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7fb708b52000
21:25:06 mmap(0x7fb708b54000, 6792, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb708b54000
21:25:06 close(3) = 0
21:25:06 mprotect(0x7fb708b52000, 4096, PROT_READ) = 0
21:25:06 mprotect(0x7fb708d5a000, 4096, PROT_READ) = 0
21:25:06 munmap(0x7fb70f5db000, 68446) = 0
21:25:06 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
21:25:06 connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("1.1.1.1")}, 16) = 0
21:25:06 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
21:25:06 sendto(3, "\213\227\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:25:06 poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:07 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 4
21:25:07 connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("2.2.2.2")}, 16) = 0
21:25:07 poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
21:25:07 sendto(4, "\213\227\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:25:07 poll([{fd=4, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:08 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 5
21:25:08 connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("3.3.3.3")}, 16) = 0
21:25:08 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
21:25:08 sendto(5, "\213\227\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:25:08 poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:09 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
21:25:09 sendto(3, "\213\227\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:25:09 poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:10 poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
21:25:10 sendto(4, "\213\227\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:25:10 poll([{fd=4, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:11 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
21:25:11 sendto(5, "\213\227\1\0\0\1\0\0\0\0\0\0\5baidu\3com\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27
21:25:11 poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:12 close(3) = 0
21:25:12 close(4) = 0
21:25:12 close(5) = 0
21:25:12 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
21:25:12 connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("1.1.1.1")}, 16) = 0
21:25:12 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
21:25:12 sendto(3, "\3\335\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:25:12 poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:13 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 4
21:25:13 connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("2.2.2.2")}, 16) = 0
21:25:13 poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
21:25:13 sendto(4, "\3\335\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:25:13 poll([{fd=4, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:14 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 5
21:25:14 connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("3.3.3.3")}, 16) = 0
21:25:14 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
21:25:14 sendto(5, "\3\335\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:25:14 poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:15 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
21:25:15 sendto(3, "\3\335\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:25:15 poll([{fd=3, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:16 poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
21:25:16 sendto(4, "\3\335\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:25:16 poll([{fd=4, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:17 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
21:25:17 sendto(5, "\3\335\1\0\0\1\0\0\0\0\0\0\5baidu\3com\5umops\2us\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
21:25:17 poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout)
21:25:18 close(3) = 0
21:25:18 close(4) = 0
21:25:18 close(5) = 0
21:25:18 write(2, "ping: unknown host baidu.com\n", 29ping: unknown host baidu.com
) = 29
21:25:18 exit_group(2) = ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment