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

Profile format changes for flows and stack-based markers #5186

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

mstange
Copy link
Contributor

@mstange mstange commented Nov 1, 2024

Corresponding platform bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1929913

This PR implements only the format changes for the current strawman proposal in #5178. So this is just the minimum so that we can start prototyping and upload profiles that contain flow fields. No UI is actually implemented - the new field types are treated just like unique-string fields are treated today.

I'm not sure if the format proposed in #5178 is the best way to represent flows. But we can still change the format later if we determine something else works better.


This PR changes the type definition for marker schema field types and for the marker schema itself, to include the new field types 'flow-id' and 'terminating-flow-id'. It also has some minimal changes to treat the new field types as if they were unique-string fields.
Somewhat unrelated to flows, it also adds an optional isStackBased field to the marker schema type, which is currently unused. This is for #3141 .

Additionally, it increments the version of the two profile formats, so that profiles with the new field types won't be loaded by older front-ends.

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.57%. Comparing base (e0ab0b6) to head (dbc0f75).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5186   +/-   ##
=======================================
  Coverage   88.56%   88.57%           
=======================================
  Files         308      308           
  Lines       28011    28018    +7     
  Branches     7578     7583    +5     
=======================================
+ Hits        24809    24816    +7     
  Misses       2985     2985           
  Partials      217      217           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mstange mstange requested a review from canova November 5, 2024 16:42
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.

Thanks,
the only concern I have is with bumping the gecko version, depending on your plan on the gecko side. If you plan to land the gecko side for these new types soon, then that's good.

// other stack-based markers on the same thread. Stack-based markers may
// be displayed in a different part of the marker chart than non-stack-based
// markers.
// Instant markers are always well-nested.
Copy link
Contributor

Choose a reason for hiding this comment

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

Instant markers are already displayed on a separate line anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, this is proposing that we put stack-based instant markers into the pyramid.

Comment on lines +160 to +162
// other stack-based markers on the same thread. Stack-based markers may
// be displayed in a different part of the marker chart than non-stack-based
// markers.
Copy link
Contributor

Choose a reason for hiding this comment

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

I still wonder if simply ordering markers by startTime would be good enough for getting the pyramid shapes? But I'm not opposed.

Copy link
Member

Choose a reason for hiding this comment

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

If I understand correctly, the idea of this field is to have a different section in the marker chart (instead of grouping markers by their categories and then by their names), so marker from different categories + names can be still stacked on top of each other.

I think we had the idea of having a checkbox in the marker chart to convert all the markers into stack based markers, right? So all the makers could be nested instead of only a handful selected ones. That could be something we can explore too, but having some markers behave stack based by default can be useful for the default view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I understand correctly, the idea of this field is to have a different section in the marker chart (instead of grouping markers by their categories and then by their names), so marker from different categories + names can be still stacked on top of each other.

That's right.

I think we had the idea of having a checkbox in the marker chart to convert all the markers into stack based markers, right?

I don't think it would work very well if you have non-stack-based markers in there, like CSS animation markers, IPC messages, network markers, FirstContentfulComposite markers, GCMajor markers etc. I really do think we need to have a distinction because otherwise the pyramid shape will be messed up.

Comment on lines +86 to +89
### Version 31

Two new marker schema field format types have been added: `flow-id` and `terminating-flow-id`, with string index values (like `unique-string`).
An optional `isStackBased` boolean field has been added to the marker schema.
Copy link
Contributor

Choose a reason for hiding this comment

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

