ナビゲーションリンクをスキップ | |
印刷ビューの終了 | |
Oracle Solaris Studio 12.3: パフォーマンスアナライザ Oracle Solaris Studio 12.3 Information Library (日本語) |
cprepend function-name [N | ADDR]
cappend function-name [N | ADDR]
source|src { filename | function_name } [ N]
disasm|dis { filename | function_name } [ N]
ハードウェアカウンタデータ領域およびメモリーオブジェクトリストを制御するコマンド
mobj_define mobj_type index_exp
indxobj_define indxobj_type index_exp
実験、標本、スレッド、および LWP を一覧表示するコマンド
フィルタリング用の標本、スレッド、LWP、および CPU の選択
object_show object1,object2,...
object_hide object1,object2,...
object_api object1,object2,...
object_select object1,object2,...
name { long | short } [ :{ shared_object_name | no_shared_object_name } ]
viewmode { user| expert | machine }
en_desc { on | off | =regexp }
ここでは、er_print コマンドの使用例を示します。
例 5-8 関数にかかる時間の概要を表示
er_print -functions test.1.er
例 5-9 呼び出し元 - 呼び出し先関係を表示
er_print -callers-callees test.1.er
例 5-10 ホットなソース行を表示
ソース行情報は、コードのコンパイルとリンクで -g が指定されていることを前提にしています。Fortran の関数とルーチンの場合は、関数名の最後に下線を付けてください。関数名のあとの 1 は、myfunction の複数インスタンスを区別するためのものです。
er_print -source myfunction 1 test.1.er
例 5-11 ユーザー関数スタックから myfunc という名前の関数をフィルタリング
er_print -filters 'FNAME("myfunc") SOME IN USTACK' -functions test.1.er
例 5-12 gprof に似た出力を生成
次の例は、実験から gprof 形式に似た一覧を生成します。出力は er_print.out というファイルで、先頭の 100 個の関数と、関数ごとの属性ユーザー時間でソートされた呼び出し元 - 呼び出し先データの一覧です。
er_print -outfile er_print.out -metrics e.%user -sort e.user \ -limit 100 -func -callers-callees test.1.er
この例のコマンドを分解して、次の独立した 2 つのコマンドにすることもできます。ただし、大規模な実験またはアプリケーションでは、er_print の呼び出しのたびに、かなりの時間がかかることがありますので注意してください。
er_print -metrics e.%user -limit 100 -functions test.1.er
er_print -metrics e.%user -callers-callees test.1.er
例 5-13 コンパイラのコメントのみを表示
このコマンドを使用するためにプログラムを実行する必要はありません。
er_src -myfile.o
例 5-14 時計時間プロファイリングを使用して、関数および呼び出し元と呼び出し先を一覧表示
er_print -metrics ei.%wall -functions test.1.er
er_print -metrics aei.%wall -callers-callees test.1.er
例 5-15 er_print コマンドを含むスクリプトを実行
er_print -script myscriptfile test.1.er
myscriptfile スクリプトに er_print コマンドが含まれます。スクリプトファイルの例を次に示します。
## myscriptfile ## Send script output to standard output outfile - ## Display descriptive information about the experiments header ## Write out the sample data for all experiments overview ## Write out execution statistics, aggregated over ## the current sample set for all experiments statistics ## List functions functions ## Display status and names of available load objects object_list ## Write out annotated disassembly code for systime, ## to file disasm.out outfile disasm.out disasm systime ## Write out annotated source code for synprog.c ## to file source.out outfile source.out source synprog.c ## Terminate processing of the script quit