10.2.4. サマリーの表示

各システムコールの実行に必要な時間と、これらのシステムコールを実行した回数の概要を表示するには、-c コマンドラインオプションを指定して ltrace ユーティリティーを実行します。

$ scl enable devtoolset-10 'ltrace -c program argument...'

例10.4 サマリーの表示

lsblk コマンドについて考えてみましょう。このプログラムで ltrace ユーティリティーを実行し、トレースの概要を表示します。

$ scl enable devtoolset-10 'ltrace -c lsblk > /dev/null'
% time     seconds  usecs/call     calls      function
------ ----------- ----------- --------- --------------------
 53.60    0.261644      261644         1 __libc_start_main
  4.48    0.021848          58       374 mbrtowc
  4.41    0.021524          57       374 wcwidth
  4.39    0.021409          57       374 __ctype_get_mb_cur_max
  4.38    0.021359          57       374 iswprint
  4.06    0.019838          74       266 readdir64
  3.21    0.015652          69       224 strlen
...
------ ----------- ----------- --------- --------------------
100.00    0.488135                  3482 total