linux's strace command monitoring system function calls (syscall) within a certain period of time or longer

linux's strace command monitoring system function calls (syscall) within a certain period of time or longer

strace monitoring system calls (call monitoring system within a certain time series syscall functions that the program calls for the user to bridge the space kernel space program, the specific program execution and hardware kernel space communications, such as drivers execute in kernel space ) call, including the number of calls, time consuming, start monitoring from the open end command ends the monitoring, output monitoring the situation this time of
the case:
[root @ localhost ~] # # strace -c -f -p 16745 press ctry + c to stop the end of the monitoring and output monitoring results for the specified -p process to be monitored, in this case writev frequently used functions, the most time-consuming, this function is to write data in the buffer memory to a file that is written to disk. Visible input / output operation takes a lot of time and the like.
the strace: 16745 Process attached
the strace: Process 18 611 attached
the strace: 18615 Process attached
the strace: Process 18 616 attached
the strace: Process 18 619 attached
the strace: 18620 Process attached
the strace: Process 19296 detached
the strace: Process 19298 detached
% Time seconds The usecs / Call Calls the syscall errors


55.11 3.121153 1471 2122 writev
14.76 0.835644 265 3151 1093 shutdown
11.17 0.632302 9 73337 484 stat
2.15 0.121973 19 6438 write
1.69 0.095901 13 7529 close
1.67 0.094722 44 2158 2158 connect
1.66 0.094130 26 3655 munmap
1.22 0.069288 32 2184 socket
1.16 0.065843 14 4872 getdents
1.08 0.061390 14 4390 1029 read
1.03 0.058192 53 1093 accept4
0.84 0.047575 6 7536 brk
0.75 0.042623 16 2592 968 open
0.68 0.038654 6 6502 fcntl
0.61 0.034264 14 2436 openat
0.60 0.034164 131 261 wait4
0.48 0.027432 6 4719 lseek
0.41 0.023203 6 4116 setitimer
0.41 0.023114 6 3561 fstat
0.41 0.022979 13 1735 mmap
0.32 0.018251 9 2058 chdir
0.26 0.014595 56 261 100 select
0.23 0.013218 12 1093 getsockname
0.22 0.012641 11 1129 poll
0.19 0.010599 6 1641 rt_sigaction
0.16 0.008991 9 1029 getcwd
0.14 0.008027 7 1093 times
0.11 0.006269 14 464 lstat
0.10 0.005682 6 1029 rt_sigprocmask
0.08 0.004507 4 1029 uname
0.05 0.003016 12 242 semop
0.03 0.001646 14 121 setgroups
0.03 0.001563 12 126 getsockopt
0.02 0.001333 11 121 epoll_ctl
0.02 0.001302 50 26 sendmsg
0.02 0.001302 11 121 epoll_create1
0.02 0.001296 11 121 setuid
0.02 0.001105 4 268 geteuid
0.02 0.000982 8 121 clone
0.02 0.000883 7 121 setgid
0.01 0.000725 14 52 26 setsockopt
0.00 0.000188 7 26 getgid
0.00 0.000175 7 26 getegid
0.00 0.000169 7 26 getuid
0.00 0.000089 1 121 set_robust_list


100.00 5.663100 156852 5858 total

Published 31 original articles · won praise 0 · Views 2816

Guess you like

Origin blog.csdn.net/yaqiang2017/article/details/104148384