Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3795662
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:07:05+00:00 2026-05-19T13:07:05+00:00

I’m trying to add performance counters and custom events to a piece of software,

  • 0

I’m trying to add performance counters and custom events to a piece of software, so that I can view these using Windows Performance Toolkit programs such as XPerf and GPUView.
I am going to refrain, using all my powers of restraint, from launching into a cathartic rant regarding the state of the documentation for the software and the time I’ve now wasted trying to tease clues from the web. I’m going to describe how I got to where I am now, just in case this is of use to other lost souls.

So far, I’ve gathered that I have to write an Event manifest for my performance counters and events. You can do this by hand or by using a tool called ‘ecmangen.exe‘. The documentation for that program gives a nice step by step guide for event creating manifests but doesn’t explain how to integrate these with your code.

The next step, as far as I can work out, is to use two cryptic command line applications ‘MC.exe‘ and ‘CTRPP.exe‘. These seem to generate C or C# headers, source and resource files for adding event and counter instrumentation to your code, respectively.
Next, you have to build your code (look at the samples in ‘C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\winbase\Eventing’) and then we come to where I’m currently stuck: the correct use of the next cryptic tool ‘wevtutil.exe‘

This tool needs two things: the binary (exe or DLL) that you’ve compiled with those resources in it and the manifest file you used to generate those resources. The trouble I’m having is that it’s very picky about where the binary file is and I’ve been unable to determine the form of this pickiness. Incantations and goat sacrifices have yielded no results.

If I have a path defined in the ‘resourceFileName’ field of the ‘provider’ tag in the manifest file such as ‘c:\MYDIR\TEd.exe’ then it is fine. If, however, I put the same exe in a different folder (one that failed was C:\tw\TEd.exe), it complains.

The error message given is ‘Warning: Publisher TEd-Event-Provider resources are not accessible.’ but no more explanation as to why, or where it tried to look.

So, am I going about adding instrumentation in the wrong way, is there already a guide that explains all the gotchas and what is the nature of ‘wevtutil.exe’s strange selectivity towards directory names.

Thanks in advance,

Tim.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:07:05+00:00Added an answer on May 19, 2026 at 1:07 pm

    I’ve just had exactly the same message, and struggled for an hour to resolve it, before I had a brainwave and read the error msg ;-).

    The solution to my problem was simply to add the “.rc” file to my project, and then re-build. Looking back it is fairly obvious, but it had me stumped for a while.

    Hope this helps.


    Edit – 4th Feb
    Ok, not too sure if I know what your problem is, but the following batch script is how I did it all. Good luck.

    rem -------------------------------------------------------------------
    rem Do all of this from the project directory
    
    rem -------------------------------------------------------------------
    rem Generate Header and Resource - remove the ReadOnly attrib to "help" it along
    attrib -r MyModuleTracing.h
    mc.exe -um MyModuleTracing.xml
    rem This generates MyModuleTracing.h and MyModuleTracing.rc, add both to your project
    
    rem -------------------------------------------------------------------
    rem ** Now build the project **
    rem -------------------------------------------------------------------
    
    rem Register MyModule Tracing with the system
    if exist MyModuleTracing.xml (
      wevtutil um MyModuleTracing.xml
    
      copy MyModuleTracing.xml Release
      cd Release
      copy MyModule.dll %SystemRoot%\System32
      wevtutil im MyModuleTracing.xml
    )
    
    rem -------------------------------------------------------------------
    rem Do a capture, and also export the results to an XML file.
    xperf -start MyModuleSession -on [REPLACE_WITH_YOUR_GUID] -f MyModuleSession.etl
    xperf -on base -f Kernel.etl
    
    rem Run the app, wait until exit, and then stop the capture
    start /wait MyModule.exe
    
    xperf -stop
    xperf -stop MyModuleSession
    xperf -merge MyModuleSession.etl Kernel.etl MyModuleSessionMerged.etl
    
    tracerpt MyModuleSessionMerged.etl -o MyModuleSessionMerged.xml -of XML
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.