I have a C ++ written package. Linux, gcc. I can change the compilation process (change the Makefile, flags, etc.), but may not change the source code in C ++.
One launches a package with different parameters, performs a task, and exits.
How to count :
1) The number of function calls with a specific name?
2) The number of function calls with a specific signature?
3) The number of function calls when one of the parameters has a particular type ie std :: string (the type is specified by the signature)?
4) and an additional number of function calls to STL objects, i.e. std :: string copy constructor?
(I mean counting the number of calls during the run.)
I thought about doing it with GDB, but it was very difficult for me to do it (1) and did not find how to do it (2) - (4) in general.
All acceptable answers I will write here for humanity.
source
share