diff --git a/browser/devtools/performance/modules/recording-utils.js b/browser/devtools/performance/modules/recording-utils.js index 716b5a53b1e7..e1d4d46c5c0d 100644 --- a/browser/devtools/performance/modules/recording-utils.js +++ b/browser/devtools/performance/modules/recording-utils.js @@ -83,10 +83,14 @@ exports.RecordingUtils.getSamplesFromAllocations = function(allocations) { samples.push(sample); while (frame) { + let source = frame.source + ":" + frame.line + ":" + frame.column; + let funcName = frame.functionDisplayName || ""; + sample.frames.push({ - location: frame.source + ":" + frame.line + ":" + frame.column, + location: funcName ? funcName + " (" + source + ")" : source, allocations: count }); + site = frame.parent; frame = frames[site]; count = counts[site]; diff --git a/browser/devtools/performance/test/browser_perf-allocations-to-samples.js b/browser/devtools/performance/test/browser_perf-allocations-to-samples.js index dfea23a684a8..f02c94238591 100644 --- a/browser/devtools/performance/test/browser_perf-allocations-to-samples.js +++ b/browser/devtools/performance/test/browser_perf-allocations-to-samples.js @@ -25,18 +25,21 @@ let TEST_DATA = { source: "A", line: 1, column: 2, + functionDisplayName: "x", parent: 0 }, { source: "B", line: 3, column: 4, + functionDisplayName: "y", parent: 1 }, { source: "C", line: 5, column: 6, + functionDisplayName: null, parent: 2 } ], @@ -52,25 +55,25 @@ let EXPECTED_OUTPUT = [{ }, { time: 150, frames: [{ - location: "A:1:2", + location: "x (A:1:2)", allocations: 22 }] }, { time: 200, frames: [{ - location: "A:1:2", + location: "x (A:1:2)", allocations: 22 }, { - location: "B:3:4", + location: "y (B:3:4)", allocations: 33 }] }, { time: 250, frames: [{ - location: "A:1:2", + location: "x (A:1:2)", allocations: 22 }, { - location: "B:3:4", + location: "y (B:3:4)", allocations: 33 }, { location: "C:5:6",