netbeans で再度プロファイリングしてみたんだけど、相変わらず、うまくできなかった。ログを見てみたものの、以下のような警告はあるけど、エラーはない感じ。
Profiler Warning: Failed to instrument creation of class org/apache/jetspeed/cluster/NodeInformationImpl in method sun/reflect/GeneratedSerializationConstructorAccessor16.newInstance *** Profiler warning (Tue Mar 11 16:15:16 JST 2008): class $Proxy11, ldr = 0 not found anywhere *** Profiler warning (Tue Mar 11 16:15:16 JST 2008): class $Proxy12, ldr = 0 not found anywhere *** Profiler warning (Tue Mar 11 16:15:16 JST 2008): class $Proxy13, ldr = 0 not found anywhere
どうも、サーブレットの初期化された後に、どこかでとまっているような感じなのだよね。
というわけで、あきらめて、素直に Eclipse の方で試すことにした。やり方としては、Agent Controller を起動して、対象のアプリ(今回はTomcatだけど)にオプション付けて起動という感じ。Agent Controller は http://www.eclipse.org/tptp/home/downloads/?ver=4.4.1 からダウンロードできる。
$ mkdir agntctrl.linux_em64t-TPTP-4.4.0 $ cd agntctrl.linux_em64t-TPTP-4.4.0 $ unzip /tmp/agntctrl.linux_em64t-TPTP-4.4.0.zip $ cd bin $ ./SetConfig.sh
適当に値を設定する。bin で実行しないとエラーになる。あとは
$ ./ACStart.sh
でAgent Controllerを起動しておく。そして、あとは Tomcat をオプションと環境変数を設定して、起動する。
$ export TPTP_AC_HOME=/home/taro/eclipse.org/agntctrl.linux_em64t-TPTP-4.4.0 $ export JAVA_PROFILER_HOME=$TPTP_AC_HOME/plugins/org.eclipse.tptp.javaprofiler $ LD_LIBRARY_PATH=$JAVA_PROFILER_HOME:$TPTP_AC_HOME/lib CATALINA_OPTS="$CATALINA_OPTS -agentlib:JPIBootLoader=JPIAgent;CGProf" ./bin/catalina.sh start
で完了。あとは、Eclipse の Profile から Attach してやれば、いろいろと見られそう。
問題に遭遇したときには、
$ export MARTINI_LOGGER_DIRECTORY=/tmp/tptp $ export MARTINI_LOGGER_LOG_LEVEL=5
とかやって、Tomcat を起動してみて、ログを確認(私は問題に遭遇したけど、ログみたらすぐに原因が分かった)。