1. 程式人生 > >如何使用strace+pstack利器分析程式效能

如何使用strace+pstack利器分析程式效能

14:46:39.741366 select(8, [3 4], NULL, NULL, {1, 0}) = 1 (in [4], left {0, 1648}) <0.998415> 14:46:40.739965 recvfrom(4, "hello", 6, 0, NULL, NULL) = 5 <0.000068> 14:46:40.740241 write(1, "hello\n", 6) = 6 <0.000066> 14:46:40.740414 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 <0.000046> 14:46:40.740565
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0 <0.000048> 14:46:40.740715 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 <0.000046> 14:46:40.740853 nanosleep({1, 0}, {1, 0}) = 0 <1.000276> 14:46:41.741284 sendto(4, "hello\0", 6, 0, NULL, 0) = 6 <0.000111>