Show Table of Contents
23.5.3. モジュールについてより詳細な出力を取得
OProfile はシステム全体に於いてカーネルとマシン上で実行中のユーザースペースコードのデータを収集します。しかし、モジュールがカーネルにロードされるとカーネルモジュールの発生源に関する情報は消失します。モジュールはブート時に
initrd ファイルから来たか、各種カーネルモジュールのあるディレクトリから来たか、またはローカルで作成されたカーネルモジュールから来たのかも知れません。その結果、OProfile が1つのモジュールのサンプルを記録する際に実行可能ファイルのモジュール群サンプルを root ディレクトリ内に一覧表示しますが、この場所はモジュールの実際のコードがある場所だとは断定できません。分析ツールが実行可能ファイルを確実に取得するようにいくつかの手順を実行する必要があります。
モジュールのアクションについてより明確な眺望を得るには、モジュールを "unstripped" 状態にする (即ち、カスタムビルドからインスト-ルした状態にする) か、またはカーネル用に debuginfo パッケージをインスト-ルする必要があります。
実行中のカーネルを判定するには、
uname -a コマンドを使用します。そして適切な debuginfo パッケージを入手してそれをマシンにインスト-ルします。
それから以前の実行によるサンプルを排除するために、以下のコマンドを入力します:
~]# opcontrol --reset
例えば Westmere プロセッサを持つマシンで監視プロセスを開始するには、以下のコマンドを実行します:
~]# opcontrol --setup --vmlinux=/usr/lib/debug/lib/modules/`uname -r`/vmlinux --event=CPU_CLK_UNHALTED:500000
その後、例えば ext4 モジュール用の詳細情報は以下のようにして取得できます:
~]# opreport /ext4 -l --image-path /lib/modules/`uname -r`/kernel
CPU: Intel Westmere microarchitecture, speed 2.667e+06 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 500000
warning: could not check that the binary file /lib/modules/2.6.32-191.el6.x86_64/kernel/fs/ext4/ext4.ko has not been modified since the profile was taken. Results may be inaccurate.
samples % symbol name
1622 9.8381 ext4_iget
1591 9.6500 ext4_find_entry
1231 7.4665 __ext4_get_inode_loc
783 4.7492 ext4_ext_get_blocks
752 4.5612 ext4_check_dir_entry
644 3.9061 ext4_mark_iloc_dirty
583 3.5361 ext4_get_blocks
583 3.5361 ext4_xattr_get
479 2.9053 ext4_htree_store_dirent
469 2.8447 ext4_get_group_desc
414 2.5111 ext4_dx_find_entry
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.