Skip to content

Commit 116bbf4

Browse files
committed
consolidate some redundant codepaths
1 parent 9e109bc commit 116bbf4

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Samples/iOS-Swift/iOS-Swift-UITests/ProfilingUITests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,14 @@ extension ProfilingUITests {
165165

166166
switch profileType {
167167
case .ui:
168+
app.launchEnvironment["--io.sentry.profile-session-sample-rate"] = "1"
168169
switch lifecycle {
169170
case .none:
170171
fatalError("Misconfigured test case. Must provide a lifecycle for UI profiling.")
171172
case .trace:
172-
app.launchEnvironment["--io.sentry.profile-session-sample-rate"] = "1"
173+
break
173174
case .manual:
174175
app.launchArguments.append("--io.sentry.profile-lifecycle-manual")
175-
app.launchEnvironment["--io.sentry.profile-session-sample-rate"] = "1"
176176
}
177177
case .continuous:
178178
app.launchArguments.append("--io.sentry.disable-ui-profiling")

Sources/Sentry/Profiling/SentryLaunchProfiling.m

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
return (SentryLaunchProfileConfig) { NO, nil, nil };
154154
}
155155

156-
SENTRY_LOG_DEBUG(@"Continuous profiling v2 conditions satisfied, will profile launch.");
156+
SENTRY_LOG_DEBUG(
157+
@"Continuous profiling v2 manual lifecycle conditions satisfied, will profile launch.");
157158
return (SentryLaunchProfileConfig) { YES, nil, profileSampleDecision };
158159
}
159160

@@ -164,12 +165,8 @@
164165
return sentry_launchShouldHaveContinuousProfilingV2(options);
165166
}
166167

167-
if ([options isContinuousProfilingEnabled] && options.enableAppLaunchProfiling) {
168-
return (SentryLaunchProfileConfig) { YES, nil, nil };
169-
}
170-
171168
if ([options isContinuousProfilingEnabled]) {
172-
return (SentryLaunchProfileConfig) { NO, nil, nil };
169+
return (SentryLaunchProfileConfig) { options.enableAppLaunchProfiling, nil, nil };
173170
}
174171

175172
return sentry_launchShouldHaveTransactionProfiling(options);

Sources/Sentry/SentryFileManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ - (BOOL)isDirectory:(NSString *)path
858858
writeAppLaunchProfilingConfigFile(NSMutableDictionary<NSString *, NSNumber *> *config)
859859
{
860860
NSError *error;
861+
SENTRY_LOG_DEBUG(@"Writing launch profiling config file.");
861862
SENTRY_CASSERT([config writeToURL:launchProfileConfigFileURL() error:&error],
862863
@"Failed to write launch profile config file: %@.", error);
863864
}

0 commit comments

Comments
 (0)