如何在Mac OS X Leopard上的dtrace中使用热点探针?

时间:2021-12-24 07:15:18

My Leopard system has dtrace built in. I also have Java 6 installed, using the Apple-provided installer:

我的Leopard系统内置了dtrace。我还安装了Java 6,使用Apple提供的安装程序:

$ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)

Nevertheless, dtrace shows no hotspot probes when listing probes:

然而,dtrace在列出探测时没有显示热点探测:

$ sudo dtrace -l | grep spot
$

Can anybody tell me how to enable dtrace probes for Java (supposedly they ship with Java 6) in Leopard?

任何人都可以告诉我如何在Leopard中为Java启用dtrace探针(据说它们随Java 6一起提供)?

3 个解决方案

#1


" Hmm, interesting. I am running the same configurations but for me the probes do not show up. What command line did you use? Also "sudo dtrace -l | grep spot" ? "

“嗯,有趣。我正在运行相同的配置,但对我来说,探针没有出现。你使用了什么命令行?还有”sudo dtrace -l | grep spot“?”

  • Just one cross check. You should have a running java application at the time when you issue "sudo dtrace -l | grep spot". Only then the probes will be listed.
  • 只需一次交叉检查。当你发出“sudo dtrace -l | grep spot”时,你应该有一个正在运行的java应用程序。只有这样才会列出探针。

#2


I'm running Snow Leopard with Java 1.6, and I can see the hotspot probes:

我正在使用Java 1.6运行Snow Leopard,我可以看到热点探测器:

...

43223 hotspot_jni3644   libclient.dylib                   jni_AllocObject AllocObject-entry
43224 hotspot_jni3644   libclient.dylib                   jni_AllocObject AllocObject-return
43225 hotspot_jni3644   libclient.dylib           jni_AttachCurrentThread AttachCurrentThread-entry
43226 hotspot_jni3644   libclient.dylib           jni_AttachCurrentThread AttachCurrentThread-return
43227 hotspot_jni3644   libclient.dylib   jni_AttachCurrentThreadAsDaemon AttachCurrentThreadAsDaemon-entry
43228 hotspot_jni3644   libclient.dylib   jni_AttachCurrentThreadAsDaemon AttachCurrentThreadAsDaemon-return
43229 hotspot_jni3644   libclient.dylib             jni_CallBooleanMethod CallBooleanMethod-entry
43230 hotspot_jni3644   libclient.dylib             jni_CallBooleanMethod CallBooleanMethod-return

...

#3


Are you sure this applies to the Apple JVM as well? While the DTrace hooks are mentioned in the document about JDK 6, you can also find on Non-standard Java HotSpot VM Options (emphasis added):

您确定这也适用于Apple JVM吗?虽然有关JDK 6的文档中提到了DTrace挂钩,但您也可以在非标准Java HotSpot VM选项中找到(重点已添加):

-XX:-ExtendedDTraceProbes Enable performance-impacting dtrace probes.
(Introduced in 6. Relevant to Solaris only.)

-XX:-ExtendedDTraceProbes启用影响性能的dtrace探测器。 (仅在Solaris中引入。仅与Solaris相关。)

Not a good sign if this is platform specific. AFAIK Apple builds its own custom-made JVM.

如果这是特定于平台的,则不是一个好兆头。 AFAIK Apple构建自己的定制JVM。

#1


" Hmm, interesting. I am running the same configurations but for me the probes do not show up. What command line did you use? Also "sudo dtrace -l | grep spot" ? "

“嗯,有趣。我正在运行相同的配置,但对我来说,探针没有出现。你使用了什么命令行?还有”sudo dtrace -l | grep spot“?”

  • Just one cross check. You should have a running java application at the time when you issue "sudo dtrace -l | grep spot". Only then the probes will be listed.
  • 只需一次交叉检查。当你发出“sudo dtrace -l | grep spot”时,你应该有一个正在运行的java应用程序。只有这样才会列出探针。

#2


I'm running Snow Leopard with Java 1.6, and I can see the hotspot probes:

我正在使用Java 1.6运行Snow Leopard,我可以看到热点探测器:

...

43223 hotspot_jni3644   libclient.dylib                   jni_AllocObject AllocObject-entry
43224 hotspot_jni3644   libclient.dylib                   jni_AllocObject AllocObject-return
43225 hotspot_jni3644   libclient.dylib           jni_AttachCurrentThread AttachCurrentThread-entry
43226 hotspot_jni3644   libclient.dylib           jni_AttachCurrentThread AttachCurrentThread-return
43227 hotspot_jni3644   libclient.dylib   jni_AttachCurrentThreadAsDaemon AttachCurrentThreadAsDaemon-entry
43228 hotspot_jni3644   libclient.dylib   jni_AttachCurrentThreadAsDaemon AttachCurrentThreadAsDaemon-return
43229 hotspot_jni3644   libclient.dylib             jni_CallBooleanMethod CallBooleanMethod-entry
43230 hotspot_jni3644   libclient.dylib             jni_CallBooleanMethod CallBooleanMethod-return

...

#3


Are you sure this applies to the Apple JVM as well? While the DTrace hooks are mentioned in the document about JDK 6, you can also find on Non-standard Java HotSpot VM Options (emphasis added):

您确定这也适用于Apple JVM吗?虽然有关JDK 6的文档中提到了DTrace挂钩,但您也可以在非标准Java HotSpot VM选项中找到(重点已添加):

-XX:-ExtendedDTraceProbes Enable performance-impacting dtrace probes.
(Introduced in 6. Relevant to Solaris only.)

-XX:-ExtendedDTraceProbes启用影响性能的dtrace探测器。 (仅在Solaris中引入。仅与Solaris相关。)

Not a good sign if this is platform specific. AFAIK Apple builds its own custom-made JVM.

如果这是特定于平台的,则不是一个好兆头。 AFAIK Apple构建自己的定制JVM。