All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Samples.ProfileNester

java.lang.Object
   |
   +----Samples.ProfileNester

public class ProfileNester
extends Object
This class provides a utility which accepts a file of java profile information generated by the java -prof option and prints out a call tree of the called methods, their call counts and amounts of time. See the main method for invocation protocol.


Variable Index

 o calleeTable
The associations between the callee and the caller.
 o countsTable
The associations between the callee-caller and the counts of calls from caller to callee.
 o TabString
A string for formatting the indentation representing the nesting level.
 o timesTable
The associations between the callee-caller and the amounts of time spent in the calls.

Constructor Index

 o ProfileNester()
Constructs an initialized ProfileNester.

Method Index

 o call(String, int)
Prints nested nodes in the call tree.
 o main(String[])
Invokes the ProfileNester service.
 o parse(String)
Captures the information from the profile file.

Variables

 o calleeTable
 private Hashtable calleeTable
The associations between the callee and the caller.

 o timesTable
 private Hashtable timesTable
The associations between the callee-caller and the amounts of time spent in the calls.

 o countsTable
 private Hashtable countsTable
The associations between the callee-caller and the counts of calls from caller to callee.

 o TabString
 private static String TabString
A string for formatting the indentation representing the nesting level.

Constructors

 o ProfileNester
 ProfileNester()
Constructs an initialized ProfileNester.

Methods

 o parse
 void parse(String filename)
Captures the information from the profile file. Parse the fields from the java.prof file populating association tables.

Parameters:
filename - the complete file name of the java.prof file
 o main
 public static void main(String args[])
Invokes the ProfileNester service. To invoke this utility call ProfileNester, Usage: ProfileNester java.prof caller_entry_point where java.prof is the file generated by the java -prof option and caller_entry_point is the desired root node of the call tree, this must match exactly the desired caller as specified in the java.prof file For example, running Samples.GetQuotes with jdk1.1.6\bin\java_g -prof (jdk1.2beta3\bin\java -Xprof), see GetQuotes.main() for protocols, or, running it in the debugger with a Debug option of -prof, will produce a java.prof that this example will process. Create the java.prof file, then from the JIG Browser, highlight this command line and select run,
Samples.ProfileNester ..\Samples\java.prof Samples/GetQuotes.main([Ljava/lang/String;)V

Parameters:
args - command line argument list
 o call
 void call(String caller,
           int tab)
Prints nested nodes in the call tree. Recursively called method to print out the next node in the call tree. A new nesting level is indicated by increased indentation.

Parameters:
caller - the name of the calling method
tab - the numeric value of the nesting level

All Packages  Class Hierarchy  This Package  Previous  Next  Index