Skip to content

ref: Separate native profiling boundaries - #9608

Draft
philprime wants to merge 2 commits into
mainfrom
ref/profiling-native-boundaries
Draft

philprime wants to merge 2 commits into
mainfrom
ref/profiling-native-boundaries

Conversation

@philprime

@philprime philprime commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

📜 Description

Separate profiling runtime checks and memory access from SDK implementation code. Move shared logging, compiler support, and suspension admission into SentryNativeUtils, while profiling and SDK thread inspection continue to coordinate through one process-wide atomic flag.

💡 Motivation and Context

Stacked on #9722, which establishes the shared native utility and profiling targets on top of #9826.

The shared gate preserves its nonblocking acquire/release semantics and memory ordering. SDK-owned memory access is supplied through a narrow profiling interface, and the inspection harness compiles the production gate implementation.

Remaining draft work: resolve the Clang module dependency for native-owned headers consumed by _SentryPrivate. The blanket native-module import is a local, uncommitted workaround, not the intended resolution.

#skip-changelog

💚 How did you test it?

  • Formatting, manifest/project checks, and the thread-inspection harness passed on the rebased sources.
  • Static analysis fails on the committed rebase because the native module dependency is missing. Analysis and all six platform builds passed only with the uncommitted import workaround.
  • Full SDK package and sanitizer suites have not been rerun for the rebased stack. Earlier verification does not validate this integration.

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed. No wizard changes required.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper. Not applicable: the interfaces are internal.

@philprime philprime self-assigned this Nov 12, 2026
@philprime
philprime added this pull request to stack #9504 November 12, 2026 12:27
@philprime
philprime force-pushed the ref/profiling-native-boundaries branch 10 times, most recently from 18aef85 to 59335b8 Compare November 19, 2026 12:40
@philprime philprime added the run-no-ci Skips all CI workflows on this PR label Nov 19, 2026
@philprime
philprime force-pushed the ref/profiling-native-boundaries branch 3 times, most recently from 17b00eb to 1d41609 Compare November 23, 2026 12:32
@philprime
philprime force-pushed the ref/profiling-native-boundaries branch 4 times, most recently from e4ccc84 to d28d72a Compare November 24, 2026 12:45
@philprime
philprime force-pushed the ref/profiling-native-boundaries branch from d28d72a to 145a671 Compare November 24, 2026 13:35
Base automatically changed from ref/profiling-logger to main November 25, 2026 08:24
@philprime
philprime removed this pull request from stack #9504 November 30, 2026 12:20
@philprime
philprime force-pushed the ref/profiling-native-boundaries branch from 145a671 to 8d4521d Compare November 30, 2026 14:46
@philprime
philprime changed the base branch from main to ref/native-utils-target November 30, 2026 14:46
@philprime
philprime added this pull request to stack #9837 November 30, 2026 14:54
@philprime
philprime removed this pull request from stack #9837 November 30, 2026 14:54
@philprime
philprime added this pull request to stack #9838 November 30, 2026 15:03
@philprime
philprime force-pushed the ref/profiling-native-boundaries branch from 8d4521d to 47eb1af Compare November 30, 2026 16:12
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 43f599d.

Main concerns: public contract, reach, dependencies customers inherit.

Rules that block low also fired:

  • R1: code was truncated, omitted or a reduced context was used: Sources/Sentry/SentryBacktrace.cpp, Sources/Sentry/SentryDefaultProfilerSDKBackend.m, Sources/Sentry/SentryProfiler.mm, Sources/Sentry/SentrySamplingProfiler.cpp, Sources/Sentry/SentryThreadSnapshot.c and 32 more
  • R5: dependencies or bundled SDK versions changed: Package.swift
  • R6: build or release configuration changed: .github/file-filters.yml, Package.swift, Package@swift-6.1.swift, Package@swift-6.2.swift, Sentry.xcodeproj/project.pbxproj and 3 more

This label is a hint for reviewers, not an approval.

Base automatically changed from ref/native-utils-target to main November 30, 2026 18:02
Keep sanitizer detection in profiling and SDK debug-file writing in the
SDK integration. Preserve the existing exported sanitizer function.

Extract suspension admission into a narrow shared C interface with one
process-wide atomic flag. Keep profiling independent of the SDK snapshot
backend and update the harness and CI filters for the shared source.
Checkpoint the shared native target and injected async-safe profiling
memory reader. Keep crash-backend implementations SDK-owned.

This is unfinished. Reconcile Xcode metadata and documentation, then
verify V10, package, NoUI and distribution builds before publishing.
Extract the profiling target in a separate stacked change.
@philprime
philprime force-pushed the ref/profiling-native-boundaries branch from 47eb1af to 43f599d Compare November 30, 2026 18:02
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium run-no-ci Skips all CI workflows on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant