Skip to content

Move FileIO table labels into marker schemas - #6296

Merged
fatadel merged 2 commits into
firefox-devtools:mainfrom
fatadel:issue-6295
Sep 14, 2026
Merged

fatadel merged 2 commits into
firefox-devtools:mainfrom
fatadel:issue-6295

Conversation

@fatadel

@fatadel fatadel commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Main | Deploy preview

Replace the hardcoded data.type branch that assembles FileIO table labels with a schema template. Optional segments let the template omit surrounding punctuation when source or filename fields are missing.

Closes #6295


Profile with IO enabled

@fatadel
fatadel requested review from canova and mstange September 2, 2026 14:03
@codecov

codecov Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.88%. Comparing base (18e46d8) to head (08ae1f3).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6296      +/-   ##
==========================================
+ Coverage   83.84%   83.88%   +0.04%     
==========================================
  Files         352      353       +1     
  Lines       37807    37900      +93     
  Branches    10674    10691      +17     
==========================================
+ Hits        31698    31793      +95     
+ Misses       5679     5678       -1     
+ Partials      430      429       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fatadel

fatadel commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor Author
  • When this is merged, create a bug for the Gecko side.

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! Before I review completely, I see that this PR does 2 main things:

  • Adds optional segment syntax to marker labels
  • Adds a tableLabel to FileIO markers

It's difficult to review these two changes when they are combined together. Can you please split them into 2 commits?

Comment thread src/profile-logic/marker-schema.ts Outdated
@fatadel

fatadel commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the PR! Before I review completely, I see that this PR does 2 main things:

* Adds optional segment syntax to marker labels

* Adds a tableLabel to FileIO markers

It's difficult to review these two changes when they are combined together. Can you please split them into 2 commits?

Done ✅

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re the optional segmenting in labels using ``[[ ... ]]`:
I'm a bit unsure about adding more and more label templating features to the marker labels. It feels like it can get out of hand quickly and not that easy to get it right.
Pinging and @mstange and @fqueze in case they feel strongly about it.

One issue that I can see is ternaries and the optional segment conflicts right now. For example [[{marker.data.canceled ? 'cancelled' : 'ok'}]] never prints ok if I understand correctly.

On the other hand, I believe this current behavior of FileIO marker can be implemented using ternaries already, right? I assume it'll be longer, but it saves us from adding more complexity here. What do you think?

Comment thread src/profile-logic/processed-profile-versioning.ts Outdated
Comment thread src/profile-logic/marker-schema.ts Outdated
@fatadel

fatadel commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Re the optional segmenting in labels using ``[[ ... ]]`: I'm a bit unsure about adding more and more label templating features to the marker labels. It feels like it can get out of hand quickly and not that easy to get it right. Pinging and @mstange and @fqueze in case they feel strongly about it.

One issue that I can see is ternaries and the optional segment conflicts right now. For example [[{marker.data.canceled ? 'cancelled' : 'ok'}]] never prints ok if I understand correctly.

On the other hand, I believe this current behavior of FileIO marker can be implemented using ternaries already, right? I assume it'll be longer, but it saves us from adding more complexity here. What do you think?

Your example does print ok when marker.data.canceled is false, optional segments are omitted only for missing, null, or empty-string values. But I agree that we are adding excessive complexity to the vocabulary.

We cannot have the same behavior with just the ternaries though. The current hardcoded FileIO code omits that entire section when source is empty. Existing ternaries cannot conditionally include the interpolation itself. So, instead of having '' we would have (empty).

@fatadel

fatadel commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@canova Thanks for the review! I've addressed your other comments, however, I am not sure what to do with the increased vocabulary complexity...

@fatadel
fatadel requested a review from canova September 10, 2026 15:41
@canova

canova commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Thanks for thinking it through!

Re the optional segmenting in labels using ``[[ ... ]]: I'm a bit unsure about adding more and more label templating features to the marker labels. It feels like it can get out of hand quickly and not that easy to get it right. Pinging and @mstange and @fqueze in case they feel strongly about it. One issue that I can see is ternaries and the optional segment conflicts right now. For example [[{marker.data.canceled ? 'cancelled' : 'ok'}]]` never prints `ok` if I understand correctly.
On the other hand, I believe this current behavior of FileIO marker can be implemented using ternaries already, right? I assume it'll be longer, but it saves us from adding more complexity here. What do you think?

Your example does print ok when marker.data.canceled is false, optional segments are omitted only for missing, null, or empty-string values. But I agree that we are adding excessive complexity to the vocabulary.

Yeah I wasn't fully correct on "never" prints ok part. It prints ok on false but doesn't print ok when it's null, which I expect it to. Because I first expect the inner ternary to be evaluated and then the optional one. Here's an example profile

I have two markers, with canceled: null. And one marker schema has [[{marker.data.canceled ? 'cancelled' : 'ok'}]] and the other {marker.data.canceled ? 'cancelled' : 'ok'}. And I expect them both to show ok, but only the bare ternary one shows ok and not the null one.

We cannot have the same behavior with just the ternaries though. The current hardcoded FileIO code omits that entire section when source is empty. Existing ternaries cannot conditionally include the interpolation itself. So, instead of having '' we would have (empty).

You are right on that, but this sounds like a bug to me. We show (empty) while printing the tooltip to make it clear for the users, but it shouldn't be used while we are testing the condition inside the ternary or on the label. Note this isn't about the ternary condition, which already reads the raw payload value and treats '' as false. It's the plain {marker.data.x} interpolation that formats '' into (empty). I would prefer to fix that instead of working around it.

