Terrasoft ProfilerJTerrasoft ProfilerJ
Home | Features | Screenshots | Documentation | Download | Evaluate | Buy | Contact | About
ProfilerJ
Agent
Snapshot file format
ProfilerJ Console
Command line reference
Installation
Content of distribution
Installation
Tutorial
Step 1 - Download files
Step 2 - Deploy agent
Step 3 - Run ProfilerJ Console
Step 4 - Get a license key
Step 5 - Run ProfilerJ Viewer
Step 6 - Sampling
Step 7 - Byte Code Instrumentation
Step 8 - Code Coverage
ProfilerJ Viewer

Snapshot file format

General

Snapshots are stored in XML-Format. The overall structure is:

<doc>
  <profile>
  ...
  </profile>
  <sampler>
  ...
  </sampler>
  <memory>
  ...
  </memory>
  <coverage>
  ...
  </coverage>
</doc>

Profile

This section contains java-method profiling data collected by byte-code-instrumentation. Below you see an extract of a snapshot-file (Complete snapshot »):

<profile>
  <thread name="AWT-Windows" cpuTime="187500000" isAlive="true">
    <profile name="java.awt.event.PaintEvent(java.awt.Component,int,java.awt.Rectangle)"      
                signature="(Ljava/awt/Component;ILjava/awt/Rectangle;)V" count="88" 
                cumulatedElapsed="16000" cumulated="0" method="0" overheadCumulated="0" overheadMethod="0" 
                exceptions="0">
      <profile name="java.awt.event.ComponentEvent(java.awt.Component,int)" 
                  signature="(Ljava/awt/Component;I)V" count="88" 
                  cumulatedElapsed="13000" cumulated="0" method="0" overheadCumulated="0" overheadMethod="0" 
                  exceptions="0">
        <profile name="java.awt.AWTEvent(java.lang.Object,int)" 
                    signature="(Ljava/lang/Object;I)V" count="88" 
                    cumulatedElapsed="7000" cumulated="0" method="0" overheadCumulated="0" overheadMethod="0" 
                    exceptions="0">
        </profile>
      </profile>
  </profile>
  ...
  </thread>
</profile>

Profiling data is grouped by threads. Each thread reports the following data: 

Attribute

Description

name The name of the thread.
cpuTime The consumed CPU time (nanoseconds).
isAlive True if the thread is alive.

 

The XML-structure below <thread> shows the method call stack. Method profiling data comprises:  

Attribute

Description

name The method's full qualified name (contains package name) and human readable signature.
signature The method's signature as defined by the Java specification
count Invocation count 
methodElapsed Elapsed time in microseconds excluding called (and profiled) methods.
method CPU time consumption in microseconds excluding called (and profiled) methods.
cumulatedElapsed Cumulated elapsed time of method and all methods is has called.
cumulated Cumulated CPU time of method and all methods is has called.
overheadCumulated CPU time the agent consumed to collect profile data for this and all called methods. The ratio overheadCumulated / cumulated is a measure for the quality of the profiling results.
overheadMethod CPU time the agent consumed to collect profile data for this method.
exceptions Number of exceptions thrown.

 

Sampler

This section contains java-method profiling data collected by sampling. Below you see an extract of a snapshot-file (Complete snapshot »):

<sampler>
  <thread name="AWT-EventQueue-0" cumulated="8" cpuTime="468750000" cumulatedElapsed="351" elapsedTime="7402889190" isAlive="true">
    <profile name="java.awt.EventDispatchThread.run()" hits="0" cumulated="8" cumulatedElapsed="351">
      <profile name="java.awt.EventDispatchThread.pumpEvents()" hits="0" cumulated="8" cumulatedElapsed="351">
        <profile name="java.awt.EventDispatchThread.pumpEvents()" hits="0" cumulated="8" cumulatedElapsed="351">
          <profile name="java.awt.EventDispatchThread.pumpEventsForHierarchy()" hits="0" cumulated="8" cumulatedElapsed="351">
            <profile name="java.awt.EventDispatchThread.pumpOneEventForHierarchy()" hits="0" cumulated="8" cumulatedElapsed="351">
              <profile name="java.awt.EventQueue.getNextEvent()" hits="0" cumulated="0" cumulatedElapsed="323">
                <profile name="java.lang.Object.wait()" hits="0" cumulated="0" cumulatedElapsed="323">
                  <profile name="java.lang.Object.wait(native)" hits="0" cumulated="0" cumulatedElapsed="323">
                  </profile>
                </profile>
              </profile>
            </profile>
          </profile>

