'See the call stack or origin from Performance Observer long task entry

I want to use the Performance observer to debug the long tasks. It gives me every registered tong task but I can't find its origin.

I want to know is there a way to see the origin of the task or even the call stack like in the Performance dev tool of chrome.

  const po = new PerformanceObserver(list => {
    for (const entry of list.getEntries()) {
      console.log('long task', entry);
    }
  });

  po.observe({ type: 'longtask', buffered: true });

enter image description here enter image description here

I found a similar question, but the solution is not satisfying for me, because I want to know is there a way to achieve this without marks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source