Restricting Instrumentation
Performance Validator provides the ability to instrument classes according to class name, class and method name and function name. Performance Validator allows you to specify if the classes, methods and functions identified by the filter are instrumented or excluded from the instrumentation process.
This facility can be used to tailor you performance analysis to the exact part of your application that is of interest. For example you may have an application with many thousands of lines of code, but only want to analyse the performance of a binary tree class that is used throughout the application. This can be acheived very simply.
Instrumenting only specific classes, methods and functions
This tutorial demonstrates how to instrument the methods of a named class, ignoring all methods in all other classes and all functions not associated with a class.
- Open the settings dialog by clicking the tools icon on the toolbar.
- The Settings Dialog is displayed. Select the Class and function filter tab.
- Select the Only hook classes, methods and functions shown in the list below radio box.
- Click the Add… button, then type CMainFrame:: in the edit field. This specifies that any method in the CMainFrame class will be instrumented.
- On the Performance tab, choose the Time Stamp Counter option. This option causes Performance Validator to instrument your application and to time various operations using the processor’s time stamp counter. If you do not want to use the time stamp counter you can choose one of the other instrumentation options.Note: You cannot perform selected data collection when in sampling mode, you must choose one of the instrumentation modes.
- Click OK to accept the settings.
- Launch the sample application. Click on the relaunch icon on the toolbar to relaunch the most recently launched application.
- Using the sample application, select the Sort menu and choose Quick Sort.
- Using the sample application, select the Sort menu and choose Comb Sort.
- Using the sample application, select the Sort menu and choose Heap Sort.
- Using the sample application, select the Sort menu and choose Merge Sort.
- Using the sample application, select the Sort menu and choose Bubble Sort.
- Close nativeExample.exe using the File menu Exit command. The application closes. Performance Validator processes any remaining data and displays the final results.
- Click the Refresh All icon on the toolbar.
- Examining the Statistics, Relations, Call Tree tabs you can see that the only performance data available is for the methods of class CMainFrame.
Preventing certain classes, methods and functions from being instrumented
This tutorial demonstrates how to instrument all methods and functions in an application except for the methods of a named class.
- Open the settings dialog by clicking the tools icon on the toolbar.
- The Settings Dialog is displayed. Select the Class and function filter tab.
- Select the Don’t hook classes, methods and functions shown in the list below radio box.
- Click the Add… button, then type CMainFrame:: in the edit field. This specifies that no methods in the CMainFrame class will be instrumented.
- On the Performance tab, choose the Time Stamp Counter option. This option causes Performance Validator to instrument your application and to time various operations using the processor’s time stamp counter. If you do not want to use the time stamp counter you can choose one of the other instrumentation options.Note: You cannot perform selected data collection when in sampling mode, you must choose one of the instrumentation modes.
- Click OK to accept the settings.
- Launch the sample application. Click on the relaunch icon on the toolbar to relaunch the most recently launched application.
- Using the sample application, select the Sort menu and choose Quick Sort.
- Using the sample application, select the Sort menu and choose Comb Sort.
- Using the sample application, select the Sort menu and choose Heap Sort.
- Using the sample application, select the Sort menu and choose Merge Sort.
- Using the sample application, select the Sort menu and choose Bubble Sort.
- Close nativeExample.exe using the File menu Exit command. The application closes. Performance Validator processes any remaining data and displays the final results.
- Click the Refresh All icon on the toolbar.
- Examining the Statistics, Relations, Call Tree tabs you can see that the performance data does not include any reference for the methods of class CMainFrame.