How to: Limit Instrumentation to Specific Functions
You can limit instrumentation and data collection to one or more functions by setting options in the Advanced page of the Performance Session or target binary property pages.
If you specify the functions on the performance session property page, only those functions are instrumented in all instrumented binaries of the session.
If you specify the functions on the property page of a target binary, only those functions that are in that particular binary are instrumented. Functions in other binaries of the performance are instrumented as usual.
Limiting data collection in this manner is only supported when the instrumentation profiling method is selected.
Note
You can also use the Advanced page of the Performance Session property pages to set other options that are available to the Profiling Tools VSInstr command line instrumentation tool.
To limit instrumentation to specific functions in a performance session
In Performance Explorer, right-click the session name and then click Properties.
The Property Pages dialog box is displayed.
On the Property Pages dialog box, click Advanced.
In the Additional instrumentation options text box, use the following syntax to type the name of the functions that you want to instrument:
/include:FuncSpec[;FuncSpec]...
FuncSpec is the namespace and function name. It has the format Namespace**::**FunctionName. Use a semicolon to separate multiple functions. Use an asterisk (*) to specify a wildcard for one or more characters. For example, /include:MyNS::* specifies all functions in the MyNS namespace.
Note
To list the functions in a binary, open a command prompt window in the Profiling Tools installation directory (typically, the \Team Tools\Performance Tools directory under the Visual Studio Team System installation directory) and then type vsinstr /DumpFuncs
To limit instrumentation to specific functions in a binary
In Performance Explorer,locate the binary name in the Targets node of the performance session.
Right-click the binary name and then click Properties.
The Property Pages dialog box is displayed.
On the Property Pages dialog box, click Advanced.
In the Additional instrumentation options text box, use the following syntax to type the name of the functions that you want to instrument:
/include:FuncSpec[;FuncSpec]...
FuncSpec is the namespace and function name. It has the format Namespace**::**FunctionName. Use a semicolon to separate multiple functions. Use an asterisk (*) to specify a wildcard for one or more characters. For example, /include:MyNS::* specifies all functions in the MyNS namespace.
Note
To list the functions in a binary, open a command prompt window in the Profiling Tools installation directory (typically, the \Team Tools\Performance Tools directory under the Visual Studio Team System installation directory) and then type vsinstr /DumpFuncs
See Also
Tasks
How to: Limit Instrumentation to Specific DLLs
How to: Specify Additional Instrumentation Options