How to create Trace (ETW) Provider Logs for Windows Component Debugging Using Perfmon?
In some scenarios we have timeouts or issues waiting on code execution from different windows components and cannot catch the exceptions.
This document describes step by step how you can create a Trace Log using Perfmon in order to get Event Tracing for Windows traces of different components.
Step-by-step guide
- Press 'Win' + R and type 'Perfmon' to start 'Perfmon'
- Click on the 'User Defined' folder under 'Data Collector Sets'
- Click on the 'New Data Collector' icon
- Name your 'Collector' and select 'Create manually' (Advanced)
- Press 'Next'
- Check the 'Event trace data checkbox'
- Press 'Next'
- Click 'Add next' to 'Providers'
- Select your providers from the list and press 'OK'. You can add multiple ones
-
Select the provider from the list and edit the 'Properties' by pressing 'Edit' next to each one. Leave them as the default and this will collect all the information
-
Provider Properties
Each provider has a set of 5 properties. All of these can be explored with the WPExplorer which reads the provider metadata: Windows Events Providers Explorer
- Keywords(Any) - Filter messages containing any of the keywords from that provider and direct them into the trace
- Keywords(All) - Filter messages containing All of the keywords from that provider and direct them into the trace
- Level
- LogAlways (0x0)
- Critical (0x1)
- Error (0x2)
- Warning (0x3)
- Information (0x4)
- Verbose (0x5)
- Properties - optional ETW properties that can be specified when writing the event.
- Filter - Additional filtering
- Press 'Next'
- Select where the data will be saved. Make sure the user under which the provider will run has access to that folder path
- Press 'Next'
- Select an user under which the 'Data Collector' set will 'run'. Note this user needs access if you're monitoring processes or services outside of the user's session or privileges. If possible use a Local Administrator user account
- Select 'Start' this data collector set now and press 'Finish'
- Click on the 'Data Collector' under 'User Defined'. Press the 'Play' button to start collecting
- Replicate your problem
- Open 'Perfmon' after replicating the issue and click the collector under the 'User defined'. Press 'Stop' to stop collecting
- The logs (.etl) will be in the Output folder
- You can use PerfView or EventViewer to view the logs.