ktf/igprof — pull request #4 by mkurkela (2012-07-19 09:24:42+00:00)
Title: Function profile with options -fpi:FUNCTION:LIB, -fpf:FUNCTION:LIB and -fp:malloc:LIB

Function profile with options -fpi:FUNCTION:LIB, -fpf:FUNCTION:LIB and -fp:malloc:LIB

LIB option can be ignored, for example "-fp:malloc" or "-fp:malloc:". When no library is specified and symbol will be looked up from main program, if no hit, symbol will be looked with dlsym(RTLD_NEXT,
FUNC), which search match from libraries and first match will be hooked. If LIB is given function are hooked like dual hook. First hook without using LIB=0 and 2nd with specified library.

if option "-fp:malloc:LIB" is used, malloc like functions (realloc,calloc,..) are hooked like before with option "-fp malloc". Before supported option "-fp free" is removed and same can be done now with "-fpi:free:LIB"

-fpi:FUNC:LIB is used to hook functions, which pass return trough %rax
-fpf:FUNC:LIB is used to hook functions, which pass return trough %XMM0
If one uses -fpf when -fpi would be correct, or other way round, result can be unexpected.

Functions that pass/returns arguments via stack are not supported.