TPTP feature: 200251

Author:

Alexander N. Alexeev

email:

alexander.n.alexeev@intel.com

Last updated:

10/24/2007


Rough workload estimate in person weeks:

Process

Sizing

Names of people doing the work

Design

1ww

Igor Alelekov

Code

2ww

Test

1ww

Documentation

1wd

Build and infrastructure

1wd

Igor Alelekov

Code review & other committer work
(e.g. check-in, contribution tracking)
if this is to be contributed by someone who
is not a committer in the component

3wd

N/A – will be done by committer

Total

5ww

 

Requirement summary

Add support for "application" mode in the Java 1.5+ (JVMTI) Profiler. Based on: 200251, 203415, http://dev.eclipse.org/newslists/news.eclipse.tptp/msg04823.html , also related to 142986.

General meaning of this feature is to allow user have fine grained control mechanism over profiling process. This function already was implemented in PI agent and can be considered as resolving compatibility issue of PI and TI agent.

http://help.eclipse.org/help33/topic/org.eclipse.tptp.platform.doc.user/tasks/teprofsa.htm

http://archive.eclipse.org/tptp/4.2.0/javadoc/Platform/public/org/eclipse/hyades/collection/profiler/Profiler.html

 

Design summary

org.eclipse.hyades.collection.profiler.Profiler is a singleton class with some native methods implemented in piAgent. This is autonomous and it doesn’t extend any common class or implement any interface. Hence application mode support for TI  will have interface which resembles interface of class from original PI application mode support.

 

New TI agent management class “Profiler” is placed in “org.eclipse.tptp.platform.jvmti.runtime.profiler”.

It implements following methods taken from PI version:

 

public static Profiler getProfiler();

public void setMode(int mode); 

 

Supported mode is:

PROFILER_EXECUTION_CG – call graph,

PROFILER_EXECUTION_AGG – aggregated execution statistics,

PROFILER_HEAP_STAT – heap statistics,

PROFILER_HEAP_ALLOCSITE – heap statistics with allocation site,

PROFILER_THREAD – thread profiling.

 

public void startProfiling();

public void stopProfiling();

 

public void disableGC();

public void enableGC();

public void runGC();

public static int emitXMLFragment(String xmlFragment);

 

This two methods don’t  exist in PI version and should be introduced in TI.

 

public void pauseProfiling();

public void resumeProfiling();

 

Potential extension for API (stretch goal):

public void setFilter(String[] filters);

public void setOption(String key, String value);

 

Key

Values

“PROFILER_BINARY_OUTPUT”

“true”/”false” or “on”/”of”

“PROFILER_HEAP_ALLOCSITES”

“true”/”false” or “on”/”of”

“PROFILER_CG_EXECDETAILS”

“true”/”false” or “on”/”of”

Values can be case insensitive.

 

Difference between them and start/stop methods the next, start/stop methods working like attach/detach and add/remove BCI from profiled application, while pause/resume just stop events sending to the channel and continues to handle incoming events and to update internal data structures.