9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

linux システムコール straceで確認、調査

Last updated at Posted at 2014-07-04

straceでシステムコールトレース

strace -p 12345 -o /tmp/strace.txt

straceでシステムコールの統計情報取得 Ctrl + cで止める

strace -p 12345 -c

下記みたいのがでる。

text
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 93.94    0.827378        8530        97           clone
  5.00    0.044060         454        97           wait4
  0.62    0.005423           3      2161        99 read
  0.15    0.001279           1      1769           poll
  0.07    0.000612           0     18949      2648 stat
  0.05    0.000462           0      5082           munmap
  0.04    0.000387           0      8543           getcwd
  0.03    0.000269           0      1548           write
  0.02    0.000205           0      5483       204 open
  0.02    0.000174           0      5695           close

値がおかしそうなsyscallのものを出力したファイルで確認する

9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?