Understanding Instrumentation Data Values in Profiling Tools

The instrumentation profiling method of the Visual Studio Team System Developer Edition Profiling Tools injects code at the start and end of target functions in the profiled binary, and before and after each call by those functions to other functions.

The injected code records:

  • The interval between this collection event and the previous one.

  • Whether the operating system has performed an operation during the interval. For example, the operating system might read or write to disk, or switch between the target thread and another thread in another process.

For each interval, the profiler analysis reconstructs the call stack that was present at the end of the interval. A call stack contains information about the functions that are active on a thread at a point in time. Only one function (the current function) is executing code; the other functions are the chain of function calls that resulted in the calls to the current function (the call stack).

For each function on the call stack when the interval was recorded, the profiler analysis adds the interval to one or more of four data values for the function. The analysis adds the interval to a data value for a function based on two criteria:

  • Whether the interval occurred in the body of the function or in a function that was called by the function.

  • Whether an operating system event occurred in the interval.

The data values for an interval of a function or data range are named Elapsed Inclusive, Elapsed Exclusive, Application Inclusive, and Application Exclusive.

  • All intervals of a function are added to the Elapsed Inclusive data value of the function.

  • If the interval occurred in the body of the function and not in a function called by the function, the interval is added to the Elapsed Exclusive data value of the function.

  • If an operating system event did not occur in the interval, the interval is added to the Application Inclusive data value.

  • If an operating system event did not occur in the interval, and the interval occurred in the direct execution of the function code (that is, the interval did not occur in a function), the interval is added to the Application Exclusive data value.

Profiling Tools reports the aggregate of the total values of the functions in the profiling session itself, and in the processes, threads, and binaries of the session. Time spent in code inserted by the profiler is not included.

Elapsed Inclusive Values

The total time that was spent executing a function, including time that was spent in functions called by the function.

Elapsed Inclusive values include the intervals spent directly executing the code in the function body and the intervals spent executing the functions called by the target function. Intervals of the function or its called functions that include waiting for the operating system are also included in Elapsed Inclusive values.

Elapsed Exclusive Values

The time that was spent executing the code in the function body, excluding time that was spent in functions that were called by the function.

Elapsed Exclusive values include the intervals that were spent executing the code in the function body, regardless of whether an operating system event occurred in the interval. Intervals spent in functions that were called by the target function are not included in Elapsed Exclusive values.

Application Inclusive Values

The time that was spent executing a function, including functions called by the function, and excluding time that was spent in operating system events.

Application Inclusive values do not include intervals that contain operating system events. Application Inclusive values include all other intervals spent executing a function, regardless of whether the interval was spent directly executing the code in the function body or was spent in functions called by the target function.

Application Exclusive Values

The time that was spent executing the code in a function body, excluding the time that was spent in functions that were called by the function and the time that was spent in operating system events.

Application Exclusive values do not include intervals that contain operating system events or intervals that were spent executing functions called by the function. Application Exclusive values include only those intervals that were spent directly executing the function code and that did not contain an operating system event.

Elapsed Inclusive Percent

The percentage of the total Elapsed Inclusive values of the profiling session that was Elapsed Inclusive values of the function, module, thread, or process.

100 * Function Elapsed Inclusive / Session Elapsed Inclusive

Elapsed Exclusive Percent

The percentage of the total Elapsed Inclusive values of the profiling session that was Elapsed Exclusive values of the function, module, thread, or process.

100 * Function Elapsed Exclusive / Session Elapsed Inclusive

Application Inclusive Percent

The percentage of the total Application Inclusive values of the profiling session that was Application Inclusive values of the function, module, thread, or process.

100 * Function Application Inclusive / Session Application Inclusive

Application Exclusive Percent

The percentage of the total Application Inclusive values of the profiling session that was Application Exclusive values of the function, module, thread, or process.

100 * Function Application Exclusive / Session Application Inclusive

See Also

Tasks

How to: Choose Collection Methods

Other Resources

Analyzing Profiling Tools Data