Hisayoshi Kato's weblog at Sun Solution Center
Solaris 10 8/07 DTrace update
最近の話題というと、Solaris 10 8/07 になりましたね。で、隠れたところでDTraceもupdateしました。
具体的にどんなところがupdateされたかというと。。
- DTrace version up(1.1 -> 1.3)
- PostgreSQL DTrace Probes
- Java DTrace APIの追加
- Solaris 10 11/06
| [root@sadmin.jp.iforce.net]# cat /etc/release Solaris 10 11/06 s10x_u3wos_10 X86 Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 14 November 2006 [root@sadmin.jp.iforce.net]# dtrace -V dtrace: Sun D 1.1 |
- Solaris 10 8/07
|
[root@ezo01.jp.iforce.net]# cat /etc/release |
で、どんなことができるようになったの??といわれると、libdtrace dt_open.c
(srcは、nevadaですが。。)、_dtrace_versions[]という構造体の中の値に、
DT_VERS_1_3, /* D API 1.3 Solaris Express 10/06 */ |
Solaris 10 8/07からPostgreSQL for Solarisが入りましたがそれを使っての例題です。 PostgreSQL pgbenchをかけながら、下記のようなスクリプトを書くと、syscall writeを発生させている PostgreSQLの関数のトレースができます。
[root@ezo01.jp.iforce.net]# dtrace -n 'syscall::write:entry{@[ufunc(ucaller),pid,execname,curpsinfo->pr_psargs]=count();}'
dtrace: description 'syscall::write:entry' matched 1 probe
^C
libc.so.1`_fflush_u 2637 postgres /usr/postgres/8.2/bin/postgres -D /export/home/kato/pgdata 1
tcsh`flush 7123 tcsh -tcsh 1
libc.so.1`_ndoprnt 7129 dtrace dtrace -n syscall::write:entry{@[ufunc(ucaller),pid,execname,curpsinfo->pr_psar 1
libc.so.1`_fflush_u 7131 postgres /usr/postgres/8.2/bin/postgres -D /export/home/kato/pgdata 1
sshd`packet_write_poll 2995 sshd /usr/lib/ssh/sshd 3
libc.so.1`_ndoprnt 7013 test ./test 3
libc.so.1`_dowrite 7130 pgbench pgbench -i test 5
libproc.so.1`Psetflags 7129 dtrace dtrace -n syscall::write:entry{@[ufunc(ucaller),pid,execname,curpsinfo->pr_psar 7
libproc.so.1`Punsetflags 7129 dtrace dtrace -n syscall::write:entry{@[ufunc(ucaller),pid,execname,curpsinfo->pr_psar 7
libc.so.1`_fwrite_unlocked 7131 postgres /usr/postgres/8.2/bin/postgres -D /export/home/kato/pgdata 7
postgres`XLogWrite 7131 postgres /usr/postgres/8.2/bin/postgres -D /export/home/kato/pgdata 128
postgres`FileWrite 7131 postgres /usr/postgres/8.2/bin/postgres -D /export/home/kato/pgdata 407
|
これは、何をやっているかというと、syscall writeの呼び出しもとの関数を追跡することができます。 また、アプリケーションがどの関数から、syscallを呼んでいるかを理解することができます。 他にprobeポイントはたくさんあるので、是非一度試してみてください。
Solaris 10 U4のdtrace updateのマニュアルは?
っていう質問がきて、戸惑ったりしたのですが、できれば、不親切ですが、src読むとか。。 っていう答えがてっとりばやかったかもしれませんね。一応、外国の方もみていることを知らずにいたので。。
Hello ,
Thank you for reading my blog entry. But I suggest that you can check DTrace change log or Solaris Internal wiki first. If I have the incorrect contents in my blog, plaese point to me.
Regards
katohisa
Posted at 05:22PM Sep 19, 2007 by katohisa in DTrace | Comments[0]
Wednesday Sep 19, 2007





