In order to gen call graph in perf:
-fno-omit-frame-butter
#Generate perf.data for executable perf record -g executable #0.5 is a filter?, caller is inverse the graph callstack perf report -g 'graph,0.5,caller'
Prevent optimizer to remove code:
static void escape(void *p){
asm volatile("" : : "g"(p) : "memory");
}
static void clobber(){
asm volatile("" : : : "memory");
}