For example I think this if check should include checking empty strings too:

if (value === undefined || value === null) {
// This would return "undefined" or "null" otherwise.
return '';

Once that's fixed the ternary version of this FileIO marker could be this:

{marker.data.source ? '(' : ''}{marker.data.source}{marker.data.source ? ') ' : ''}{marker.data.operation}{marker.data.filename ? ' — ' : ''}{marker.data.filename}

Not nice looking but good enough.

@fatadel

fatadel commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for thinking it through!

Re the optional segmenting in labels using ``[[ ... ]]: I'm a bit unsure about adding more and more label templating features to the marker labels. It feels like it can get out of hand quickly and not that easy to get it right. Pinging and @mstange and @fqueze in case they feel strongly about it. One issue that I can see is ternaries and the optional segment conflicts right now. For example [[{marker.data.canceled ? 'cancelled' : 'ok'}]]` never prints `ok` if I understand correctly.
On the other hand, I believe this current behavior of FileIO marker can be implemented using ternaries already, right? I assume it'll be longer, but it saves us from adding more complexity here. What do you think?

Your example does print ok when marker.data.canceled is false, optional segments are omitted only for missing, null, or empty-string values. But I agree that we are adding excessive complexity to the vocabulary.

Yeah I wasn't fully correct on "never" prints ok part. It prints ok on false but doesn't print ok when it's null, which I expect it to. Because I first expect the inner ternary to be evaluated and then the optional one. Here's an example profile

I have two markers, with canceled: null. And one marker schema has [[{marker.data.canceled ? 'cancelled' : 'ok'}]] and the other {marker.data.canceled ? 'cancelled' : 'ok'}. And I expect them both to show ok, but only the bare ternary one shows ok and not the null one.

We cannot have the same behavior with just the ternaries though. The current hardcoded FileIO code omits that entire section when source is empty. Existing ternaries cannot conditionally include the interpolation itself. So, instead of having '' we would have (empty).

You are right on that, but this sounds like a bug to me. We show (empty) while printing the tooltip to make it clear for the users, but it shouldn't be used while we are testing the condition inside the ternary or on the label. Note this isn't about the ternary condition, which already reads the raw payload value and treats '' as false. It's the plain {marker.data.x} interpolation that formats '' into (empty). I would prefer to fix that instead of working around it.

For example I think this if check should include checking empty strings too:

if (value === undefined || value === null) {
// This would return "undefined" or "null" otherwise.
return '';

Once that's fixed the ternary version of this FileIO marker could be this:

{marker.data.source ? '(' : ''}{marker.data.source}{marker.data.source ? ') ' : ''}{marker.data.operation}{marker.data.filename ? ' — ' : ''}{marker.data.filename}

Not nice looking but good enough.

Thanks for your response, @canova! That should indeed work. Implemented now.

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Marker labels pass empty strings to the shared value formatter, which
renders them as `(empty)` for tooltip fields. Skip empty strings before
formatting label parts so labels can omit them without changing tooltip
formatting.
Replace the hardcoded `data.type` branch in the generic label fallback
with a template on the FileIO schema.
@fatadel
fatadel merged commit 69e8e39 into firefox-devtools:main Sep 14, 2026
39 of 40 checks passed
@fatadel
fatadel deleted the issue-6295 branch September 14, 2026 10:30
@fatadel

fatadel commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author
  • When this is merged, create a bug for the Gecko side.

https://bugzilla.mozilla.org/show_bug.cgi?id=2071892

canova added a commit that referenced this pull request Sep 22, 2026
Changes:

[fatadel] Show a category breakdown in profiler-cli (#6256)
[fatadel] Show allocation data in the cli (#6246)
[Florian Quèze] profiler-cli: name the process in the thread banner, and
follow the queried thread (#6269)
[fatadel] Drive PII sanitization from marker schemas (#6291)
[fatadel] Move FileIO table labels into marker schemas (#6296)
[Florian Quèze] profiler-cli: add a thread list command (#6273)
[Nazım Can Altınova] Update oxfmt 0.63.0 → 0.68.0 (major) (#6316)
[Markus Stange] Add missing finishRawMarkerTableBuilder. (#6318)
[Markus Stange] Fix the upload error button contrast (#6315)
[Markus Stange] Allow typed arrays in the nativeSymbols table (#6300)
[Markus Stange] Remove brittle test. (#6322)
[Markus Stange] Fix file extension typo. (#6325)
[Nazım Can Altınova] Add a permalink command to profiler-cli for already
published profiles (#6331)
[Markus Stange] Typed arrays + flags for the FuncTable (#6323)
[Florian Quèze] profiler-cli: add profile markers for cross-thread
marker search (#6276)
[fatadel] Convert extension text markers to structured payloads (#6314)
[Florian Quèze] profiler-cli: include per-marker fields and data in
--list --json (#6275)
[Nazım Can Altınova]  Add `--with-samply` to "profiler-cli load" (#6339)
[Markus Stange] Speed up call tree sidebar by sharing work with the
activity graph (#6329)
[Nazım Can Altınova] 🔃 Sync: l10n -> main (Sept 22, 2026) (#6341)
[Nazım Can Altınova] Bump profiler-cli version to 0.10.0 (#6342)

And special thanks to our localizers:

el: Jim Spentzos
ro: robbp
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.

Drive FileIO table labels from marker schemas

2 participants