0
votes

I got my graph with using gprof,gprof2dot.py and Graphviz.However i want to access the information of how many nodes,edges there.

I compiled the code with profiling enabled , so after running the executable gmon.out was created. Then gprof ./xmltest ./gmon.out > result.txt result.txt contains generated flat profile and call graph information.

After that used this command gprof ./xmltest | ./gprof2dot.py | dot -Tpng -o result.png to create the visualized graph. However, i need the number of nodes and edges but i cannot access that info.

2
Please provide information about what you already did and why it dit not work for you. See the How to Ask page for help clarifying this question. - Harry

2 Answers

0
votes

Using gprof ./executable | ./gprof2dot.py > foo.dot , after that

gc foo.dot command returns the number of nodes and edges.

0
votes

You can get information from .dot file using graphviz gc tool. For example, assume that you have a graph file sample.dot

you can type the following:

gc -n -e sample.dot

this will return how many nodes and edges the graph in sample.dot has. a full reference on how can you write a gc command can found her