note we also need to implement and bump the version on the gecko side fairly at the same time. Otherwise we might run into a situation where another change will want to bump the format version (eg paul bone's changes on the memory counters) and we wouldn't have the same version on the backend and frontend...

If all we want to do for now is experimenting, it might not be necessary to bump the gecko format version until we actually land it on the gecko side. Until then Jeff and yourself will have to remember you need to have an updated frontend.

(it's fine to bump the processed format version though).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll put up a patch that bumps the Gecko version into https://bugzilla.mozilla.org/show_bug.cgi?id=1929913 . I think that's the cleanest way to approach it.

Copy link
Member

@canova canova left a comment

Choose a reason for hiding this comment

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

Looks good to me too, thanks!

Comment on lines +160 to +162
// other stack-based markers on the same thread. Stack-based markers may
// be displayed in a different part of the marker chart than non-stack-based
// markers.
Copy link
Member

Choose a reason for hiding this comment

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

If I understand correctly, the idea of this field is to have a different section in the marker chart (instead of grouping markers by their categories and then by their names), so marker from different categories + names can be still stacked on top of each other.

I think we had the idea of having a checkbox in the marker chart to convert all the markers into stack based markers, right? So all the makers could be nested instead of only a handful selected ones. That could be something we can explore too, but having some markers behave stack based by default can be useful for the default view.

@mstange
Copy link
Contributor Author

mstange commented Nov 7, 2024

Thanks for the reviews!

This changeset changes the type definition for marker schema
field types and for the marker schema itself, to include the new
field types 'flow-id' and 'terminating-flow-id'. It also has some
minimal changes to treat the new field types as if they were unique-string
fields.
Somewhat unrelated to flows, it also adds an optional `isStackBased`
field to the marker schema type, which is currently unused. This is
for firefox-devtools#3141 .

Additionally, it increments the version of the two profile formats,
so that profiles with the new field types won't be loaded by
older front-ends.
@mstange mstange force-pushed the flow-id-field-type branch from dbc0f75 to 8141498 Compare November 7, 2024 15:48
@mstange mstange enabled auto-merge November 7, 2024 15:50
@mstange mstange merged commit e51f644 into firefox-devtools:main Nov 7, 2024
15 of 16 checks passed
@canova canova mentioned this pull request Nov 12, 2024
canova added a commit that referenced this pull request Nov 12, 2024
[Nazım Can Altınova] Change the test-build-coverage script to use 'yarn
test' instead of jest directly (#5180)
[Nazım Can Altınova] Retrieve the page favicons from the browser and
display it on the tab selector (#5166)
[Nazım Can Altınova] Add default favicons to extensions and pages that
don't have nay favicons (#5182)
[Nazım Can Altınova] Do not clip the favicons in call tree (#5185)
[Nazım Can Altınova] Compute the profiling start and end time for chrome
tracing profiles (#5187)
[Nazım Can Altınova] Do not include the profile startTime in window
title if it's zero (#5188)
[Markus Stange] Profile format changes for flows and stack-based markers
(#5186)
[Nazım Can Altınova] Fix some svg images for Chrome by replacing
context-fill with the black color (#5201)
[Nazım Can Altınova] Enable the tab selector (#5197)
[Nazım Can Altınova] Do not make the parent process visible by default
when something is selected in the tab selector (#5198)
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 19, 2024
…-reviewers,julienw

The corresponding front-end bump is happening in firefox-devtools/profiler#5186 .

Bumping the version to 31 means that our code can emit profiles which
use the marker field formats 'flow-id' and 'terminating-flow-id' without
running into trouble on the front-end side.

Differential Revision: https://phabricator.services.mozilla.com/D228348
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Nov 20, 2024
…-reviewers,julienw

The corresponding front-end bump is happening in firefox-devtools/profiler#5186 .

Bumping the version to 31 means that our code can emit profiles which
use the marker field formats 'flow-id' and 'terminating-flow-id' without
running into trouble on the front-end side.

Differential Revision: https://phabricator.services.mozilla.com/D228348
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this pull request Nov 22, 2024
…-reviewers,julienw

The corresponding front-end bump is happening in firefox-devtools/profiler#5186 .

Bumping the version to 31 means that our code can emit profiles which
use the marker field formats 'flow-id' and 'terminating-flow-id' without
running into trouble on the front-end side.

Differential Revision: https://phabricator.services.mozilla.com/D228348
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.

3 participants