Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1127472 - RecordingUtils.getSamplesFromAllocations should include…
Browse files Browse the repository at this point in the history
… the function name in the frames' location, r=jsantell
  • Loading branch information
Victor Porof committed Jan 31, 2015
1 parent 32bff4d commit 2c0f114
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 5 additions & 1 deletion browser/devtools/performance/modules/recording-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
],
Expand All @@ -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",
Expand Down

0 comments on commit 2c0f114

Please sign in to comment.