Understanding Process/Thread Sets
All TotalView commands operate on a set of processes and threads. This set is called a Process/Thread (P/T) set. The right-hand text box in windows that contain P/T set controls lets you construct these sets. In the CLI, you specify a P/T set as an argument to a command such as dfocus. If you’re using the GUI, TotalView creates this list for you based on which Process Window has focus.
Unlike a serial debugger in which each command clearly applies to the only executing thread, TotalView can control and monitor many threads with their PCs at many different locations. The P/T set indicates the groups, processes, and threads that are the target of the CLI command. No limitation exists on the number of groups, processes, and threads in a set.
A P/T set is a list that contains one or more P/T identifiers. (The next section,
“Specifying Arenas”, explains what a P/T identifier is.) Tcl lets you create lists in the following ways:
You can enter these identifiers within braces (
{ }).
You can use Tcl commands that create and manipulate lists.
These lists are then used as arguments to a command. If you’re entering one element, you usually do not have to use the Tcl list syntax.
For example, the following list contains specifiers for process 2, thread 1, and process 3, thread 2:
{p2.1 p3.2}
If you do not explicitly specify a P/T set in the CLI, TotalView defines a target set for you. (In the GUI, the default set is determined by the current Process Window.) This set is displayed as the default CLI prompt. (For information on this prompt, see
“About the CLI Prompt”.)
You can change the focus on which a command acts by using the
dfocus command. If the CLI executes the
dfocus command as a unique command, it changes the default P/T set. For example, if the default focus is process 1, the following command changes the default focus to process 2:
dfocus p2
After TotalView executes this command, all commands that follow focus on process 2.
In the GUI, you set the focus by displaying a Process Window that contains this process. Do this by either using the P+, Px and P- buttons in the tab bar at the bottom, by making a selection in the Processes/Ranks Tab, or by clicking on a process in the Root Window. Note that the
Px button launches a dialog box that enables you to enter a specific Process or Thread to focus on.
If you begin a command with dfocus, TotalView changes the target only for the command that follows. After the command executes, TotalView restores the former default. The following example shows both of these ways to use the dfocus command. Assume that the current focus is process 1, thread 1. The following commands change the default focus to group 2 and then step the threads in this group twice:
dfocus g2
dstep
dstep
In contrast, if the current focus is process 1, thread 1, the following commands step group 2 and then step process 1, thread 1:
dfocus g2 dstep
dstep
Some commands only operate at the process level; that is, you cannot apply them to a single thread (or group of threads) in the process, but must apply them to all or to none.