build(native): exclude daemon-only sources from libsentry.so - #2031
Open
jpnurmi wants to merge 1 commit into
Open
build(native): exclude daemon-only sources from libsentry.so#2031jpnurmi wants to merge 1 commit into
libsentry.so#2031jpnurmi wants to merge 1 commit into
Conversation
`sentry-crash` previously copied all sources from the `sentry` target, so daemon-only crash processing, minidump, and remote unwinding sources were also built into `libsentry.so`. Add those sources directly to `sentry-crash` instead. Keep `daemon_start` in the native backend because launching the handler remains a client-side responsibility. This removes the following Linux x86_64 stack frames from `libsentry.so`: - `sentry__write_minidump`: 1,216,336 bytes - `sentry__process_crash`: 18,368 bytes - `enrich_frame_with_symbol`: 14,592 bytes - `write_attachment_to_envelope`: 8,448 bytes The source split does not preclude a potential future in-process mode.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2031 +/- ##
==========================================
+ Coverage 74.21% 74.34% +0.12%
==========================================
Files 104 104
Lines 26627 26623 -4
Branches 4844 4844
==========================================
+ Hits 19762 19793 +31
+ Misses 5519 5491 -28
+ Partials 1346 1339 -7 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move the client-side launcher from the daemon to the backend, and stop building daemon-only crash processing, minidump writers, and remote unwinding into
libsentry.so.sentry-crashpreviously copied all sources from thesentrytarget, so daemon-only crash processing, minidump, and remote unwinding sources were also built intolibsentry.so. Add those sources directly tosentry-crashinstead. Keepdaemon_startin the native backend because launching the handler remains a client-side responsibility.This slices off ~9% from
libsentry.so[1], and removes the following large stack frames:sentry__write_minidump: 1,216,336 bytessentry__process_crash: 18,368 bytesenrich_frame_with_symbol: 14,592 byteswrite_attachment_to_envelope: 8,448 bytesNote: the source split does not preclude a potential future in-process mode.
Before vs. after
Before (Linux x86_64)
libsentry.so: 2.7MiBsentry-crash: 3.4MiBsentry__write_minidumpsentry__process_crashenrich_frame_with_symbolsentry__crash_daemon_startwrite_attachment_to_envelope.isracrash_signal_handlernative_backend_shutdownelf_locate_symtabsentry__crash_daemon_mainfind_mem_range_from_fdsentry__path_absolutesentry__path_current_exesentry__crash_handler_initensure_installedsentry_value_new_stacktracesentry__unwind_stack_libunwindwrite_thread_contextptrace_capture_thread.israbuild_stacktrace_for_threadhandlerAfter (Linux x86_64)
libsentry.so: 2.5MiBsentry-crash: 3.4MiBdaemon_startcrash_signal_handlernative_backend_shutdownfind_mem_range_from_fdsentry__path_absolutesentry__path_current_exesentry__crash_handler_initensure_installedsentry_value_new_stacktracesentry__unwind_stack_libunwindhandlerCommands for reference:
[1] 55kb/622kb in Release mode / 252kb/2.7mb in ReleaseWithDbg on Linux x86_64