Udostępnij za pośrednictwem


How to: Attach and Detach the Profiler to Running Processes

The profiler can be used to attach to or detach from a running process to make sampling and gathering performance data easier. You can use this method to profile a process when you want to avoid gathering data about application load time, or to monitor the performance of a process after it reaches a specific state.

Note

The following steps apply to attaching and detaching processes from within the IDE. For information about how to use command line tools, see Using the Profiling Tools From the Command-Line. For information about how to profile services, see How to: Profile Services Using Command Line Tools

The processes available to profile depend on the User Access Permissions that are set by an administrator of the computer. A User account may, for example, have permission for any of the following:

  • Advanced profiling features, when the administrator has set the driver and service to start.

  • Sample profiling only (domain users).

  • Deny access to profiling to everybody.

For more information, see Profiling and Windows Vista Security and the ADMIN options in VSPerfCmd.

To attach to a running process

  1. On the Analyze menu, point to Profilerand then click Attach/Detach.

    - or -

    In Performance Explorer, right-click the performance session, and then click Attach/Detach.

    The Attach Profiler to Process dialog box appears.

  2. Click the image name that you want to attach.

  3. Click Attach.

To detach from a running process

  1. On the Analyze menu, point to Profilerand then click Attach/Detach.

    - or -

    In Performance Explorer, right-click the performance session, and then click Attach/Detach.

    The Attach Profiler to Process dialog box appears.

  2. Click the image name from which you want to detach.

  3. Click Detach.

See Also

Tasks

How to: Start and End Profiling

Concepts

Profiling Tools Performance Session Overview

Reference

Profiling and Windows Vista Security

VSPerfCmd

Other Resources

Controlling Data Collection in Profiling Tools