[CORE] profiler: fix code for SMP support.

This also add some interesting piece of information such as
some per caller statistics.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>