<?xml version="1.0" encoding="UTF-8"?>
<page>
  <created-at type="datetime">2008-11-23T20:00:03Z</created-at>
  <description>Reverted to revision #3</description>
  <id type="integer">517</id>
  <name>Home</name>
  <number type="integer">5</number>
  <person-id type="integer">10</person-id>
  <text>= DVM: VM agents for use with DTrace Wiki =

This is the same project that exists at [https://solaris10-dtrace-vm-agents.dev.java.net], however this site provides a mercurial repository of the source.

This project provides the source to agent libraries that run in the Virtual Machine for the Java(TM) platform that provide Solaris(tm) 10 Dynamic Tracing (DTrace) probes.

This source code can be used to create two native agent libraries that can be dynamically loaded into a VM (1.4.2 or 5.0) at VM startup. The agents are called dvmti (using JVM TI) and dvmpi (using JVMPI).  

These agent libraries utilize the VM tool or profiling interfaces to request various VM events and provide DTrace probes in the callback code for those events. These agent libraries are for use with Solaris 10 Dynamic Tracing (DTrace). Since the probes are actually in the agent libraries the VM is unchanged.

The dvmti agent utilizes JVM TI which only works with JDK version 5.0 and newer but provides the most detail in the DTrace probe arguments. The dvmpi agent utilizes JVM PI which will work with 1.4.2 and 5.0, but the JVM PI was always experimental and can be unreliable at times. The JVM PI will not be available in JDK 6.0. The JDK version 6 and newer actually provide DTrace probes (see [http://java.sun.com/javase/6/docs/technotes/guides/vm/dtrace.html] for more information).

All agent code has been written in the C programming language. Shared library names are libdvmpi.so and libdvmti.so. Usage:

    java -Xrundvm[tp]i[:options] ...

Where the options are:
* all
** same as: unloads,allocs,stats,methods
* help
** print help message
* unloads
** track class unloads
* allocs
** track object allocations and frees
* stats
** generate heap stats after each GC
* methods
** generate method entry exit events
* exclude=name
** exclude class names

The default is none of unloads, allocs, stats, or methods.

The dvmti agent will utilize BCI (Byte Code Instrumentation) where needed and will need a jar file called dvmti.jar, that should be located in the same directory as the shared library libdvmti.so. The dvmpi agent will utilize the slow object allocation path where needed. You will likely be unable to compare the two agents, they will behave slightly differently. The DTrace probes are:

  provider dvm {
    probe vm__init();
    probe vm__death();
    probe thread__start(char *thread_name);
    probe thread__end();
    probe class__load(char *class_name);
    probe class__unload(char *class_name);
    probe gc__start();
    probe gc__finish();
    probe gc__stats(long used_objects, long used_object_space);
    probe object__alloc(char *class_name, long size);
    probe object__free(char *class_name);
    probe monitor__contended__enter(char *thread_name);
    probe monitor__contended__entered(char *thread_name);
    probe monitor__wait(char *thread_name, long timeout);
    probe monitor__waited(char *thread_name, long timeout);
    probe method__entry(char *class_name, char *method_name, char *method_signature);
    probe method__return(char *class_name, char *method_name, char *method_signature);
  };
</text>
  <text-as-html>&lt;h1&gt;&lt;a name='DVM:_VM_agents_for_use_with_DTrace_Wiki'&gt;&lt;/a&gt; DVM: VM agents for use with DTrace Wiki &lt;/h1&gt;
&lt;p&gt;
This is the same project that exists at &lt;a class='external' href=&quot;https://solaris10-dtrace-vm-agents.dev.java.net&quot;&gt;https://solaris10-dtrace-vm-agents.dev.java.net&lt;/a&gt;, however this site provides a mercurial repository of the source.

&lt;/p&gt;&lt;p&gt;This project provides the source to agent libraries that run in the Virtual Machine for the Java(TM) platform that provide Solaris(tm) 10 Dynamic Tracing (DTrace) probes.

&lt;/p&gt;&lt;p&gt;This source code can be used to create two native agent libraries that can be dynamically loaded into a VM (1.4.2 or 5.0) at VM startup. The agents are called dvmti (using JVM TI) and dvmpi (using JVMPI).  

&lt;/p&gt;&lt;p&gt;These agent libraries utilize the VM tool or profiling interfaces to request various VM events and provide DTrace probes in the callback code for those events. These agent libraries are for use with Solaris 10 Dynamic Tracing (DTrace). Since the probes are actually in the agent libraries the VM is unchanged.

&lt;/p&gt;&lt;p&gt;The dvmti agent utilizes JVM TI which only works with JDK version 5.0 and newer but provides the most detail in the DTrace probe arguments. The dvmpi agent utilizes JVM PI which will work with 1.4.2 and 5.0, but the JVM PI was always experimental and can be unreliable at times. The JVM PI will not be available in JDK 6.0. The JDK version 6 and newer actually provide DTrace probes (see &lt;a class='external' href=&quot;http://java.sun.com/javase/6/docs/technotes/guides/vm/dtrace.html&quot;&gt;http://java.sun.com/javase/6/docs/technotes/guides/vm/dtrace.html&lt;/a&gt; for more information).

&lt;/p&gt;&lt;p&gt;All agent code has been written in the C programming language. Shared library names are libdvmpi.so and libdvmti.so. Usage:

&lt;/p&gt;&lt;pre&gt;    java -Xrundvm[tp]i[:options] ...
&lt;/pre&gt;&lt;p&gt;
Where the options are:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt; all
&lt;ul&gt;&lt;li&gt; same as: unloads,allocs,stats,methods
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; help
&lt;ul&gt;&lt;li&gt; print help message
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; unloads
&lt;ul&gt;&lt;li&gt; track class unloads
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; allocs
&lt;ul&gt;&lt;li&gt; track object allocations and frees
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; stats
&lt;ul&gt;&lt;li&gt; generate heap stats after each GC
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; methods
&lt;ul&gt;&lt;li&gt; generate method entry exit events
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; exclude=name
&lt;ul&gt;&lt;li&gt; exclude class names
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
The default is none of unloads, allocs, stats, or methods.

&lt;/p&gt;&lt;p&gt;The dvmti agent will utilize BCI (Byte Code Instrumentation) where needed and will need a jar file called dvmti.jar, that should be located in the same directory as the shared library libdvmti.so. The dvmpi agent will utilize the slow object allocation path where needed. You will likely be unable to compare the two agents, they will behave slightly differently. The DTrace probes are:

&lt;/p&gt;&lt;pre&gt;  provider dvm {
    probe vm__init();
    probe vm__death();
    probe thread__start(char *thread_name);
    probe thread__end();
    probe class__load(char *class_name);
    probe class__unload(char *class_name);
    probe gc__start();
    probe gc__finish();
    probe gc__stats(long used_objects, long used_object_space);
    probe object__alloc(char *class_name, long size);
    probe object__free(char *class_name);
    probe monitor__contended__enter(char *thread_name);
    probe monitor__contended__entered(char *thread_name);
    probe monitor__wait(char *thread_name, long timeout);
    probe monitor__waited(char *thread_name, long timeout);
    probe method__entry(char *class_name, char *method_name, char *method_signature);
    probe method__return(char *class_name, char *method_name, char *method_signature);
  };
&lt;/pre&gt;</text-as-html>
  <updated-at type="datetime">2009-02-10T22:12:05Z</updated-at>
  <wiki-id type="integer">2108</wiki-id>
</page>
