Callgrind
Callgrind is a profiling tool from the Valgrind instrumentation framework designed to profile program execution by producing a call graph and per-function cost information. It records how many times each function is called and how many machine instructions are executed within each function, providing both a self cost and a cumulated cost across callers. The data are generated during a Valgrind run and stored in a file named callgrind.out.pid, which can be analyzed with visualization tools.
Callgrind works by instrumenting the program at runtime through Valgrind’s IR, intercepting function entries and exits
Usage typically involves running the program under Valgrind with the tool specified, for example valgrind --tool=callgrind
Limitations include substantial runtime overhead and the need for debug information for precise source-level reporting. Callgrind