bofh19 / yappi

Automatically exported from code.google.com/p/yappi
MIT License
0 stars 0 forks source link

Yappi should be able to measure CPU time also #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Yappi shows wall-clock time. It should have a mode for CPU time (to exclude 
IO-based delays from measurement)

Hacky environment-variable-based Linux patch for this:

https://gist.github.com/1846970

Original issue reported on code.google.com by vi0...@gmail.com on 16 Feb 2012 at 6:50

Attachments:

GoogleCodeExporter commented 9 years ago
Exactly, I already have a branch for this. You can check out the branch from 
bitbucket page. Branch name is native-perthread

Original comment by sum...@gmail.com on 20 Feb 2012 at 2:09

GoogleCodeExporter commented 9 years ago
What I want to accomplish is to have a way of getting thread times independent 
of the underlying OS. 

On Windows:
GetThreadTimes()

On Linux(since 2.6.0(2004)):
/proc/[your PID]/task/[thread ID]/stat
Reading proc value from Linux(instead of clock_gettime()) avoids the librt 
dependency during compile and seems more portable.

On MacOSX:
Someone implemented a sample here:
http://stackoverflow.com/questions/6788274/ios-mac-cpu-usage-for-thread

So, once these are all implemented and tested, we will have a accurate 
multithreaded profiler.

Original comment by sum...@gmail.com on 20 Feb 2012 at 3:10

GoogleCodeExporter commented 9 years ago
fixed in v0.62. Tested on Solaris, MACOsx, several Linux distros and Windows...

Original comment by sum...@gmail.com on 6 Mar 2012 at 6:26