|
162 | 162 | configuration:tracerConfig]; |
163 | 163 | } |
164 | 164 |
|
165 | | -# if !SDK_V9 |
166 | | -SentryLaunchProfileDecision |
167 | | -sentry_launchShouldHaveTransactionProfiling(SentryOptions *options) |
168 | | -{ |
169 | | -# pragma clang diagnostic push |
170 | | -# pragma clang diagnostic ignored "-Wdeprecated-declarations" |
171 | | - BOOL shouldProfileNextLaunch = options.enableAppLaunchProfiling && options.enableTracing; |
172 | | - if (!shouldProfileNextLaunch) { |
173 | | - SENTRY_LOG_DEBUG(@"Specified options configuration doesn't enable launch profiling: " |
174 | | - @"options.enableAppLaunchProfiling: %d; options.enableTracing: %d; won't " |
175 | | - @"profile launch", |
176 | | - options.enableAppLaunchProfiling, options.enableTracing); |
177 | | - return (SentryLaunchProfileDecision) { NO, nil, nil }; |
178 | | - } |
179 | | -# pragma clang diagnostic pop |
180 | | - |
181 | | - SentryTransactionContext *transactionContext = |
182 | | - [[SentryTransactionContext alloc] initWithName:@"app.launch" operation:@"profile"]; |
183 | | - transactionContext.forNextAppLaunch = YES; |
184 | | - SentrySamplingContext *context = |
185 | | - [[SentrySamplingContext alloc] initWithTransactionContext:transactionContext]; |
186 | | - SentrySamplerDecision *tracesSamplerDecision = sentry_sampleTrace(context, options); |
187 | | - if (tracesSamplerDecision.decision != kSentrySampleDecisionYes) { |
188 | | - SENTRY_LOG_DEBUG( |
189 | | - @"Sampling out the launch trace for transaction profiling; won't profile launch."); |
190 | | - return (SentryLaunchProfileDecision) { NO, nil, nil }; |
191 | | - } |
192 | | - |
193 | | - SentrySamplerDecision *profilesSamplerDecision |
194 | | - = sentry_sampleTraceProfile(context, tracesSamplerDecision, options); |
195 | | - if (profilesSamplerDecision.decision != kSentrySampleDecisionYes) { |
196 | | - SENTRY_LOG_DEBUG( |
197 | | - @"Sampling out the launch profile for transaction profiling; won't profile launch."); |
198 | | - return (SentryLaunchProfileDecision) { NO, nil, nil }; |
199 | | - } |
200 | | - |
201 | | - SENTRY_LOG_DEBUG(@"Will start transaction profile next launch; will profile launch."); |
202 | | - return (SentryLaunchProfileDecision) { YES, tracesSamplerDecision, profilesSamplerDecision }; |
203 | | -} |
204 | | -# endif // !SDK_V9 |
205 | | - |
206 | 165 | SentryLaunchProfileDecision |
207 | 166 | sentry_launchShouldHaveContinuousProfilingV2(SentryOptions *options) |
208 | 167 | { |
|
264 | 223 | if ([options isContinuousProfilingV2Enabled]) { |
265 | 224 | return sentry_launchShouldHaveContinuousProfilingV2(options); |
266 | 225 | } |
267 | | -# if SDK_V9 |
268 | 226 | return (SentryLaunchProfileDecision) { NO, nil, nil }; |
269 | | -# else |
270 | | - |
271 | | -# pragma clang diagnostic push |
272 | | -# pragma clang diagnostic ignored "-Wdeprecated-declarations" |
273 | | - if ([options isContinuousProfilingEnabled]) { |
274 | | - return (SentryLaunchProfileDecision) { options.enableAppLaunchProfiling, nil, nil }; |
275 | | - } |
276 | | -# pragma clang diagnostic pop |
277 | | - |
278 | | - return sentry_launchShouldHaveTransactionProfiling(options); |
279 | | -# endif // SDK_V9 |
280 | 227 | } |
281 | 228 |
|
282 | 229 | /** |
|
0 commit comments