|
|
To perform operations on slices, open a Table view of slices, select the slice(s) you are interested in, and then right-click to get a popup menu, or choose the Selected menu from the menu bar.
A Table view showing menu items specifically for working with slices
Menus
The following describes the additional menu entries that appear in a Table view of slices, beyond those that appear in all other types of Table view.
- Selected Menu or (right-click) popup menu.
Choosing Delete Selected Slice(s) from Workspace will remove the selected slice(s) from the workspace. They will only be deleted completely from the session if they are not in use by any other workspace. Note that you will not be allowed to delete the base slice of a workspace.
Use Rename Slice or Edit Slice Color to change the name or color of a selected slice. Any views showing the slice's name or color will be automatically updated.
Use Edit Slice Definition to adjust the rules that determine the content of the selected slice.
From the Options panel, you may select either or both of the following options to determine whether activity called by or leading to the invocations of interest will be included in the slice:
- Include callees: include all calling activity generated by the method invocations in the slice
- Include callers: include all calling activity leading to the method invocations in the slice
The next two options are relevant only if you have defined a slice based on class or package filtering:
- Include a method invocation based on its target object's class: include only those method invocations where the target object is a member of a class that is in the slice.
- Include a method invocation based on its method's class: include only those method invocations where the implementing class of the method is in the slice.
See What's in a Slice, Precisely? for a more detailed discussion of the rules that determine the content of a slice.
There are also ways to create more complex slices that may be enabled. See Undocumented "Advanced" Features.
You may also select Clear Slice Criteria to clear any filtering criteria that have been set for the slice. The change will not take effect until you hit Save and Close.
Viewing information about slices
You may use the Table view of slices to see information about the slices you have defined. From the Columns menu select Choose Attributes... to see summary measurements of execution activity or memory in the slice. You may also display properties of the slices themselves: choose definition to see a text version of the filtering criteria and rule settings that are in effect for the slice, and parent slice to see the parent slice name. If the parent slice field is blank, then the slice represents the entire trace. The view below shows an example where the workspace base slice represents the entire trace, and we have created two subset slices representing database query and update methods.
You may create and work with multiple workspaces. A workspace may either be over the entire trace, or it may be based on an existing slice in another workspace.
To create a new workspace whose base slice is the entire trace, select Create a New Workspace from the File menu in the workspace window. From this same menu you may select Rename Workspace... to rename the workspace. The new name will be reflected in each of the views. To delete a workspace simply close the workspace window.
To create a workspace based on an existing slice, bring up a Table view of slices, right-click on the slice of interest, and choose Create a New Workspace from Selected Slice. This will create a new slice that is a subset of the selected slice, and create a workspace that uses this new slice as its base. This feature allows you to create a hieararchy of workspaces as you progressively narrow your problem focus. Note that if the definition of the original slice changes, all slices derived from it will be automatically updated to reflect the change.
The workspace window is also used to control the loading of the trace file, and to show the status of how much of the trace has been loaded. Note that even if you are working with more than one workspace, only a single trace will be loaded and shared by all of the workspaces..
The trace of the program execution contains information about various types of elements: threads, packages, classes, objects, methods, and method invocations. A slice is a subset of this information representing a portion of the execution you would like to analyze. A single slice will contain some elements of every type: threads, packages, classes, etc. .
When you define a slice, you specify criteria to limit what goes into the slice. Rules are then applied to automatically include or exclude related information you are likely to want. For example, if you create a slice to study a number of Java classes, by default the slice will contain the following:
- The classes you've chosen
- The objects and methods of these classes
- Method invocations made on objects of these classes, plus any method invocations they directly or indirectly called
- Information about all threads and packages will be in the Slice
You may adjust some of these rules - see Edit Slice Definition.
Slices are arranged hierarchically; each slice contains a subset of the information of its parent slice. There may be many root slices, each containing all the trace information. When you create a workspace from scratch, its base slice will contain the entire trace. All slices you create in a workspace are children of that workspace's base slice. You may also create a workspace based on a given slice. This will create a new slice to use as the base of the new workspace; the new slice will be a subset of the given slice.
Here are the steps that determine what a slice will contain, based on criteria you have chosen on various types of elements. These steps are applied in order. *denotes a step where you can adjust the rules.
Step 1: Limit related information
Step 1a: include only those invocations which occured in threads that are in the slice
Step 1b: include only invocations of methods that are in the slice
Step 1c: include only invocations where the target object is in the slice
Step 1d: include only classes that are part of packages that are in the slice. Note that including a package in a slice will not automatically include its subpackages.
Step 1e: Based on options you set, one of the following may be done:
- (default:) include only invocations where the target object's class is in the slice *
- include only invocations where the class implementing the method is in the slice *
Step 1f: include only those methods whose implementing class is in the slice
Step 1g: include only those objects whose class is in the slice.Note that anything not covered by the above rules will be included in the slice. For example, a slice based on a few classes will still contain information about all the threads.
Step 2: Remove from the slice any elements that are not in its parent slice.
Step 3: Add in callees and/or callers
Based on options you set, one, both, or neither of the following will be done:
- (default:) Include callees. Any calling activity that was generated by invocations which are in the slice at this stage will be added into the slice. *
- Include callers. Any method calls that directly or indirectly cause invocations which are in the slice at this stage will be added into the slice. *
Note that these rules may cause invocations to be included in the slice that were not in the parent slice.
The content of a slice is updated by rerunning the above process whenever something changes that could effect the slice content.. Any of the following events will cause a slice (and in turn, any views over it) to be refreshed:
- When new trace information has been loaded into the visualizer. All slices are refreshed after the trace has stopped loading for any reason, including reaching the end of the trace, reaching an error in the trace file, or hitting the Stop button.
- When you have changed the definition of a slice, the contents of that slice and any of its children will be refreshed.
Note that as slices change, certain aspects of views will be updated to reflect changes, and other aspects will remain fixed. Detailed information such as summary measures shown in cells of the Table view, colors based on summary measures in the Histogram view, or colors of invocations in the Execution view, will be updated to reflect changes in slice definitions. All summary measures and colors which represent summary measures will be updated to reflect changes in slice definitions. However, the major elements you choose to appear in a view (e.g. the classes shown in a Histogram view, the rows shown in a Table view, or the threads shown in an Execution view), will remain fixed even when the base or subset slices subsequently change.
Summary measures of execution activity and memory are shown in various views. These are measures that have been computed by aggregating smaller units of information over some larger unit (e.g. in the Histogram view you may see cumulative time summarized by class). They may be displayed as text (e.g. in the cells of a Table view or in the flyover in the Histogram view), or they may be mapped into a visual representation (e.g. the colors in the Histogram view). This section describes how summary computations relate to slice filtering.
Some of the views take into account the workspace base slice filtering when computing summary measures: these are the Table view, the Histogram views, and the Call Tree view. All of the summary measures shown in these views are relative to the workspace base slice filtering. In the case of the Table view, an individual column may in addition take into account the filtering for a particular subset slice that is being shown in that column. Note that none of the other views (the Execution, Execution Pattern, and Reference Pattern views) take into account any slice filtering when displaying measurements.
Summary measures of execution activity (number of calls, base time, and cumulative time) are computed by aggregating the information from individual method invocations; summary measures of memory (number of instances, size of instances, size of live instances) are computed by aggregating the information from individual instances. Summary measures are computed by starting with the relevant invocations or instances, taking the subset of these that are members of the given slice, and performing the computation over that set. See What's in a Slice, Precisely? for a discussion of how slice membership is determined.
See also Time measurements.
|
|