[OpenSTA-devel] Re: [ opensta-Bugs-1084184 ] Incorrect CPU usage collection when monitoring HT
Brought to you by:
dansut
From: Daniel S. <dansut@OpenSTA.org> - 2004-12-20 20:18:51
|
Hi Joe, It's almost amusing that Shahar posted this bug report now - Just before you posted I had been doing some investigating which triggered my memory of you reporting the problem on the users list and providing the fix here. I am just about to update Shahar's bug report to report the problem as you describe it (clipping to 100%) rather than Shahar's symptom description. This should reiterate the importance of reporting problems as SF bugs though - there was a chance that I would have forgotten about Joe's fix and it wouldn't have made it into the upcoming release... Shahar Kedar wrote... > > The problem is that the machine on which the process ran, is using > > a hyper threding CPU. This means that I get 100% for that process, > > although in reality it takes only 80% or less. My guess is that > > OpenSTA collected the information from only 1 "virtual processor". > > > > I checked the behavior of the Windows Performace tool, and it gives > > a more reliable number (between the range of 0% and 160%). > > > > Can anyone provide me with a workaround? Can this behavior be > > fixed? Joe Robertson wrote: > See my submission to the development list Fri 5/9/2003 11:15 AM. > > The solution requires a change to the OpenSTA source code in > ..\src\NTPerf\Executers\NTPerf\ntp.cpp then rebuilding OpenSTA > (at least the TEexecuter_ntp.exe). This tells the Windows > Performance gathering mechanism not to cap the %CPU at 100% > (by ORing PDH_FMT_NOCAP100 with PDH_FMT_LONG). > > The original code segment (from ..\src\NTPerf\Executers\NTPerf\ntp.cpp) > is: > pdhStatus = PdhGetFormattedCounterValue( m_hCounters[iIndex], > PDH_FMT_LONG, NULL, &value ); > I changed the above line to read: > pdhStatus = PdhGetFormattedCounterValue( m_hCounters[iIndex], > PDH_FMT_LONG | PDH_FMT_NOCAP100, NULL, &value ); I still have some worries about including this fix into the upcoming 1.4.3 release. I mentioned my concerns on the users list when you initially detailed this issue and your fix and no-one seemed to care so I'll most likely drop it in now - especially now it has a bug report. As a last ditch attempt to see if anyone has any objections here before I commit the change: Removing the clipping will potentially change results and so "spoil" the possibility of comparing results from test runs pre-1.4.3 to those afterwards. Normally I would say this isn't acceptable - especially as you can work around this by logging the percentage values seperately and total yourself... My preferred solution would be not to change the default behavior but to add a switch to get the "correct" updated behavior. Does anyone else care, or have any thoughts on this or similar situations? > Hope this helps, It probably won't help Shahar as I don't think he's on the developer list, but he should get the message when I update his bug report... Cheers /dan -- Daniel Sutcliffe <DanSut@OpenSTA.org> OpenSTA part-time caretaker - http://OpenSTA.org/ |