Skip to content

Allow exporting argument values in profiles#5914

Open
squarewave wants to merge 2 commits intofirefox-devtools:mainfrom
squarewave:main
Open

Allow exporting argument values in profiles#5914
squarewave wants to merge 2 commits intofirefox-devtools:mainfrom
squarewave:main

Conversation

@squarewave
Copy link
Copy Markdown
Contributor

This adds a checkbox which will allow the user to include argument values in exported profiles. The export also respects the checkbox to only export the specified timerange by reconstructing the values buffer to only include arguments referenced by included samples.

I'm not actually sure why I initially put this in here - I think
it was just overzealous flow type fixing that I then ported blindly
to typescript when I had to update the patches.
This adds a checkbox which will allow the user to include argument
values in exported profiles. The export also respects the checkbox
to only export the specified timerange by reconstructing the values
buffer to only include arguments referenced by included samples.
@squarewave squarewave requested review from a team and canova as code owners March 26, 2026 17:32
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 42.85714% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.35%. Comparing base (f3f07c7) to head (64cfb34).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-logic/profile-data.ts 0.00% 12 Missing ⚠️
src/utils/base64.ts 0.00% 10 Missing ⚠️
src/profile-logic/sanitize.ts 63.63% 4 Missing ⚠️
src/components/app/MenuButtons/Publish.tsx 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5914      +/-   ##
==========================================
- Coverage   85.41%   85.35%   -0.07%     
==========================================
  Files         321      321              
  Lines       32157    32201      +44     
  Branches     8865     8794      -71     
==========================================
+ Hits        27468    27486      +18     
- Misses       4253     4279      +26     
  Partials      436      436              

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
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.

Thanks for this feature!

See my comment below for the place where we mutate the old samples object. It would be good to shallow copy that as well to make sure we don't mutate it.

I'm wondering about the wording in the tooltip. I think we should make it a bit more scary to make sure that the users really understand before they share it. Let me know what you think!

// We always want to sanitize the private browsing data by default
includePrivateBrowsingData: false,
// We always want to sanitize the argument values by default since they may contain PII
includeArgumentValues: false,
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.

That's the right decision, thanks!

MenuButtons--publish--renderCheckbox-label-private-browsing = Include the data from private browsing windows
MenuButtons--publish--renderCheckbox-label-private-browsing-warning-image =
.title = This profile contains private browsing data
MenuButtons--publish--renderCheckbox-label-argument-values = Include function argument values
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.

Should we explicitly mention that these argument values are coming from the JS execution tracing? For example:

Include JavaScript execution tracing function argument values

Also it might make sense to emphasize that the values are kept in all profiled threads to make sure that we mention the non-active tab is also recorded.

readonly rootRange: StartEndRange;
readonly shouldShowPreferenceOption: boolean;
readonly profileContainsPrivateBrowsingInformation: boolean;
readonly profileHasArgumentValues: boolean;
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.

nit: It would be also good to mention that these argument values are related to the JS execution tracing. Maybe something like profileHasJSTracingArgumentValues? (here and below in the patch)

);

newThread.tracedValuesBuffer = bytesToBase64(filtered.valuesBuffer);
newThread.samples.argumentValues = filtered.entryIndices;
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.

Since we only shallow copied the thread in newThread above, this mutates the original samples table.
Can you also shallow clone the samples table and overwrite argumentValues on it?

Since the old profile is mutated here, this might break our "revert to old profile" button after publishing.

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