-
Notifications
You must be signed in to change notification settings - Fork 479
Convert some code to use the non-inverted call node table even while we're showing the inverted call tree #4899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f3d791e
d43bde9
7a5abec
64a28a7
ac38706
8b227be
f1b2b14
806dd22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ type Props = {| | |
| +className: string, | ||
| +thread: Thread, | ||
| +samplesSelectedStates: null | SelectedState[], | ||
| +sampleCallNodes: Array<IndexIntoCallNodeTable | null>, | ||
| +sampleNonInvertedCallNodes: Array<IndexIntoCallNodeTable | null>, | ||
| +interval: Milliseconds, | ||
| +rangeStart: Milliseconds, | ||
| +rangeEnd: Milliseconds, | ||
|
|
@@ -38,13 +38,14 @@ type Props = {| | |
|
|
||
| export class ThreadStackGraph extends PureComponent<Props> { | ||
| _heightFunction = (sampleIndex: IndexIntoSamplesTable): number | null => { | ||
| const { callNodeInfo, sampleCallNodes } = this.props; | ||
| const callNodeIndex = sampleCallNodes[sampleIndex]; | ||
| if (callNodeIndex === null) { | ||
| const { callNodeInfo, sampleNonInvertedCallNodes } = this.props; | ||
| const nonInvertedCallNodeIndex = sampleNonInvertedCallNodes[sampleIndex]; | ||
| if (nonInvertedCallNodeIndex === null) { | ||
| return null; | ||
| } | ||
| const callNodeTable = callNodeInfo.getCallNodeTable(); | ||
| return callNodeTable.depth[callNodeIndex]; | ||
|
|
||
| const nonInvertedCallNodeTable = callNodeInfo.getNonInvertedCallNodeTable(); | ||
| return nonInvertedCallNodeTable.depth[nonInvertedCallNodeIndex]; | ||
| }; | ||
|
|
||
| render() { | ||
|
|
@@ -60,12 +61,12 @@ export class ThreadStackGraph extends PureComponent<Props> { | |
| trackName, | ||
| onSampleClick, | ||
| } = this.props; | ||
| const callNodeTable = callNodeInfo.getCallNodeTable(); | ||
| const nonInvertedCallNodeTable = callNodeInfo.getNonInvertedCallNodeTable(); | ||
|
|
||
| let maxDepth = 0; | ||
| for (let i = 0; i < callNodeTable.depth.length; i++) { | ||
| if (callNodeTable.depth[i] > maxDepth) { | ||
| maxDepth = callNodeTable.depth[i]; | ||
| for (let i = 0; i < nonInvertedCallNodeTable.depth.length; i++) { | ||
| if (nonInvertedCallNodeTable.depth[i] > maxDepth) { | ||
| maxDepth = nonInvertedCallNodeTable.depth[i]; | ||
| } | ||
| } | ||
|
Comment on lines
+67
to
71
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes me think there's a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (not especially in this PR though)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I forgot about that property, but you're right! |
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this makes me think we might want to do that as well when switching from non-inverted to inverted.
(looking at the code, it looks like we're trying to do it but it's buggy)