Collecting Call-Attributed Data (Windows Embedded Compact 7)

9/30/2011

You can collect call-attributed data by using the Remote Tools Framework profiler by adding instrumentation to the modules that you are interested in. You do not need to instrument all modules to collect data from profiling probes.

Note

The profiler does not collect data for fibers. When a thread converts to a fiber, data collection for the thread stops. The profiler continues to collect data for other threads.

The profiler uses the QueryPerformanceCounter function from the board support package (BSP) to obtain time stamp information. If the time stamp information that the BSP provides is not adequately granular, performance timing might not be accurate, especially for an application that runs for a short period of time.

The profiler supports the following combinations of instrumented and noninstrumented modules:

  • Instrumented .exe file and instrumented DLL files.
  • Instrumented .exe file and noninstrumented DLL files.
  • Noninstrumented .exe file and instrumented DLL files.

Note

Symbol information for a module that is dynamically loaded and unloaded in a process during a profiler run can become unavailable when another module is mapped into the same address space in the process.

There are two methods that you can use to insert profiling probes and add data collection control functions to your code.

  • Use the shipping compiler to instrument the module.
  • In Platform Builder, set an environment variable and then use the Platform Builder Build tool to instrument the module.

For more information about the two types of profiling probes, see Characteristics of FastCAP and CallCAP Probes.

To add instrumentation using the compiler

  1. To compile your code for profiling on x86 microprocessors, instrument the application with CallCAP probes by compiling with the /Gh compiler option.

    - or -

    To compile your code for profiling on other microprocessors, depending on the type of profiling probe that you want to use, you must use one of the following options.

    • To instrument the application with FastCAP probes, use the /fastcap compiler option.
    • To instrument the application with CallCAP probes, use the /callcap compiler option.

    For more information about the two types of profiling probes, see Characteristics of FastCAP and CallCAP Probes.

    To provide the most accurate profiling data, we recommend that you set the optimization options you will use in the application build you plan to release.

  2. To enable the profiler to properly resolve function names, you must explicitly set the name of the program database (.pdb) file using the /Fd compiler option.

    For more information regarding instrumentation errors, see Troubleshooting: Verifying Instrumentation.

To add instrumentation using the Platform Builder Build tool

  1. Open a Command Prompt build window by clicking the Build menu, and then clicking Open Release Directory in Build Window.

  2. To instrument the application with CallCAP probes, type the following command at the command prompt.

    set WINCECALLCAP=1 
    

    - or -

    To instrument the application with FastCAP probes, type the following command at the command prompt.

    set WINCEFASTCAP=1
    

    Note

    FastCAP probes are not available on x86 microprocessors.

    For more information about the two types of profiling probes, see Characteristics of FastCAP and CallCAP Probes.

  3. At the command prompt, type set WINCEREL=1.

    If you set the WINCEREL environment variable, the Build tool copies the built application to the release directory.

  4. At the command prompt, type set RELEASETYPE=local.

  5. Navigate to the directory that contains the sources file for the application that you want to instrument.

  6. At the command prompt, type build -c.

    At the end of the build process, the build window displays a BUILD: Done message, followed by a message that reports the number of files compiled.

    The file name and file name extension of the built application are determined by the values that you specified in the sources file in the directory that contains the application source code.

    For more information regarding instrumentation errors, see Troubleshooting: Verifying Instrumentation.

To collect call-attributed data

  1. Have your instrumented modules ready for profiling and make sure that the Remote Tools Framework profiler is open in the Remote Tools Framework Shell. For information about opening the profiler, see Remote Tools Framework Profiler.

  2. In the left pane of the Remote Tools Framework Shell, select the Collect New Data view.

  3. In the right pane, select Instrumented / Call-Attributed profiling.

  4. To start profiling, click Start.

  5. Perform the device scenario that you want to collect data.

  6. To stop profiling, click Stop.

    The profiler stops, and displays the results in the Analyze Collected Data view.

See Also

Tasks

Troubleshooting: Verifying Instrumentation

Reference

Remote Tools Framework Profiler

Concepts

Characteristics of FastCAP and CallCAP Probes