Skip to content

Conversation

armcknight
Copy link
Member

@armcknight armcknight commented May 29, 2025

I realized after rereading #3637 (comment) that even if we consider a launch profile unable to be stopped as a misconfiguration we can't currently avoid at runtime, this leads to every launch afterwards also starting the launch profiling. We should instead consider not starting the SDK as disabling launch profiling, the same as if the SDK had never been started in an app.

It also increases safety such that if the app crashes between the time a launch profile starts (especially if it's a crash due to the profiler), and a call to SentrySDK.startWithOptions would've disabled launch profiling, launch profiling won't keep starting again on every subsequent launch.

To achieve this we should always remove the config file once we're done with it for that launch. Configuring to disable launch profiling already removed any file present; now, starting the launch profiler also removes it.

This also helps with issues like #5366

#skip-changelog

Copy link

codecov bot commented May 29, 2025

Codecov Report

Attention: Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.274%. Comparing base (035974f) to head (d5c1c73).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...es/Sentry/Profiling/SentryProfilerSerialization.mm 0.000% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #5318       +/-   ##
=============================================
+ Coverage   86.199%   86.274%   +0.074%     
=============================================
  Files          407       407               
  Lines        35072     35096       +24     
  Branches     15228     15238       +10     
=============================================
+ Hits         30232     30279       +47     
+ Misses        4793      4769       -24     
- Partials        47        48        +1     
Files with missing lines Coverage Δ
Sources/Sentry/Profiling/SentryLaunchProfiling.m 96.774% <100.000%> (+7.759%) ⬆️
...urces/Sentry/Profiling/SentryProfilerTestHelpers.m 87.804% <100.000%> (ø)
Sources/Sentry/SentryFileManager.m 94.491% <100.000%> (+0.031%) ⬆️
...es/Sentry/Profiling/SentryProfilerSerialization.mm 85.227% <0.000%> (-0.651%) ⬇️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 035974f...d5c1c73. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

github-actions bot commented May 29, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1224.17 ms 1250.91 ms 26.74 ms
Size 23.75 KiB 874.45 KiB 850.71 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
9389467 1218.62 ms 1244.86 ms 26.24 ms
f92cfa9 1228.45 ms 1251.33 ms 22.88 ms
079bcc8 1217.88 ms 1234.88 ms 17.00 ms
701b301 1226.10 ms 1245.57 ms 19.47 ms
65f8d2e 1221.15 ms 1243.96 ms 22.81 ms
c63e0fe 1230.58 ms 1253.94 ms 23.35 ms
db9572a 1223.13 ms 1241.60 ms 18.47 ms
8fd192f 1202.10 ms 1220.19 ms 18.09 ms
2481950 1221.04 ms 1248.98 ms 27.94 ms
51f74d7 1236.31 ms 1247.43 ms 11.12 ms

App size

Revision Plain With Sentry Diff
9389467 23.75 KiB 866.51 KiB 842.76 KiB
f92cfa9 23.75 KiB 855.38 KiB 831.62 KiB
079bcc8 23.74 KiB 874.07 KiB 850.33 KiB
701b301 23.75 KiB 867.16 KiB 843.41 KiB
65f8d2e 23.74 KiB 872.67 KiB 848.93 KiB
c63e0fe 23.74 KiB 874.08 KiB 850.33 KiB
db9572a 23.75 KiB 858.64 KiB 834.89 KiB
8fd192f 23.74 KiB 872.75 KiB 849.01 KiB
2481950 23.74 KiB 872.74 KiB 849.00 KiB
51f74d7 23.74 KiB 874.08 KiB 850.34 KiB

Previous results on branch: armcknight/fix/launch-profile-rerun

Startup times

Revision Plain With Sentry Diff
2a48940 1224.67 ms 1246.10 ms 21.43 ms
d20940c 1210.45 ms 1242.30 ms 31.85 ms
990929b 1225.96 ms 1246.51 ms 20.55 ms
6be3673 1215.00 ms 1236.02 ms 21.02 ms
2ba623f 1219.96 ms 1225.08 ms 5.12 ms

App size

Revision Plain With Sentry Diff
2a48940 23.75 KiB 874.45 KiB 850.71 KiB
d20940c 23.75 KiB 874.46 KiB 850.71 KiB
990929b 23.75 KiB 872.95 KiB 849.21 KiB
6be3673 23.75 KiB 850.99 KiB 827.24 KiB
2ba623f 23.75 KiB 872.95 KiB 849.21 KiB

@armcknight armcknight marked this pull request as ready for review June 19, 2025 00:10
@armcknight armcknight force-pushed the armcknight/fix/launch-profile-rerun branch from 8f837d5 to c13917b Compare June 19, 2025 00:12
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Doesn't this deserve a changelog entry? Some comments, but nothing blocking. LGTM

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks. Again, LGTM.

@armcknight
Copy link
Member Author

For some reason tests are failing In CI but not locally, i'm debugging.

Copy link
Contributor

github-actions bot commented Jul 2, 2025

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@armcknight armcknight merged commit 2a36c3f into main Jul 3, 2025
136 of 137 checks passed
@armcknight armcknight deleted the armcknight/fix/launch-profile-rerun branch July 3, 2025 00:52
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