Specifying profiling criteria
Specifying profiling sets and creating profiling filters enables you to specify the subset of information
that you want to analyze. Profiling sets specify the type of data to collect,
and filters ensure that only relevant details are channeled out to the views. Using filters is especially
useful when speed and efficiency is critical: the less data there is, the less
impact it has on the system, and the faster it can be collected.
Prerequisites:
Configuring the profiling criteria for an application is broken down into the following sections:
- In your profiing configuration, under the Profiling tab, select the Overview tab.
- Select one of the default profiling sets available. Click on the profiling set to see
the description of what data is collected for a profiling set.
- If you need to use a combination of the default profiling sets, you can
create a custom profiling set:
- Click Add to add your own profiling set. The Add Profiling Set wizard opens.
- On the Profiling Set page, specify a name and a description for your profiling set. Click Next.
- On the Profiling Type page, specify the information you want collected by selecting the relevant check boxes.
Refer to the table below to see which profiling types should be enabled to generate the different views,
and possible applications of each profiling type.
Profiling type |
Options selected |
Views available |
Application |
Memory Analysis |
N/A |
Memory Statistics view (Package, Class, Method),
Object References view*
|
Memory leak analysis, Identifying memory-intensive classes
|
Memory Analysis |
Advanced > Instance Level information checkbox selected |
Memory Statistics view (Package, Class, Method, Instance)
Object References view* |
Memory leak analysis, Studying Garbage Collection |
Time Analysis |
Show execution Statistics (compressed data) |
Execution Statistics (Package, Class, Method)
Coverage Statistics
|
Viewing invocations of a method |
Time Analysis |
Show execution Statistics (compressed data), Advanced > Collect instance level information |
Execution Statistics (Package, Class, Method, Instance)
Coverage Statistics
|
Viewing package, class and method statistics for each instance, Viewing invocations of a method |
Time Analysis |
Show execution graphical details |
Execution Statistics (Package, Class, Method),
Coverage Statistics,
Execution Flow view,
UML2 Sequence diagrams views (object,class, thread)
|
Identifying active threads, Identifying phases of program execution |
Time Analysis |
Show execution graphical details, Advanced > Collect instance level information |
Execution Statistics (Package, Class, Method, Instance),
Coverage Statistics,
Object References view*,
Execution Flow view,
UML2 Sequence diagrams views (object,class, thread)
|
Identifying active threads, Identifying phases of program execution |
Code Coverage |
N/A |
Coverage Statistics (Package, Class, Method)
|
Viewing code coverage |
* Note: For the Object References view, you will need collect object references
by invoking the action Collect Object References to view the profiling data using the Object References view. You can invoke Collect Object References from the toolbar of the Profiling Monitor view or by right clicking on the agent in the Profiling Monitor view.
- Click Next.
- On the Filter Set page, specify the filter set that you want applied by selecting from the Select
a filter set list. You can use the Default set.
- Under Contents of selected filter set, click Add to add packages that you want to collect data for.
The Add Filter dialog opens. An asterix * can be used as a wildcard in a pattern when specifying
package or method names.
Note 1. When entering a pattern for the package or method name,
the pattern must be specified in one of three ways:
- A pattern with no wildcards, e.g. org.eclipse.tptp.
- A pattern with a wildcard at the beginning, e.g. *.sample.myapplication.
- A pattern with a wildcard at the end, e.g. org.eclipse.*.
Note 2. Certain classes will always be visible in the profiling views regardless
of the filter settings. The profiling agent will always collect data for objects
or classes that are associated with the task being examined while collecting data specific to the task.
For example, you specify a filter to collect data for a single class MyUserClass, and
specify another filter to exclude the java.lang.* classes.
When an instance of MyUserClass is loaded though, it has an associated class definition that
gets loaded. This class definition has an associated class object, which is in
turn of type java.lang.Class. This results in data collection for the java.lang.Class
in addition to the MyUserClass class.
This behaviour applies to threads as well. The java.lang.Thread class will always
show up in the Profiling views because the profiling agent tracks all running threads,
and therefore, collects data for objects or classes associated with those threads.
- Specify the Package or Class, Method Name and select Include from the Rule list.
- Click OK. The filter criterion is added to the contents list.
- To exclude other existing packages from the filter contents list, click on Include under
the Rule column for the package, and change it to Exclude.
- Click Finish. A new profiling set is created in the Profiling set list.
- Click Apply to save the changes.
You can specify the amount of data you want collected by specifying
a limit by method invocations or a limit by time.
- In your profiing configuration, under the Profiling tab, select the Limits tab.
- To limit the data collected by method invocations select the Stop profiling
after specified number of method invocations check box. Specify the number of method invocations in the input box provided.
- To limit the data collected by time, select the Stop profiling after specified amount of time
check box. Specify the amount of time in seconds in the input box provided.
You can specify the project, and the monitor to use for your profiling session. You can
also write the profiling data to a file.
- In your profiing configuration, under the Profiling tab, select the Destination tab.
- Specify the Profiling Project that you want to use for your profiling session.
- Specify the Monitor that you want to use.
- If you want to save the profiling data to a file, select the Send profiling data to a file
and specify the file name in the Profiling file input box.
- Click Apply to save the changes.
- Click Profile to start profiling your application.
Hint: When filtering, only the first applicable filter is applied.
When you are specifying filters, ensure that you declare the most specific filter criteria
first.
Related concepts
Overview of the Profiling Tool
Related tasks
Profiling an application
Setting profiling preferences
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.