ckrause / loda

LODA is an assembly language, a computational model and a tool for mining integer sequence programs.
Apache License 2.0
20 stars 5 forks source link

Call graph stats and visualization #76

Closed ckrause closed 3 years ago

ckrause commented 3 years ago

It would be great to know more about which program call which other programs. We should generate a new csv file as part of our stats that has two columns: first column is the id of the caller, second the id of the callee. In addition we could generate a DAG visualization using graphviz.

Here a proposal:

  1. extend Stats class with a std::multimap<size_t,size_t> to store the dependency graph.
  2. extend Stats::save to save it to a new file, e.g cal_graph.csv or something similar.
  3. add a parameter to Stats::updateProgramStats to pass in the Sequence ID of the program
  4. extend Stats::updateProgramStats to fill the multimap using the new parameter and the second operand of the cal operations

You can run loda maintain to regenerate the stats. You should see log message that show the progress. It should take no more than 30 secs. You can abort the rest of the maintenance.

After we generated the new stats, we want to create a graph visualization using graphviz/dot. We want to extend make_charts.sh to do this automatically.

neoneye commented 3 years ago

Here is a ruby script that extracts the dependencies of programs. It outputs a csv file with these columns: program id;dependency count;program ids. This script can be changed to invoke the loda executable.

Here is another ruby script that determines what are the most called programs. It outputs a csv file with these columns: callee program id;dependency count;caller program ids.

A third script can be made that does the visualization.

ckrause commented 3 years ago

I also added a generated CSV file and a visualization of the graph into the stats folder. Closing this ticket.