実験結果を収集する前に、データの競合検出用アプリケーションを計測するためのヒント
次に示すように、データの競合の検出用にバイナリが計測されていない場合、collect -r race コマンドは、警告を発行します。
% collect -r race a.out WARNING: Target `a.out' is not instrumented for datarace detection; reported datarace data may be misleading
nm コマンドを使用して、tha ルーチンの呼び出しを検索することにより、データの競合の検出用にバイナリが計測されているかどうかを判断できます。名前が __tha_ で始まるルーチンが表示されたら、バイナリは計測されています。例出力は次のとおりです。
ソースレベルの計測:
% cc -xopenmp -g -xinstrument=datarace source.c % nm a.out | grep __tha_ [71] | 135408| 0|FUNC |GLOB |0 |UNDEF |__tha_get_stack_id [53] | 135468| 0|FUNC |GLOB |0 |UNDEF |__tha_src_read_w_frame [61] | 135444| 0|FUNC |GLOB |0 |UNDEF |__tha_src_write_w_frame
バイナリレベルの計測:
% cc -xopenmp -g source.c % discover -i datarace -o a.out.i a.out % nm a.out.i | grep __tha_ [88] | 0| 0|NOTY |GLOB |0 |UNDEF |__tha_read_w_pc_frame [49] | 0| 0|NOTY |GLOB |0 |UNDEF |__tha_write_w_pc_frame