From 64c7e281bfc923578875af04b28d555d314eb2ea Mon Sep 17 00:00:00 2001 From: JonasBa Date: Tue, 18 Jul 2023 18:04:30 -0400 Subject: [PATCH 1/2] fix(browser): 0 is a valid index --- packages/browser/src/profiling/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/browser/src/profiling/utils.ts b/packages/browser/src/profiling/utils.ts index 6c9b4d8ed6b9..c3fde1e1e12a 100644 --- a/packages/browser/src/profiling/utils.ts +++ b/packages/browser/src/profiling/utils.ts @@ -249,7 +249,7 @@ export function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): Profi if (profile.frames[stackTop.frameId] === undefined) { profile.frames[stackTop.frameId] = { function: frame.name, - file: frame.resourceId ? input.resources[frame.resourceId] : undefined, + file: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined, line: frame.line, column: frame.column, }; From 604aae92287f15f12b265cc85228ef46fbe7bba2 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Tue, 18 Jul 2023 19:02:25 -0400 Subject: [PATCH 2/2] fix(browser): pass abs_path --- packages/browser/src/profiling/utils.ts | 6 +++--- packages/types/src/profiling.ts | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/browser/src/profiling/utils.ts b/packages/browser/src/profiling/utils.ts index c3fde1e1e12a..4a9a9af1d658 100644 --- a/packages/browser/src/profiling/utils.ts +++ b/packages/browser/src/profiling/utils.ts @@ -249,9 +249,9 @@ export function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): Profi if (profile.frames[stackTop.frameId] === undefined) { profile.frames[stackTop.frameId] = { function: frame.name, - file: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined, - line: frame.line, - column: frame.column, + abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined, + lineno: frame.line, + colno: frame.column, }; } diff --git a/packages/types/src/profiling.ts b/packages/types/src/profiling.ts index d99736df735e..84a5238e7ace 100644 --- a/packages/types/src/profiling.ts +++ b/packages/types/src/profiling.ts @@ -14,8 +14,9 @@ export type ThreadCpuStack = FrameId[]; export type ThreadCpuFrame = { function: string; file?: string; - line?: number; - column?: number; + lineno?: number; + colno?: number; + abs_path?: string; }; export interface ThreadCpuProfile {