Skip to content
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

Reduce confusion between call tree summary strategy aware samples and regular samples #5330

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

mstange
Copy link
Contributor

@mstange mstange commented Jan 17, 2025

Fixes #5326, but leaves #5327 unfixed for now.

@mstange mstange requested a review from julienw January 17, 2025 15:18
@mstange mstange force-pushed the ctss-sample-offset branch from 8821403 to 7c6ff51 Compare January 17, 2025 15:19
@mstange
Copy link
Contributor Author

mstange commented Jan 17, 2025

Also, I think the sample offsets aren't even correct for the allocation strategies: The filtered allocation samples are computed from the range filtered thread, rather than by range filtering the allocation samples of the unfiltered thread.

I haven't understood the difference in meaning between filterToRetainedAllocations(filterThreadToRange(thread)) and filterSamplesToRange(filterToRetainedAllocations(thread)) but I'm pretty sure there is a difference. But the way we compute the sample offsets assumes the two are the same.

Copy link
Contributor

@julienw julienw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't look too closely at the changes, but this makes sense to me, thanks for the cleanup

@julienw
Copy link
Contributor

julienw commented Jan 17, 2025

I haven't understood the difference in meaning between filterToRetainedAllocations(filterThreadToRange(thread)) and filterSamplesToRange(filterToRetainedAllocations(thread)) but I'm pretty sure there is a difference. But the way we compute the sample offsets assumes the two are the same.

There's no such things as a filterTheadToRange, except in merge-compare. That one doesn't filter the allocations data using the range, only markers and samples. (BTW As a result the allocations are not diffed in a comparison profile)

And as a result I think that we don't have a single function that filters everything in a thread using the range.

@mstange
Copy link
Contributor Author

mstange commented Jan 17, 2025

I haven't understood the difference in meaning between filterToRetainedAllocations(filterThreadToRange(thread)) and filterSamplesToRange(filterToRetainedAllocations(thread)) but I'm pretty sure there is a difference. But the way we compute the sample offsets assumes the two are the same.

There's no such things as a filterTheadToRange, except in merge-compare. That one doesn't filter the allocations data using the range, only markers and samples. (BTW As a result the allocations are not diffed in a comparison profile)

And as a result I think that we don't have a single function that filters everything in a thread using the range.

Sorry yes, that function doesn't exist, but my point stands - when the call tree summary strategy is native-retained-allocations, getPreviewFilteredCtssSamples isn't just a subslice of getFilteredCtssSamples. Anyway, I'll file a new issue about it.

… summary strategy"-aware samples.

Not a huge fan of the name "CtssSamples" but at least it's now different.

This patch makes it obvious we have a few bugs.
@mstange mstange force-pushed the ctss-sample-offset branch from 7c6ff51 to 1edbe67 Compare January 17, 2025 18:30
@mstange mstange enabled auto-merge January 17, 2025 18:31
@mstange mstange merged commit 5431546 into firefox-devtools:main Jan 17, 2025
15 of 16 checks passed
@canova canova mentioned this pull request Jan 30, 2025
canova added a commit that referenced this pull request Jan 30, 2025
Updates:

[Julien Wajsberg] Some more small refactorings (#5320)
[Markus Stange] Pass the correct sample index offset to
getTimingsForCallNodeIndex for the flame graph tooltip. (#5328)
[Nisarg Jhaveri] Update docs to include Android Studio/Simpleperf trace
file support (#5309)
[Markus Stange] Don't pass the preview filtered thread to
getTimingsForPath/CallNodeIndex. (#5329)
[Nazım Can Altınova] Add a "Sample timestamp" field to the sample
tooltip in timeline (#5322)
[Markus Stange] Reduce confusion between call tree summary strategy
aware samples and regular samples (#5330)
[Markus Stange] Rename this getCounter selector to getCounters. (#5337)
[Markus Stange] Make sample indexes compatible between the unfiltered
and (preview) filtered call tree summary strategy samples when using an
allocation strat>
[Markus Stange] Remove some code that uses the preview filtered thread
(#5336)
[Markus Stange] Remove getMarkerSchemaName special cases - look up
marker schemas from data.type and nothing else (#5293)
[Markus Stange] Remove the makeProfileSerializable step - make the raw
in-memory profile match the format that's stored in the file (#5287)
[Nicolas Chevobbe] Adapt FilterNavigatorBar to High Contrast Mode.
(#5257)
[Nicolas Chevobbe] Adapt Tracks to High Contrast Mode. (#5252)
[Markus Stange] Adjust string index fields in markers when merging
threads (#5344)
[Theodoros Nikolaou] Localize title and aria label in ProfileName
(#5345)
[Julien Wajsberg] Adapt time-slice selection in High Contrast Mode.
(#5259)
[Markus Stange] Make stackTable (sub)category derived data (#5342)
[Markus Stange] Compute cpuRatio values when computing the derived
thread (#5288)
[Nazım Can Altınova] Add a context menu item to open the JS scripts in
DevTools debugger (#5295)

Also thanks to our localizers:

el: Jim Spentzos
fr: Théo Chevalier
it: Francesco Lodolo [:flod]
zh-TW: Pin-guang Chen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Activity graph tooltips don't work correctly when "Retained allocations" is selected in the call tree
2 participants