-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(profiling): continuous profiling from launch (#3938)
- Loading branch information
1 parent
2b9e267
commit f1d1166
Showing
22 changed files
with
404 additions
and
287 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#import "SentryLaunchProfiling.h" | ||
|
||
#if SENTRY_TARGET_PROFILING_SUPPORTED | ||
|
||
# import "SentryDefines.h" | ||
|
||
@class SentryOptions; | ||
@class SentrySamplerDecision; | ||
@class SentryTracer; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
typedef struct { | ||
BOOL shouldProfile; | ||
SentrySamplerDecision *_Nullable tracesDecision; | ||
SentrySamplerDecision *_Nullable profilesDecision; | ||
} SentryLaunchProfileConfig; | ||
|
||
SENTRY_EXTERN NSString *const kSentryLaunchProfileConfigKeyTracesSampleRate; | ||
SENTRY_EXTERN NSString *const kSentryLaunchProfileConfigKeyProfilesSampleRate; | ||
SENTRY_EXTERN NSString *const kSentryLaunchProfileConfigKeyContinuousProfiling; | ||
|
||
SENTRY_EXTERN SentryTracer *_Nullable sentry_launchTracer; | ||
|
||
SentryLaunchProfileConfig sentry_shouldProfileNextLaunch(SentryOptions *options); | ||
|
||
/** | ||
* `sentry_shouldProfileNextLaunch` cannot be exposed to Swift tests because its return type is not | ||
* expressible in Swift. This wraps it and only returns the `BOOL shouldProfile` value in the | ||
* struct. | ||
*/ | ||
BOOL sentry_willProfileNextLaunch(SentryOptions *options); | ||
|
||
/** | ||
* Contains the logic to start a launch profile. Exposed separately from @c | ||
* sentry_startLaunchProfile, because that function wraps everything in a @c dispatch_once , and | ||
* that path is taken once when @c SenryProfiler.load is called at the start of the test suite, and | ||
* can't be executed again by calling that function. | ||
*/ | ||
void _sentry_nondeduplicated_startLaunchProfile(void); | ||
|
||
SentryTransactionContext *sentry_context(NSNumber *tracesRate); | ||
|
||
NS_ASSUME_NONNULL_END | ||
|
||
#endif // SENTRY_TARGET_PROFILING_SUPPORTED |
This file contains 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
Oops, something went wrong.