gschlossnagle / yappi

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

Yappi to provide output in standard format #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Something I've used a lot during the past in order to profile my applications 
is Gprof2Dot [0], a tool that takes the output of one of many python profilers 
and generated a very nice PNG file with a tree-like structure of calls and CPU 
usage. 

This is *very* useful when profiling and I wanted to know if there is a way of 
exporting Yappi's output to something readable by Gprof2Dot. If not, how much 
effort would it take? I don't mind working a little bit on that if you guide me.

[0] http://code.google.com/p/jrfonseca/wiki/Gprof2Dot

Original issue reported on code.google.com by andres.riancho@gmail.com on 11 Apr 2012 at 9:01

GoogleCodeExporter commented 8 years ago

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

GoogleCodeExporter commented 8 years ago
I do not look into this very carefully, however from the example here: 
http://linuxgazette.net/100/misc/vinayak/overall-profile.txt, it seems
the crucial information here is the children functions called from a function. 
Currently yappi does not hold and show that information. To hold that 
information like gprof2dot expects, one shall modify the callstack.c file. 
Yappi uses a simple stack structure for measuring profiling info for functions, 
from there we can save the callee/caller function information somewhere. This 
can be done and not so hard to do. You can play with the callstack structure of 
yappi and save the callee info somewhere in the _pit(search the code) 
structure. The other fields seem trivial as we already have that those 
information somehow, we may need to convert to other (like total time 
percentage of the function). Basically, all we need to do is populate the _pit 
structure somehow with the fields that gprof2dot is expecting.

Original comment by sum...@gmail.com on 13 Apr 2012 at 6:42

GoogleCodeExporter commented 8 years ago
Thanks for the hint on where the code should be added. I'm adding this to my 
TODO list, I hope to start doing some experiments next week.

Original comment by andres.riancho@gmail.com on 16 Apr 2012 at 10:56

GoogleCodeExporter commented 8 years ago
This would be a great addition. 

Andres: if you do work on this in bitbucket, please share, I'd be willing to 
help out.

Original comment by doug.johnston on 20 Apr 2012 at 7:03

GoogleCodeExporter commented 8 years ago
Hi guys,

I have made the necessary changes for retrieving the children of the functions. 
See yappi.py:get_func_stats() in the latest commit. Now every function has a 
unique index and also a field named children that holds a list of 
integers(indexes) to other functions. We can play with this information to 
generate the file gprof2dot is expecting.

Original comment by sum...@gmail.com on 7 May 2012 at 9:20

GoogleCodeExporter commented 8 years ago
Sorry but I've been very busy lately, I won't be able to help out :(

Original comment by andres.riancho@gmail.com on 9 May 2012 at 12:16

GoogleCodeExporter commented 8 years ago
Just discovered yappi -- perfect tool for my necessities!

Is there progress on this feature? Would be great to use yappi with e.g. 
runsnakerun.

Original comment by thomas.wiecki on 6 Jun 2012 at 5:01

GoogleCodeExporter commented 8 years ago
Currently cannot find time to provide output for gprof2dot. OTOH, all necessary 
information is retrieved. We only need to somehow format them for our needs. As 
soon as I find some free time, I will try to implement this.

Original comment by sum...@gmail.com on 28 Jun 2012 at 1:00

GoogleCodeExporter commented 8 years ago
My order of preference, based on quality of tools:
Callgrind (qcachegrind)
cProfile (runsnakerun)
gprof (dot)

Original comment by dim...@gmail.com on 8 Aug 2012 at 1:23

GoogleCodeExporter commented 8 years ago
Hi,

I've implemented a function that outputs yappi's data in callgrind format, so 
that it is readable by [kq]cachegrind. It still has some bugs as the output 
doesn't look completely right, but it's getting there. Recursive functions for 
instance are not dealt with correctly. I'd be happy to hear any feedback, 
though!

My repo is at https://bitbucket.org/wackou/yappi

Original comment by wac...@gmail.com on 10 Nov 2012 at 7:07

GoogleCodeExporter commented 8 years ago
Good progress! I have sent an private message for you through bitbucket for the 
implementation. I will try to help you as soon as I find some time, though. 
Thanks.

Original comment by sum...@gmail.com on 12 Nov 2012 at 9:44

GoogleCodeExporter commented 8 years ago
I am still working on this one when I find time, currently the only feature 
left is to save the yappi statistics in PSTAT format. Every ncessary 
information is available only the saving part is left. Once this finishes, I am 
thinking to provide a new version.

Original comment by sum...@gmail.com on 27 Aug 2013 at 10:43

GoogleCodeExporter commented 8 years ago
pstat and callgrind formats available for saving results. implemented in v0.82.

Original comment by sum...@gmail.com on 7 Jan 2014 at 6:39