Visualize call tree of a C function

Requirement

You want to visualize a call hierarchy of a C function.

Solution

Utilities you need are listed below:

Take ‘rdbSaveBackground’ (redis/rdb.c) for example:

cflow --format=posix --omit-arguments --level-indent='0=\t' --level-indent='1=\t' --level-indent=start='\t' -m 'rdbSaveBackground' ~/osprojects/redis/src/rdb.c | cflow2dot | dot -Tjpg -o rdb.jpg

Output:
visualization of a call tree

Source: unix diary

The post is brought to you by lekhonee v0.7