Skip to content

Better perf script format detection#4187

Merged
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:more-reliable-perf-script-detection
Aug 16, 2022
Merged

Better perf script format detection#4187
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:more-reliable-perf-script-detection

Conversation

@mstange

@mstange mstange commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

The perf script format is a text format that doesn't contain a
distinctive header. Our detection was too general and was incorrectly
detecting JSON profiles as perf script profiles.

Now we bail out if the file starts with an opening brace.

I've also simplified how we treat perf script profiles with header.
Rather than skipping the header and detecting the first sample, we just
detect the header.

@mstange mstange requested a review from canova August 16, 2022 14:07
@mstange mstange self-assigned this Aug 16, 2022
@codecov

codecov Bot commented Aug 16, 2022

Copy link
Copy Markdown

Codecov Report

Merging #4187 (ff28d27) into main (b7eba13) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head ff28d27 differs from pull request most recent head 6443ace. Consider uploading reports for the commit 6443ace to get more accurate results

@@           Coverage Diff           @@
##             main    #4187   +/-   ##
=======================================
  Coverage   88.45%   88.46%           
=======================================
  Files         280      280           
  Lines       24528    24527    -1     
  Branches     6535     6536    +1     
=======================================
  Hits        21697    21697           
+ Misses       2629     2628    -1     
  Partials      202      202           
Impacted Files Coverage Δ
src/profile-logic/import/linux-perf.js 96.46% <100.00%> (+0.84%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mstange mstange force-pushed the more-reliable-perf-script-detection branch from 8fd109f to 4372721 Compare August 16, 2022 14:16

@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.

Looks great to me, thanks for the fix!

Comment thread src/profile-logic/import/linux-perf.js Outdated
Comment thread src/profile-logic/import/linux-perf.js
@mstange mstange force-pushed the more-reliable-perf-script-detection branch from 4372721 to ff28d27 Compare August 16, 2022 16:53
The `perf script` format is a text format that doesn't contain a
distinctive header. Our detection was too general and was incorrectly
detecting JSON profiles as perf script profiles.

Now we bail out if the file starts with an opening brace.

I've also simplified how we treat perf script profiles with header.
Rather than skipping the header and detecting the first sample, we just
detect the header.
@mstange mstange force-pushed the more-reliable-perf-script-detection branch from ff28d27 to 6443ace Compare August 16, 2022 17:02
@mstange mstange enabled auto-merge August 16, 2022 17:05
@mstange mstange merged commit aad02ed into firefox-devtools:main Aug 16, 2022
@canova canova mentioned this pull request Sep 6, 2022
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.

2 participants