Bill Randerson
Bill Randerson

Reputation: 1088

How to profile functions with name pattern using GCC/clang?

Option "-pg" for gcc instruments all the functions in the compiled units, which impose too much overhead for large projects. Is it possible to only instrument a subset of functions based on function name pattern for example? There are suggestions like hooking all functions, but filtering passed-in function address and use addr2line to find out the function name. This is theoretically possible, but doesn't seem to be scalable.

Upvotes: 1

Views: 175

Answers (1)

bruno
bruno

Reputation: 32594

Perhaps you can use Callgrind, it is possible to not activate the profiling during all the execution, see options

Upvotes: 0

Related Questions