このドキュメントで説明するソフトウェアは、Extended SupportまたはSustaining Supportのいずれかにあります。 詳細は、https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdfを参照してください。
Oracleでは、このドキュメントに記載されているソフトウェアをできるだけ早くアップグレードすることをお薦めします。
スレッド固有変数は、システムでのスレッド実行のスコープ内で定義されます。 変数がスレッド固有であることを示すには、次の例に示すとおり、self->
という接頭辞を付けます。
#pragma D option quiet syscall::read:entry { self->t = timestamp; /* Initialize a thread-local variable */ } syscall::read:return /self->t != 0/ { printf("%s (pid:tid=%d:%d) spent %d microseconds in read()\n", execname, pid, tid, ((timestamp - self->t)/1000)); /* Divide by 1000 -> microseconds */ self->t = 0; /* Reset the variable */ }
このDプログラム(dtrace.d
)は、プロセスによってread()
システム・コールが起動されるたびに、コマンド名、プロセスID、スレッドIDおよび経過時間(マイクロ秒)を表示します。
# dtrace -s readtrace.d
nome-terminal (pid:tid=2774:2774) spent 27 microseconds in read()
gnome-terminal (pid:tid=2774:2774) spent 16 microseconds in read()
hald-addon-inpu (pid:tid=1662:1662) spent 26 microseconds in read()
hald-addon-inpu (pid:tid=1662:1662) spent 17 microseconds in read()
Xorg (pid:tid=2046:2046) spent 18 microseconds in read()
...