I think it's called profiling or call-graphing.

gprof and gcov (linux)

and this:
http://kcachegrind.sourceforge.net/cgi-bin/show.cgi/KcacheGrindIndex