This github project gives top down tree for jvascript call stat
https://github.com/brucespang/jsprof
When i was looking for a javascript function call profiler i found a small script, which i modified as per my need, this script is very simple it will show statistics of all global functions in that window object though it doesnt list names of nested functions called.
function callLog() {
var functionPool = {}
for( var func in window )
{
if (typeof(window[func]) === 'function')
{
functionPool[func] = window[func];
(function(){
var functionName = func;
var totalTime= 0;
var noOfTimes =0;
var minTime= 0;
var maxTime =0;
window[functionName] = function(){
var args = [].splice.call(arguments,0);
var startTime = +new Date;
functionPool[functionName].apply(window, args );
var duration = new Date - startTime;
if (duration> maxTime)
maxTime= duration;
if (duration< minTime)
minTime= duration;
totalTime = totalTime + duration;
noOfTimes++ ;
console.log('Executed: ' + functionName + '('+args.join(',')+')' + " Time[" + duration + "ms]"+" Total Time[" + totalTime +"ms]" +" No of Times[" + noOfTimes + "]" + "max Time [" + maxTime+ "ms]" + "min Time [" +minTime +"ms]");
}
})();
}
}
}