943,640 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 1021
  • Assembly RSS
May 28th, 2009
0

ASM Code, CPU Utilization, per CPU

Expand Post »
I'm a old C++ guy, so forgive my ignorance in ASM.. I'm having issues with getting CPU utilization through perfmon, because of a small memory leak in the pdh.dll after being called every 60 seconds for weeks on end. I then tried using MS typeperf.exe, but I found that EXE will return nothing at times and get into a state where it just will not return anything until the machine is restarted. So, I've decided to drop to a lower level and see if this can be done in ASM without these kinds of issues.

Anyone have a snippet they can part with to pull CPU Utilization per CPU within ASM?
Last edited by Chizl; May 28th, 2009 at 12:43 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Chizl is offline Offline
2 posts
since May 2009
May 30th, 2009
0

Re: ASM Code, CPU Utilization, per CPU

I know there's at least two on Codeproject that show up right away on Google.
Reputation Points: 888
Solved Threads: 114
Nearly a Posting Virtuoso
MosaicFuneral is offline Offline
1,270 posts
since Nov 2008
May 31st, 2009
0

Re: ASM Code, CPU Utilization, per CPU

I know there's at least two on Codeproject that show up right away on Google.
Realy? I can't seem to find any and google is where I found this place. I also had already done searches on codeproject, but with no luck. Mind posting a link?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Chizl is offline Offline
2 posts
since May 2009
Jun 1st, 2009
0

Re: ASM Code, CPU Utilization, per CPU

Microsoft has good C code with excellent descriptions at its Win32 API reference library:

http://msdn.microsoft.com/en-us/libr...78(VS.85).aspx

Click on the "Performance Counters Functions" category.

Calling the Windows API functions from assembly language is a bit more work than doing it in either C or C++, but it certainly isn't impossible and modern assemblers/packages support features that make the task easier.

You might need to make your own headers {with constant definitions, macros, function prototypes, etc.} for the more obscure API functions; but first, -- depending on which assembler/library/package you decide to go with -- you should check out the associated forums to see if headers already exist for the functions you want to use:

http://www.masm32.com/board/index.php?
http://www.asmcommunity.net/board/
http://www.artofasm.com/
http://board.flatassembler.net/

Hope I've helped!
Reputation Points: 99
Solved Threads: 5
Junior Poster
Evenbit is offline Offline
140 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Asm program help
Next Thread in Assembly Forum Timeline: i7 instruction costs





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC