When analyzing application performance, you can choose to limit the source code that is instrumented by
specifying a root method. When you profile an application by instrumenting a root method, profiling data
is collected when one of the application's threads enters and leaves the root method.
When you specify a root method, the method is added to the list of selected root methods which you can choose to
instrument when profiling application performance.
The selected root methods are listed in the Specify Root Methods dialog box.
Each profile application performance configuration is associated with a specific set of selected root methods.
You can specify root methods in the source code of a class or in the Select Profiling Task dialog box when setting
options for analyzing application performance.
To specify a single root method in a class:
Locate the class containing the method you want to add and open the class in the Source Editor.
In the Source Editor, right-click in the method you want to add and choose
Profiling > Add as Profiling Root Method.
Select a profiling configuration and click OK.
When you click OK, the method is added to the root methods that are associated with that profiling configuration.
To specify multiple root methods in a class:
Locate the class containing the method you want to add and open the class in the Source Editor.
In the Source Editor, right-click in the source code and choose
Profiling > Select Profiling Root Methods.
Select a profiling configuration and click OK to open the Select Root Methods dialog box.
Expand the package and method nodes, select the methods you want to add as root methods and click OK.
When you click OK, the selected methods are added to the root methods that are associated with that profiling configuration.
Note: If you right-click in an object that is part of another class, the Select Root Methods dialog box will
allow you to select root methods in that class.
Notes:
You may need to first mount the file system or a JAR file that contains your root
method's class, e.g. if this class does not belong to your application's
classpath. That is the case, for example, when profiling code running on
top of a Web/J2EE server.
If you choose a given method as a root when a thread is already
executing it, profiling will not start. To begin profiling, a "fresh" call
to the root method is required.
Once partial application profiling is initiated, profiling data
is not collected until one of the application's threads enters the profiling root method.
To specify root methods when setting options for analyzing application performance:
Open the Select Profiling Task dialog box and select the analyze CPU task.
Select Part of Application.
Click define (if no methods are defined) or edit (if some methods
are already defined) to open the Specify Root Methods dialog.
Click one of the following options.
Add From Project. Choose Add From Project to select root methods displayed in a tree view.
In the Select Root Methods dialog box you can select the specific methods in the project that
you want to add as root methods. You can choose the project view to see project methods or
Default Package View to view the methods in the project sources and dependent libraries.
Add Manual. Choose Add Manual to add a specific method by typing the class name,
method name and signature.
Click OK.
When you click OK the root method is added to the list of root methods displayed in the
Specify Root Method dialog box.
You can select a method from the list and click Remove to delete the method from the list.