</sampler>

Profiling data is grouped by threads. Each thread reports the following data: 

Attribute

Description

name The name of the thread.
cumulated The number of recorded hits with thread being in state Thread.State.RUNNABLE.
cumulatedElapsed The number of recorded hits regardless of the thread's state.
cpuTime The consumed CPU time (nanoseconds).
elapsedTime The total elapsed time (nanoseconds) i.e. the time the thread is running.
isAlive True if the thread is alive.

The XML-structure below <thread> shows the method call stack. Method profiling data comprises:  

Attribute

Description

name The method's full qualified name (contains package name). Contrary to byte-code-instrumentation (see <profiler>, doesn't provide signature.
hits The number of recorded hits with thread being in state Thread.State.RUNNABLE.
elapsed The number of recorded hits regardless of the thread's state.
cumulated Cumulated  number of recorded hits (i.e. this method and all called methods) with thread being in state Thread.State.RUNNABLE.
cumulatedElapsed Cumulated  number of recorded hits regardless of the thread's state.

 

Memory

This section contains object allocation data collected by  byte-code-instrumentation. Below you see an extract of a snapshot-file (Complete snapshot »):

<memory>
  <thread name="AWT-EventQueue-0">
    <memory class="java.awt.geom.AffineTransform" count="69" max="799"/>
    <memory class="java.awt.Rectangle" count="61" max="1446"/>
    <memory class="sun.java2d.pipe.Region" count="37" max="373"/>
    <memory class="java.lang.Object" count="7" max="7"/>
    ....

  </thread>
    <thread name="AWT-Windows">
    <memory class="java.awt.Rectangle" count="45" max="88"/>
    <memory class="java.awt.event.PaintEvent" count="45" max="88"/>
    <memory class="sun.awt.EventQueueItem" count="43" max="88"/>
  </thread>
</memory>

The object allocations are grouped by threads which allocated the respective objects. For each allocated object, the following data is provided:

Attribute

Description

class The class name of the allocated object
count The number of objects currently allocated
max The maximum number of previously allocated objects.

 

Coverage

This section contains coverage metrics collected by  byte-code-instrumentation. Below you see an extract of a snapshot-file (Complete snapshot »):

<coverage>
    <class name="com.terrasoft.profilerj.tutorial.Example01" source="Example01.java">
        <method name="&lt;init&gt;" signature="(Ljava/lang/String;)V" firstline="11" count="0">
            <footprints>0 0 </footprints>
        </method>

        <method name="runLoop" signature="(I)V" firstline="26" count="605">
            <footprints>605 605605 -1 605000 605000 -1 605 </footprints>
        </method>
....
</class>

....
</coverage>

The tag <class> contains general information about the class whose methods have been checked vor coverage:

Attribute

Description

class The name of the class
source The source file (only available if class was compiled with debug switch "on")

Beneath the class node you find a <method> tag for each method of the class.

Attribute

Description

name The name of the method
signature The method's signature
firstline The line in the source code where the method begins (i.e. the first executable statement)
count The number of times this method has been invoked.

The tag <footprints> contains integers delimited by blanks. Each source line of the respective method corresponds to exactly one number, i.e. the first line of the method corresponds to the first integer. Each number may be -1, 0 or greater than 0:

  • -1 : The line doesn't contain executable code (e.g. empty lines, comments ...)
  •  0 : The respective line contains executable code which has never been reached.
  • greater 0: The value shows how often the line has been executed.

 

Copyright © 2006 Terrasoft Software GmbH. All rights reserved.