A graph is usually associated with some nice graphical presentation.
Yet The VTune? for Linux (Command Line) has no
graphical utilities to show the call graph.
On first glance, that might seem like a definite
missing feature. But it might not be.
In this small article I?ll try to convince you that
text representation for call graph is powerful
enough to get quick and meaningful results.
Use scripts to collect data
The great news for The VTune? for Linux (Command Line)
is ? Command Line Interface. Actually that means one
can script everything. You may create different
activities that check different program paths in your
application. Run these activities, get the results and
save them in files. All these operations can be performed
in one simple script, which will run unattainable.
Look at this example.
TIP: Use excessive output. Vtl application has
numerous switches to give the user the exact information
he/she requires. E.g. it is possible to get the
information about one specific function.
But I recommend using the excessive approach,
i.e. to get all available info about all functions or
calls (use flags ?functions/-calls).
Dump this information to file and later on filter
for specific function(s).
Analyzing the results
Now use all your Linux favorite commands and applications
like ?tail?, ?awk?, ?perl? etc. to get the most of the
data dumped in file. The output files are tables, with
semi column used. The number of the column is printed in
it?s header. Here are some examples :
Comparing results
After doing some changes in your code, run the collection
a second time and dump result to files again. I attach a
small ?perl? script ?cmp? which compares 2 files with
function lists and prints out the functions with number
changes,
To use this script, supply 2 files and the column number, like:
Enjoy the text surfing of the cal
l graph!


