http://bugs.winehq.org/show_bug.cgi?id=26785
Summary: SIV incorrectly reports the same CPU time usage for all it's threads Product: Wine Version: 1.3.17 Platform: x86 URL: http://rh-software.com/ OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: ray@pobox.co.uk
Created an attachment (id=34125) --> (http://bugs.winehq.org/attachment.cgi?id=34125) Screen Image showing the same CPU time for all threads
I thought this was a bug in SIV and have been trying to fix it, but it transpires that GetThreadTimes() is implemented by Wine using the times() function which returns the process rather than the thread CPU times.
The code is line 942 in ntdll/threads.c and is times(&time_buf);
I would like to try and generate a patch to fix this, but I have thus far failed to find a portable *nix function to use. Please can someone point me in the right direction?
http://bugs.winehq.org/show_bug.cgi?id=26785
ray@pobox.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=26785
--- Comment #1 from Ken Sharp kennybobs@o2.co.uk 2011-04-15 07:47:31 CDT --- How do you access this window?
Don't know if it's related but SIV reports 100% CPU usage across the board on my machine, which is currently idling.
http://bugs.winehq.org/show_bug.cgi?id=26785
--- Comment #2 from ray@pobox.co.uk 2011-04-15 08:38:55 CDT --- (In reply to comment #1)
How do you access this window?
Don't know if it's related but SIV reports 100% CPU usage across the board on my machine, which is currently idling.
Menu->Edit->STC Info, sorry I should have stated this.
You can use Menu->Edit->View Menus to find most things.
Which version of SIV are you using? if not 4.19 please see if 4.19. I really need to see a screen shot to have any chance of knowing why it should be 100% and ideaaly with System Monitor there as well. This will also tell me the Linux and Wine versions. This is unlikely to be related.
I have learnt that times() used to report thread times and this was fixed by the 2.6.9 kernel.
http://bugs.winehq.org/show_bug.cgi?id=26785
--- Comment #3 from ray@pobox.co.uk 2011-04-15 08:53:55 CDT --- I have updated the code as follows, but do know know how to add "-lrt" to the link of ntdll.dll.so. I expect this will only be possible on some targets and I also don't know how to update the build system for this. Please can someone help me?
/* We can only (portably) do this for the current thread */ if (handle == GetCurrentThread()) { struct timespec spec_buf;
/* are thread times available ? */
if( ( sysconf( _POSIX_THREAD_CPUTIME ) ) && ( !clock_gettime( CLOCK_THREAD_CPUTIME_ID, &spec_buf ) ) ) { /* yes, but no kernel time, so just return user time */
kusrt.KernelTime.QuadPart = 0; kusrt.UserTime.QuadPart = (ULONGLONG)spec_buf.tv_sec * 10000000 + spec_buf.tv_nsec / 100; } else { struct tms time_buf; long tick_time = 10000000 / sysconf( _SC_CLK_TCK );
/* call times(2) for kernel time or user time */
times(&time_buf);
kusrt.KernelTime.QuadPart = (ULONGLONG)time_buf.tms_stime * tick_time; kusrt.UserTime.QuadPart = (ULONGLONG)time_buf.tms_utime * tick_time; } }
http://bugs.winehq.org/show_bug.cgi?id=26785
--- Comment #4 from ray@pobox.co.uk 2011-04-15 09:16:45 CDT --- Created an attachment (id=34129) --> (http://bugs.winehq.org/attachment.cgi?id=34129) Screen Shot using the proposed fix
I changed Makefile.in and now my code links and runs. As you can see from the attachment the numbers are now sensible.
I just need to know how to deal with platforms which do not have clock_gettime().
http://bugs.winehq.org/show_bug.cgi?id=26785
--- Comment #5 from ray@pobox.co.uk 2011-04-15 11:07:09 CDT --- Created an attachment (id=34130) --> (http://bugs.winehq.org/attachment.cgi?id=34130) Test Version of SIV32X.exe
As of V1.3.17-320 wine has been fixed so that NtQuerySystemInformation( SystemProcessorPerformanceInformation ) includes the idle time in the kernel time. This caused SIV to incorrectly display 50% kernel time on all CPUs as it had an unconditional work-a-round. This test version only uses the work-a-round when it is needed.
The status of this issue is unchanged.
http://bugs.winehq.org/show_bug.cgi?id=26785
--- Comment #6 from butraxz@gmail.com 2013-11-24 11:57:49 CST --- This ticket has not been updated for over 900 days. Development recommends to check the status on your bug every release or two and let to be known if the bug is still present. If not, mark it fixed. If you are no longer able to put effort to this ticket, you can abandon it.
Is this still an issue with 1.7.7 or higher ?
https://bugs.winehq.org/show_bug.cgi?id=26785
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #7 from super_man@post.com --- (In reply to ray from comment #5)
Created attachment 34130 [details] Test Version of SIV32X.exe
As of V1.3.17-320 wine has been fixed so that NtQuerySystemInformation( SystemProcessorPerformanceInformation ) includes the idle time in the kernel time. This caused SIV to incorrectly display 50% kernel time on all CPUs as it had an unconditional work-a-round. This test version only uses the work-a-round when it is needed.
The status of this issue is unchanged.
It's not 50% anymore, but It feels like that the cpu utilization doesnt show correct values. They report constantly so low.
wine 1.9.12
https://bugs.winehq.org/show_bug.cgi?id=26785
--- Comment #8 from Ken Sharp imwellcushtymelike@gmail.com --- AFAICT this is still an issue with Wine 9.8