Skip to content

Commit

Permalink
Relax the check for skipping the profiler functions in the stack trace
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Dec 3, 2024
1 parent f5adce2 commit 8bc6bd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wasm-memprof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,13 @@ export class WMProf {
// Skip some internal functions from the stack
const shouldSkip = (callSite: NodeJS.CallSite): boolean => {
const fileName = callSite.getFileName();
if (fileName?.includes("wasm-memprof.js")) {
// Skip functions from the profiler itself
// NOTE: The filename might not be "wasm-memprof.js" as is if
// the code is bundled. Thus, we loosely check here.
if (fileName?.includes("wasm-memprof")) {
return true;
}
// Skip hooked allocator functions
const funcName = callSite.getFunctionName();
for (const hook of HOOKED_FUNCTIONS) {
if (funcName === `hooked_${hook}`) {
Expand Down

0 comments on commit 8bc6bd0

Please sign in to comment.