43.5.3. モジュールの詳細な出力の取得
OProfile は、マシンで実行しているカーネルおよびユーザー空間コードに関するシステム全体のデータを収集します。ただし、モジュールがカーネルに読み込まれると、カーネルモジュールの起点に関する情報が失われます。モジュールは、起動時に initrd ファイル、さまざまなカーネルモジュールを持つ ディレクトリー、またはローカルに作成されたカーネルモジュールから取得できます。その結果、OProfile がモジュールのサンプルを記録すると、root ディレクトリー内の実行ファイルのモジュールのサンプルが一覧表示されますが、モジュールの実際のコードが含まれる場所である訳ではありません。分析ツールが実行ファイルを取得できるようにするには、いくつかの手順を実行する必要があります。
たとえば、AMD64 マシンでは、サンプリングは Data cache access および Data cache misses を記録するよう設定され、ext3 モジュールのデータを表示することを前提とします。
~]$ opreport /ext3
CPU: AMD64 processors, speed 797.948 MHz (estimated)
Counted DATA_CACHE_ACCESSES events (Data cache accesses) with a unit mask of 0x00 (No unit mask) count 500000
Counted DATA_CACHE_MISSES events (Data cache misses) with a unit mask of 0x00 (No unit mask) count 500000
DATA_CACHE_ACC...|DATA_CACHE_MIS...|
samples| %| samples| %|
------------------------------------
148721 100.000 1493 100.000 ext3
モジュールのアクションの詳細なビューを取得するには、モジュールをトリップ解除(例:カスタムビルドからインストール)するか、カーネルに debuginfo RPM をインストールする必要があります。
実行しているカーネル "uname -a" を見つけ、適切な debuginfo rpm を取得し、マシンにインストールします。
次に、oprofile が正しい場所でモジュールのコードを見つけるようにシンボリックリンクを作成します。
~]# ln -s /lib/modules/`uname -r`/kernel/fs/ext3/ext3.ko /ext3
次に、以下の方法で詳細情報を取得できます。
~]# opreport image:/ext3 -l|more
warning: could not check that the binary file /ext3 has not been modified since the profile was taken. Results may be inaccurate.
CPU: AMD64 processors, speed 797.948 MHz (estimated)
Counted DATA_CACHE_ACCESSES events (Data cache accesses) with a unit mask of 0x00 (No unit mask) count 500000
Counted DATA_CACHE_MISSES events (Data cache misses) with a unit mask of 0x00 (No unit mask) count 500000
samples % samples % symbol name
16728 11.2479 7 0.4689 ext3_group_sparse
16454 11.0637 4 0.2679 ext3_count_free_blocks
14583 9.8056 51 3.4159 ext3_fill_super
8281 5.5681 129 8.6403 ext3_ioctl
7810 5.2514 62 4.1527 ext3_write_info
7286 4.8991 67 4.4876 ext3_ordered_writepage
6509 4.3767 130 8.7073 ext3_new_inode
6378 4.2886 156 10.4488 ext3_new_block
5932 3.9887 87 5.8272 ext3_xattr_block_list
...