dotTrace 2016.1 Help

Simplifying Analysis with Subsystems

Subsystems is a way of presenting profiling snapshot data which gives you a quick overview of time consumed by certain system components (various parts of .NET Framework, external libraries, your own code and so on). A subsystem simply groups all calls made within a certain namespace or assembly. For example, you can create a subsystem for System.Windows.Forms to summarize all WinForms calls in your app. This will show you how much time was required for interaction with your app.

For better understanding of subsystems, we recommend that you pass the following tutorial.

Introduction, Concepts and Configuration

Each time you select a node, dotTrace analyzes gathered data for the selected call stack and displays the contribution of various subsystems to the selected call stack. For better perception each subsystem has its own color. You can assign custom colors or use the default ones.

To define a new subsystem, you need to define a name, set a color and specify a rule or multiple rules.

To add a new subsystem

  1. On the menu bar, choose View | Options. The Options dialog box opens.
  2. Click Profiles on the left pane of the Options dialog box.
  3. Click the arrow near ThemedIcon.AddedParameter.Screen.[Color] Create new subsystem on the Profiles pane, then click Add empty subsystem.
  4. The Subsystem definition dialog box opens.
    • Enter a new name in the Name text box.
    • Click the area to the right of the Color label to open the Select Color dialog box and choose the appropriate color.
    • Clear the Enable subsystem in current profile check box, if you want to disable the subsystem in the current profile.
    • Specify subsystem visibility options:
      • Show - the subsystem will be shown as a separate entry.
      • Join - subsystem's time will be calculated within calling subsystems. The subsystem will be shown separately only in case there are no subsystems to join with.
      • Hide - the subsystem will be hidden. Subsystem's time will be excluded from calculations.
      For example, MethodA belongs to SubsystemA and calls MethodB (belongs to SubsystemB) which, in turn, calls MethodC (belongs to SubsystemC). If all subsystems are set to Show, subsystems time will be calculated as follows:
      SubsystemA = MethodA
      SubsystemB = MethodB
      SubsystemC = MethodC

      In case you set SubsystemB to Join, subsystems will be calculated as follows:
      SubsystemA = MethodA + MethodB
      SubsystemC = MethodC

      In case you set SubsystemB to Hide, subsystems will be calculated as follows:
      SubsystemA = MethodA
      SubsystemC = MethodC
    • Click Add and Clean to manage rules. All rules are displayed in the list.
  5. Click OK to save the changes and close the Subsystem definition dialog box.

You can also create a subsystem by duplicating an existing one.

To duplicate a subsystem

  1. On the menu bar, choose View | Options. The Options dialog box opens.
  2. Click Profiles on the left pane of the Options dialog box.
  3. Click the arrow near ThemedIcon.AddedParameter.Screen.[Color] Create new subsystem on the Profiles pane, then click Duplicate subsystem.
  4. The Subsystem definition dialog box opens.
    • If necessary, modify the name in the Subsystem name text box.
    • Click the area to the right of the Color label to open the Select Color dialog box and redefine the color.
    • Click Add and Clean to manage rules. All rules are displayed in the list.
  5. Click OK to save the changes and close the Subsystem definition dialog box.

At any time you can return back to existing subsystems and modify rules for them.

After all necessary subsystems are defined, you can tune the settings a bit more. All subsystems that should be taken into account can be gathered in one profile and arranged according to their importance. So a profile is just a set of important or active subsystems. It can have a name or be left unnamed.

If a method matches two rules from different subsystems, the rule from the subsystem that is upper than the other one in the list of subsystems is applied.

To create a new profile

  1. On the menu bar, choose View | Options. The Options dialog box opens.
  2. Click Profiles on the left pane of the Options dialog box. A new unnamed profile is created.
  3. Click ThemedIcon.AddedParameter.Screen.[Color] Add new profile on the Profiles pane.
  4. In the list of profiles, an active text box appears. Type a name for the new profile in this text box.
    In the list of subsystems, configure the set of active subsystems by selecting the corresponding check boxes.
  5. Optionally, you can reorder the sequence of subsystems. To do that, select the subsystem to be moved and click ThemedIcon.Up.Screen.[Color] Move selected subsystem up or ThemedIcon.Down.Screen.[Color] Move selected subsystem down.
  6. Click OK to save changes.

When you have several profiles, you can switch between them in the Subsystems view and visualize those parts of assemblies that seem to be important right here right now.

View Description

By default, the Subsystems view is visible. If it is not so, select the Enable subsystem analysis check box on the Profiles page of the Options dialog box. After that, dotTrace rebuilds the view each time you choose a new call stack.

Studying_Profiling_Results__Subsystems_01

Studying_Profiling_Results__Subsystems_02
One

The subsystem where most time is spent occupies the biggest block. This block in turn consists of smaller blocks that represent child subsystems.

Two

Profile switch button helps you quickly change the profile according to which the view is built and rebuild it emphasizing other subsystems. You can also collapse or expand the view.

Three

Subsystems are sorted by time. Each of them is displayed as a tree where leaf nodes are functions.

There are four separate subsystems that exist independently regardless of defined patterns and custom subsystems. All functions can be divided into two groups depending on their assemblies and can be included in System code or User code subsystems:

  • System code - all source code that does not match the rules in the chosen active profile and belongs to standard system libraries
  • User code - all source code that does not match the rules in the chosen active profile and does not belong to standard system libraries
To learn how to move functions from one group to another, see Creating and Applying Filters.

The remaining two subsystems are only for information about some activities in your application:

  • Garbage collection - all activities related to garbage collection
  • Special - all functions that do not belong to .NET libraries

If you don't need a tree view, you can switch to a smart mode. Double-click the top of the view and collapse it.

See Also

Last modified: 19 August 2016