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

Command line reference

General

This reference refers to profilerjCMD.sh and profilerjCMD.cmd respectively.

ProfilerCMD is a simple command line based tool. It sends requests to the (remote) profilerj Agent and receives responses on completion. By default, communication is done via socket (localhost, port 9000). If the agent runs on a different machine, start profilerCMD with arguments -host host -port port.

 

General

  • help
  • info
  • resume
  • gc
  • quit

Byte code instrumentation

  • bci
  • memory
  • cpu
  • start
  • stop

Sampling

  • sampler
 

Snapshots

  • snapshot
  • clear

help

Syntax: h[elp]

Prints a list of  available commands.

 

info

Syntax: in[fo]

Sends a request to the agent (via socket) and shows the result. The outcome is something like this:

{suspended=true, stopped=true, cpu=false, memory=false, sampler=false}

  • suspended: If suspended is true, the agent (and therefore the application  to be debugged) wait for a resume.
  • stopped: If true, Byte-code-instrumentation (BCI) is deactivated. See stop, start.
  • cpu: If true, BCI for method-profiling is activated. Will be automatically set on a bci request. See cpu, bci.
  • memory: If true, BCI for object allocation profiling is activated. Will be automatically set on a bci request. See memory, bci.
  • sampler: True if sampler is running. See sampler.

 

resume

Syntax: re[sume]

If the application to be debugged starts with -javaagent:com.terrasoft.jrc.agent.jar=suspend=y, it will wait until it receives a resume-request. Note that resume may only be sent once - there is no suspend command.

 

gc

Syntax: gc

Requests agent to execute a System.gc() .

 

quit

Syntax: quit

Exits the tool.

 

sampler

Syntax: sam[pler] on|off

Switches sampling on or off. See also info.

 

bci

Syntax: bci off | mi|me|ci|ce|Ci|Ce=pattern1;pattern2 ....

bci off switches byte-code-instrumentation off. This involves removing all previously injected code by reloading all modified classes.

mi, me, ci, ce, Ci and Ce stand for

  •   memory-include, memory-exclude, 
  • cpu-include, cpu-exclude. 
  • Coverage-include, Coverage-exclude. 

Each of them requires a pattern which must be a "regular expression".

mi and me define for which classes a memory profile should be taken, ci and ce specify classes to be profiled (method profiling data). Ci and Ce specify which classes should be instrumented to gain coverage metrics.

Examples:

bci mi=.* Instruments all classes in order to provide a memory allocation data. 
bci mi=.* me=java.* Memory allocation data for all objects except for java.*
bci ce=java.*  Activate method profiling for all classes except java.*
bci Ci=com.terrasoft.examples.* Collect coverage metrics for com.terrasoft.examples.*

 

 

memory

Syntax: mem[ory] on|off

Switches BCI memory allocation profiling off. Will be automatically set by bci.

 

cpu

Syntax: cpu on|off

Switches BCI  method profiling off. Will be automatically set by bci.

 

start

Syntax: sta[rt]

Starts previously stopped BCI profiling.

 

stop

Syntax: sto[p]

Stops BCI profiling but doesn't remove injected code.

 

snapshot

Syntax: sn[apshot] [filename] [remote|local]

Creates a snapshot-file (see Snapshot File Format) either on the local or remote machine. Local is the machine where profilerjCMD runs, remote is where the agent (and the application to be profiled) resides.

Examples

sna Creates a snapshot file on the local machine. The filename is snapshot-YYYYMMDD-HHMMSS.xml
sna snapshot.xml Creates a snapshot 'snapshot.xml' on the local machine.
sna snapshot.xml remote CCreates a snapshot 'snapshot.xml' on the remote machine.

 

clear

Syntax: cl[ear]

Clears snapshot data.

 

 

Copyright © 2006 Terrasoft Software GmbH. All rights reserved.