ASM Code, CPU Utilization, per CPU

Reply

Join Date: May 2009
Posts: 2
Reputation: Chizl is an unknown quantity at this point 
Solved Threads: 0
Chizl Chizl is offline Offline
Newbie Poster

ASM Code, CPU Utilization, per CPU

 
0
  #1
May 28th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 949
Reputation: MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice 
Solved Threads: 92
MosaicFuneral's Avatar
MosaicFuneral MosaicFuneral is offline Offline
Posting Shark

Re: ASM Code, CPU Utilization, per CPU

 
0
  #2
May 30th, 2009
I know there's at least two on Codeproject that show up right away on Google.
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 2
Reputation: Chizl is an unknown quantity at this point 
Solved Threads: 0
Chizl Chizl is offline Offline
Newbie Poster

Re: ASM Code, CPU Utilization, per CPU

 
0
  #3
May 31st, 2009
Originally Posted by MosaicFuneral View Post
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?
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 129
Reputation: Evenbit is on a distinguished road 
Solved Threads: 4
Evenbit's Avatar
Evenbit Evenbit is offline Offline
Junior Poster

Re: ASM Code, CPU Utilization, per CPU

 
0
  #4
Jun 1st, 2009
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!
while (CPU is present) {some assembly required}
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC