Event Tracing



Event Tracing for Windows (ETW) is a technique for obtaining diagnostic information about code that is currently running, without the overhead of a checked build or use of a debugger. An event represents any discrete activity that is of interest, especially with respect to performance.

With Microsoft Surface ETW, a developer or administrator can troubleshoot touch input by obtaining details about touch events, manipulations, touch capture state, and basic behavior of Surface controls.

Enabling ETW Logging

Before you can retrieve information about your application, you must enable ETW logging.

To enable ETW logging

  1. Open Windows Event Viewer.

  2. Expand the Applications and Services Logs node.

  3. Expand the Microsoft node, expand the Surface node, and click the Presentation node.

  4. If the analytic and debug logs are not showing, on the View menu, click Show Analytic and Debug Logs.

  5. Double-click the Debug node.

  6. On the Action menu, click Enable Log.

  7. Double-click the Performance node.

  8. On the Action menu, click Enable Log.

After you enable logging, run your application. As events occur in your application, they are logged to the event viewer. When you are ready to stop logging, double-click the appropriate log and then click Disable Log on the Action menu.

Event Tracing Using Logman.exe

You can also use logman.exe (included with the Windows 7 operating system) to obtain information about events that occur in your Surface application.

To begin logging using Logman.exe

  1. Open a Command Prompt window with elevated privileges.

  2. Type the following command:

    logman start mysession -p {4e73a680-ae16-44f4-a0df-be95d075b155} -o c:\mytrace.etl -ets
    
    noteNote
    {4e73a680-ae16-44f4-a0df-be95d075b155} is the identifier for the Microsoft Surface Presentation event provider.

  3. Run your application.

As events occur in your application, they are logged to the specified file, c:\mytrace.etl. When you are ready, stop the logging.

To stop logging with Logman.exe

  1. At the command prompt, type the following command:

    logman stop mysession -ets
    

The log file created by logman.exe is not in a human-readable format. If you want to view the trace file results, when you have completed your event tracing, you must convert the trace file to another format.

To convert the trace file to another format

  1. At the command prompt, type the following command:

    tracerpt c:\mytrace.etl
    

By default, tracerpt.exe converts the trace file to XML format. For more options, type the following command:

tracerpt /?

Did you find this information useful? Please send us your suggestions and comments.

© Microsoft Corporation. All rights reserved.
Show: