title: Can I separate function calls in Chrome Profiler?
body: <p>I created a library that performs AOP on another Javascript program. The procedure I am taking is the following:</p>
  
  <pre><code>var func_name = func.name.toString();
  
  //new function with the name of original function
  window[func_name] = function(){
        ...
        JSLibrary.returnValue = func.apply(this, arguments);
        ...
        return JSLibrary.returnValue
  }
  </code></pre>
  
  <p>The procedure overrides the desired functions by a function that executes additional code before and after the original function is called.</p>
  
  <p>I would like to profile the program so that I can measure my library's timings and then compare results. When I profile the program using Chrome and look under Call Tree, I can see that the new function above is actually being called and it is being referred to as <code>window.(anonymous function)</code> (nothing wrong in that since I know that some of my functions are overriden). But in some cases like the one below, the profiler is grouping the overriden function under one anonymous function (although they were called separately) and the timing represents all the time of the overriden functions added up, because of this I cannot measure the time of every function.</p>
  
  <p><a href="https://i.stack.imgur.com/8BLLi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8BLLi.png" alt="enter image description here"></a></p>
  
  <p>In other words, I would like to ask if there is a way to make the profiler display the called functions in the following structure:</p>
  
  <pre><code>validateRegistration
    window.(anonymous function)
      registerNewAccount
    window.(anonymous function)
      (anonymous)
    window.(anonymous function)
      checkPasswordConfirmation
    window.(anonymous function)
      checkChosenQuestion
    window.(anonymous function)
      (anonymous)
  </code></pre>