Export (0) Print
Expand All

Understanding VSPerfCmd Global/Process/Thread On/Off Options

Visual Studio 2005

VSPerfCmd allows a fine level control for collecting data about a specific thread or process. These options are GLOBALON/GLOBALOFF, PROCESSON/PROCESSOFF, THREADON/THREADOFF.

The options are binary states. The options are not a command or an action. All three states must be set to ON for data collection to start. The comparison of all three states is an AND operation. Therefore, data collection is enabled when processing for all three states is (ON AND ON AND ON) = 1.

The profiler stores this state information in an enumeration that is publicly available, PROFILE_CONTROL_LEVEL, and used by the Profiler APIs. The PROFILE_CONTROL_LEVEL is used to indicate one of the three levels to which performance data collection can be applied:

Enumerator Description

PROFILE_GLOBALLEVEL

Global level setting affects all processes and threads in the profiling run.

PROFILE_PROCESSLEVEL

Global level setting affects all processes and threads in the profiling run.

PROFILE_PROCESSLEVEL

Process level setting affect all threads that are part of specified process.

None of the options override any of the others. All three counters have to set to ON to collect a specific level of data.

Examples

  1. If you set /GLOBALOFF then any /PROCESSON or /THREADON will not enable any profiling of the process or thread.

  2. If you want to profiling data for only one thread, then you have to:

    • have /GLOBALON and /PROCESSOFF for all processes except for the one process with the thread you want to profile. The process you want to profile must have its profile state set to /PROCESSON;

      - and -

    • have /THREADOFF for all other threads in that process containing the thread you want to profile;

      - and -

    • /PROCESSON for the process containing the thread you want to profile;

      - and -

    • /THREADON for the thread you want to profile.

  3. Because these operations are an AND operation, setting /GLOBALON will never turn on profiling for processes or threads which have /PROCESSOFF and /THREADOFF set to off.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft