eclipse-linuxtools / org.eclipse.linuxtools

Eclipse plugins integrating Linux technologies - Docker, SystemTap, Kernel Perf, Valgrind, GGov, GProf, Vagrant, RPM, ...
Eclipse Public License 2.0
12 stars 17 forks source link

Is it possible to draw callgraph for gprof output gmon.out using linuxtools callgraph plugin #350

Open fanghuaqi opened 3 months ago

fanghuaqi commented 3 months ago

Hello, I see gprof also provide call graph features but its call graph is just show in excel like format, which cannot render as a graph which provided by systemtap callgraph plugin as described https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.linuxtools.callgraph.docs%2FLinux_Tools_Project%2FCallgraph%2FUser_Guide%2FGeneral-Usage2.html

image

Is it possible to use the gprof parsed call graph to draw call graph using this plugin, can somebody give me some hints about how to achieve it.

There is a python script https://github.com/jrfonseca/gprof2dot to draw call graph using gmon.out like this below, I think it might be possible to achieve same effect using existing linux tools's callgraph plugin

image

Thanks

fanghuaqi commented 3 months ago

Could someone help me with this issue, if it is possible, we can help to implement it by reuse this

jjohnstn commented 3 months ago

Hello @fanghuaqi The Callgraph plug-in is configured to use SystemTap data so no, you can't just ask it to read gprof data. That said, you could start by copying the linuxtools/systemtap/org.eclipse.linuxtools.callgraph code and modifying the content providers etc. I would suggest start with the StapGraph.java code and creating a new content provider. You will have to look if you can reuse the data format of the StapTreeContentProvider which obviously would save a lot of work. From there, you can work at changing things as needed or deleting them if they don't apply.

Unfortunately, Linux Tools is in maintenance mode which means we don't have coding resources to allocate to help you in a major feature addition. We can help you via answering questions and we can also help you to get your code into the Linux Tools repo and simrel offerings.

fanghuaqi commented 3 months ago

Hi @jjohnstn , thank you for your explanation, we will investigate it under your suggestion. By the way, since this tool is maintenance mode, do you know is there any other performance analyze tools in eclipse cdt environment?

jjohnstn commented 3 months ago

Hi @fanghuaqi I don't know of any off the top of my head. We still maintain the tools (e.g. we have updated gprof/gcov tools to handle new gcc and we have recently updated Docker Tooling to support the latest version of Docker). We just don't have resource allocation to do major work such as create a new plug-in or work on a major feature addition to an existing plug-in. We are always happy to accept contributions.

fanghuaqi commented 3 months ago

Hi @jjohnstn, thanks, we will take a look at how to enable gprof call graph feature in eclipse linux tools repo.