Reputation: 1753
Is it possible to print a list of all functions used during a program run? The program and the library used by the program is compiled with GCC without optimization.
The reason for this list is that I'd like to optimize a library which has a lot of unused functions (the library is really huge and I need only a few functions).
Upvotes: 0
Views: 175
Reputation: 94165
gcov
(compile with gcc -ftest-coverage -fprofile-arcs
) will say this too.
Upvotes: 0
Reputation: 27571
If its dynamic library (*.so
) try ltrace
. For example to see how ls
uses libc
:
ltrace --library /lib64/libc.so.6 ls
gprof
can be an option too.
Upvotes: 1