Skip to content

Commit 6c72678

Browse files
committed
Remove now-unused convertStackToCallNodeAndCategoryPath.
1 parent ffc7221 commit 6c72678

File tree

3 files changed

+0
-51
lines changed

3 files changed

+0
-51
lines changed

src/profile-logic/profile-data.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ import type {
7171
PageList,
7272
CallNodeTable,
7373
CallNodePath,
74-
CallNodeAndCategoryPath,
7574
IndexIntoCallNodeTable,
7675
AccumulatedCounterSamples,
7776
SamplesLikeTable,
@@ -2148,30 +2147,6 @@ export function processEventDelays(
21482147
};
21492148
}
21502149

2151-
/**
2152-
* This function converts a stack information into a call node and
2153-
* category path structure.
2154-
*/
2155-
export function convertStackToCallNodeAndCategoryPath(
2156-
thread: Thread,
2157-
stack: IndexIntoStackTable
2158-
): CallNodeAndCategoryPath {
2159-
const { stackTable, frameTable } = thread;
2160-
const path = [];
2161-
for (
2162-
let stackIndex = stack;
2163-
stackIndex !== null;
2164-
stackIndex = stackTable.prefix[stackIndex]
2165-
) {
2166-
const index = stackTable.frame[stackIndex];
2167-
path.push({
2168-
category: stackTable.category[stackIndex],
2169-
func: frameTable.func[index],
2170-
});
2171-
}
2172-
return path.reverse();
2173-
}
2174-
21752150
/**
21762151
* Compute maximum depth of call stack for a given thread, and return maxDepth+1.
21772152
* This value can be used as the length for any per-depth arrays.

src/test/unit/profile-data.test.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
getInvertedCallNodeInfo,
1717
filterThreadByImplementation,
1818
getSampleIndexClosestToStartTime,
19-
convertStackToCallNodeAndCategoryPath,
2019
getSampleIndexToCallNodeIndex,
2120
getTreeOrderComparator,
2221
getSamplesSelectedStates,
@@ -950,24 +949,6 @@ describe('funcHasDirectRecursiveCall and funcHasRecursiveCall', function () {
950949
});
951950
});
952951

953-
describe('convertStackToCallNodeAndCategoryPath', function () {
954-
it('correctly returns a call node path for a stack', function () {
955-
const profile = getCallNodeProfile();
956-
const { derivedThreads } = getProfileWithDicts(profile);
957-
const [thread] = derivedThreads;
958-
const stack1 = thread.samples.stack[0];
959-
const stack2 = thread.samples.stack[1];
960-
if (stack1 === null || stack2 === null) {
961-
// Makes flow happy
962-
throw new Error("stack shouldn't be null");
963-
}
964-
let callNodePath = convertStackToCallNodeAndCategoryPath(thread, stack1);
965-
expect(callNodePath.map((f) => f.func)).toEqual([0, 1, 2, 3, 4]);
966-
callNodePath = convertStackToCallNodeAndCategoryPath(thread, stack2);
967-
expect(callNodePath.map((f) => f.func)).toEqual([0, 1, 2, 3, 5]);
968-
});
969-
});
970-
971952
describe('getSamplesSelectedStates', function () {
972953
function setup(textSamples) {
973954
const {

src/types/profile-derived.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,6 @@ export type AddressProof = {|
431431
*/
432432
export type CallNodePath = IndexIntoFuncTable[];
433433

434-
export type CallNodeAndCategory = {|
435-
func: IndexIntoFuncTable,
436-
category: IndexIntoCategoryList,
437-
|};
438-
439-
export type CallNodeAndCategoryPath = CallNodeAndCategory[];
440-
441434
/**
442435
* This type contains the first derived `Marker[]` information, plus an IndexedArray
443436
* to get back to the RawMarkerTable.

0 commit comments

Comments
 (0)