Profile multiple processes in Timing Captures

Timing Captures can profile applications that split work across multiple processes. When you take a Timing Capture, PIX captures data from all running processes on the machine, opens the capture with the launched or attached process visible, and lets you add other processes to the open capture.

Use multi-process profiling when the work you need to inspect is not confined to one process. For example, a game might start a launcher process before the game process, or a test machine might run multiple game server processes at the same time.

Capture call stacks for other processes

The title process is the process that you launch or attach to from PIX. Although PIX captures data from all processes, it captures call stacks only for the title process, when the relevant Timing Capture options collect stacks. In multi-process scenarios, enable Callstacks for non-title processes before you start the capture so that you also get call stacks for other processes.

  1. Start a Timing Capture from Launch Process or Attach to Process. For the basic launch and attach flow, see Take captures.
  2. On the Timing Capture options page, open Advanced.
  3. Select Callstacks for non-title processes.
  4. Start the capture.

Enable this option only when you need call stacks from other processes. Extra stack collection can increase capture overhead and symbol-processing time.

Show additional processes in an open capture

When you open the capture, PIX shows data for the title process by default. Add other processes with Manage Visible Processes.

  1. Open the Timing Capture.
  2. Select Manage Visible Processes in the top toolbar.
  3. Select the other processes you want to inspect.
  4. Apply the change.

The title process always remains visible. PIX lists each process as name (pid), or as Process pid if the process name is unavailable.

Analyze data from multiple processes

After you make more than one process visible, PIX updates Timing Capture views to use the visible process set. Wherever PIX shows information about CPU threads, it appends the executable name and process ID so you can tell which process each thread belongs to.

  • Timeline shows thread lanes and API queue lanes for visible processes. When multiple processes are visible, thread names include the executable name and process ID. For example, if two game server processes each have a thread named AP1, the Timeline shows two AP1 lanes, each labeled with its own process.
  • Range Details filters item and summary data to visible processes for data types that are process-specific. This includes CPU samples, file I/O, DirectStorage, GPU API work, PIX events, and any captured memory-allocation data. Thread names in Range Details include the executable name and process ID.
  • Element Details and item lists that show thread names include the executable name and process ID where needed.
  • Metrics and Comparison partition the tree in the metrics selector panel by process, with process-specific metric groups for each visible process.

For CPU sample stack trees in Range Details, choose a grouping that keeps process context visible. In the Display Options panel for Sampled Functions, keep Stack Tree selected and set Group By: to Threads, Cores, or Cores, Threads. Without this grouping, the same stack tree can appear multiple times, once per process, with no indication of which process it came from.

Understand multi-process limits

Memory allocation capture is scoped to the title process. The volume of memory data, especially heap allocations, makes it impractical to capture for all processes. Use memory allocation views to analyze the process that PIX launched or attached to for the capture. If the process that performs the allocations is not the title process, attach to that process when you take the capture.

File I/O and DirectStorage views follow the visible process set. If you do not see activity that you expect, open Manage Visible Processes and add the process that owns the work.