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

Ensure Firefox frame table subcategory fields are always included #129

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

joshuay03
Copy link
Collaborator

@joshuay03 joshuay03 commented Feb 15, 2025

Closes #128

I wonder why we set the frame category but not the subcategory here 🤔 Anyway, I've kept it as nil to maintain behaviour while ensuring we conform to the expected Firefox type. See #129 (comment).

@mstange
Copy link

mstange commented Feb 15, 2025

I actually found a few more things that should be fixed: When the category is non-null, the subcategory should also be non-null. So it's better to make it an all-zero column rather than an all-null column.
Also, in the central category list, every category should have at least one subcategory, which is the "Other" subcategory at subcategory index zero. I'm adding the missing documentation in firefox-devtools/profiler#5369 .

@mstange
Copy link

mstange commented Feb 15, 2025

Oh, one more thing: For cases where the same frame is used by different stack nodes with different categories, those frames need to be split up so that the right stack node category can be computed from the frame category. See firefox-devtools/profiler#5369 (comment)

@joshuay03 joshuay03 force-pushed the valid-ff-frame-table-subcategories branch from 3eb0327 to ed4d30b Compare February 16, 2025 00:06
@joshuay03
Copy link
Collaborator Author

I actually found a few more things that should be fixed: When the category is non-null, the subcategory should also be non-null. So it's better to make it an all-zero column rather than an all-null column.

Noted. I've actually gone ahead and just put the correct subcategory indexes in there for now. I’ll wait for @jhawthorn to see if there’s a reason for not wanting to do that.

Also, in the central category list, every category should have at least one subcategory, which is the "Other" subcategory at subcategory index zero. I'm adding the missing documentation in firefox-devtools/profiler#5369 .

I think we already comply with this here:

category.add_subcategory(name: "Other")

@mstange
Copy link

mstange commented Feb 16, 2025

Also, in the central category list, every category should have at least one subcategory, which is the "Other" subcategory at subcategory index zero. I'm adding the missing documentation in firefox-devtools/profiler#5369 .

I think we already comply with this here:

category.add_subcategory(name: "Other")

Ah, perfect. The profiles which are linked in the readme were probably generated before that change then.

@joshuay03
Copy link
Collaborator Author

Oh, one more thing: For cases where the same frame is used by different stack nodes with different categories, those frames need to be split up so that the right stack node category can be computed from the frame category. See firefox-devtools/profiler#5369 (comment)

Oh interesting, maybe this explains why we don't set the subcategory on the frames. I'll look into reworking this.

@joshuay03 joshuay03 force-pushed the valid-ff-frame-table-subcategories branch from ed4d30b to a3b5fd2 Compare March 1, 2025 23:01
@joshuay03
Copy link
Collaborator Author

Oh, one more thing: For cases where the same frame is used by different stack nodes with different categories, those frames need to be split up so that the right stack node category can be computed from the frame category. See firefox-devtools/profiler#5369 (comment)

Oh interesting, maybe this explains why we don't set the subcategory on the frames. I'll look into reworking this.

Okay it seems the frames were intentionally reused in this change, and I don't think that's related to the subcategory omission in any way (that may have just been an oversight/seen as a redundancy). I think I'll merge this as is and tackle the frame separation problem as a separate issue and PR.

@joshuay03 joshuay03 merged commit 31c780b into main Mar 2, 2025
11 checks passed
@joshuay03 joshuay03 deleted the valid-ff-frame-table-subcategories branch March 2, 2025 11:24
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.

The Firefox profiler output needs to generate a subcategory column for the frameTable
2 participants