About the Triggers and Actions Pane
The Triggers and Actions pane is to the lower right of the Setup panel. Triggers and actions are organized in a fashion very similar to that of areas, but their purpose is different and they apply only to the Performance and Coverage profilers.
Triggers are divided into on-triggers and off-triggers. In an on-trigger, whenever execution enters a checked routine, profiling is enabled for that thread. When execution leaves the element, profiling is returned to its former state. Vice-versa for off-triggers. For complete information on this, see About Triggers.
Like triggers, actions can disable or enable profiling but unlike triggers actions do this for all the threads rather than for the current thread only. Another purpose of actions is to get profiling results during a profile run. Each action has effect either when execution enters a checked routine or when execution leaves it. See About Actions.
Note that profiling being enabled does not mean it actually operates. It means it is allowed to operate on the areas checked in the Code to Profile pane. See Controlling What to Profile. However, you may simply check All Project Modules or Entire .NET Code in the Code to Profile pane, and then leave profiling control to triggers and actions.
There is one predefined trigger, Initial Profiling Status for Threads. It is checked by default. When it is checked, profiling is always enabled unless an off-trigger or an action that disables profiling is under execution. When this predefined trigger is unchecked, profiling is always disabled unless an on-trigger or an action that enables profiling is under execution. Leaving the predefined trigger checked means controlling profiling primarily through areas (which is always the case of course with all but the Performance profiler). To give primary control to triggers and actions, uncheck the predefined trigger.
Working with the Pane
To create a new trigger folder, select Add Trigger from the context menu. This will call the Add Trigger dialog, which allows you to specify the trigger name, type (on/off) and some other attributes (see Creating, Editing and Deleting Triggers).
To create a new action folder, select Add Action from the context menu. In the resulting Action Properties dialog, you will be able to specify the action name and attributes.
Adding Elements to Triggers and Actions
Once you have a trigger’s or an action’s folder, you add elements to it in the same way you would add them to an area (by dragging or by using the Add Selected to Trigger and Add Selected to Action items on the context menu). You can change trigger or action settings later by using Edit on the context menu. This also has Remove.