Skip to content

Commit ee3f02e

Browse files
authored
ref: profile sample mocking (#3133)
1 parent 596ccc1 commit ee3f02e

14 files changed

+251
-141
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,8 @@
604604
84281C432A578E5600EE88F2 /* SentryProfilerState.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84281C422A578E5600EE88F2 /* SentryProfilerState.mm */; };
605605
84281C462A57905700EE88F2 /* SentrySample.h in Headers */ = {isa = PBXBuildFile; fileRef = 84281C442A57905700EE88F2 /* SentrySample.h */; };
606606
84281C472A57905700EE88F2 /* SentrySample.m in Sources */ = {isa = PBXBuildFile; fileRef = 84281C452A57905700EE88F2 /* SentrySample.m */; };
607+
84281C622A579D0700EE88F2 /* SentryProfilerMocksSwiftCompatible.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84281C4D2A579A0C00EE88F2 /* SentryProfilerMocksSwiftCompatible.mm */; };
608+
84281C632A579D0700EE88F2 /* SentryProfilerMocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84281C492A57933600EE88F2 /* SentryProfilerMocks.mm */; };
607609
8431EE5B29ADB8EA00D8DC56 /* SentryTimeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8431EE5A29ADB8EA00D8DC56 /* SentryTimeTests.m */; };
608610
8431EFD129B27B1100D8DC56 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63AA759B1EB8AEF500D153DE /* Sentry.framework */; settings = {ATTRIBUTES = (Required, ); }; };
609611
8431EFD329B27B1100D8DC56 /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 630C01951EC341D600C52CEF /* Resources */; };
@@ -639,7 +641,7 @@
639641
8454CF8D293EAF9A006AC140 /* SentryMetricProfiler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8454CF8B293EAF9A006AC140 /* SentryMetricProfiler.mm */; };
640642
849AC40029E0C1FF00889C16 /* SentryFormatterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849AC3FF29E0C1FF00889C16 /* SentryFormatterTests.swift */; };
641643
84A5D75B29D5170700388BFA /* TimeInterval+Sentry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A5D75A29D5170700388BFA /* TimeInterval+Sentry.swift */; };
642-
84A888FD28D9B11700C51DFD /* SentryProfiler+Test.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */; };
644+
84A888FD28D9B11700C51DFD /* SentryProfiler+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A888FC28D9B11700C51DFD /* SentryProfiler+Private.h */; };
643645
84A8891C28DBD28900C51DFD /* SentryDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A8891A28DBD28900C51DFD /* SentryDevice.h */; };
644646
84A8891D28DBD28900C51DFD /* SentryDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84A8891B28DBD28900C51DFD /* SentryDevice.mm */; };
645647
84A8892128DBD8D600C51DFD /* SentryDeviceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84A8892028DBD8D600C51DFD /* SentryDeviceTests.mm */; };
@@ -1527,6 +1529,12 @@
15271529
84281C422A578E5600EE88F2 /* SentryProfilerState.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfilerState.mm; sourceTree = "<group>"; };
15281530
84281C442A57905700EE88F2 /* SentrySample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySample.h; path = ../include/SentrySample.h; sourceTree = "<group>"; };
15291531
84281C452A57905700EE88F2 /* SentrySample.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySample.m; sourceTree = "<group>"; };
1532+
84281C482A57933600EE88F2 /* SentryProfilerMocks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryProfilerMocks.h; sourceTree = "<group>"; };
1533+
84281C492A57933600EE88F2 /* SentryProfilerMocks.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfilerMocks.mm; sourceTree = "<group>"; };
1534+
84281C4C2A579A0C00EE88F2 /* SentryProfilerMocksSwiftCompatible.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryProfilerMocksSwiftCompatible.h; sourceTree = "<group>"; };
1535+
84281C4D2A579A0C00EE88F2 /* SentryProfilerMocksSwiftCompatible.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfilerMocksSwiftCompatible.mm; sourceTree = "<group>"; };
1536+
84281C642A57D36100EE88F2 /* SentryProfilerState+ObjCpp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryProfilerState+ObjCpp.h"; path = "../include/SentryProfilerState+ObjCpp.h"; sourceTree = "<group>"; };
1537+
84281C652A58A16500EE88F2 /* SentryProfiler+Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryProfiler+Test.h"; sourceTree = "<group>"; };
15301538
8431EE5A29ADB8EA00D8DC56 /* SentryTimeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryTimeTests.m; sourceTree = "<group>"; };
15311539
8431EFD929B27B1100D8DC56 /* SentryProfilerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SentryProfilerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
15321540
8431EFDA29B27B1200D8DC56 /* SentryTests copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "SentryTests copy-Info.plist"; path = "/Users/andrewmcknight/Code/organization/getsentry/repos/public/sentry-cocoa/SentryTests copy-Info.plist"; sourceTree = "<absolute>"; };
@@ -1574,7 +1582,7 @@
15741582
849472842971C41A002603DE /* SentryNSTimerFactoryTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNSTimerFactoryTest.swift; sourceTree = "<group>"; };
15751583
849AC3FF29E0C1FF00889C16 /* SentryFormatterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentryFormatterTests.swift; sourceTree = "<group>"; };
15761584
84A5D75A29D5170700388BFA /* TimeInterval+Sentry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TimeInterval+Sentry.swift"; sourceTree = "<group>"; };
1577-
84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SentryProfiler+Test.h"; path = "Sources/Sentry/include/SentryProfiler+Test.h"; sourceTree = SOURCE_ROOT; };
1585+
84A888FC28D9B11700C51DFD /* SentryProfiler+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SentryProfiler+Private.h"; path = "Sources/Sentry/include/SentryProfiler+Private.h"; sourceTree = SOURCE_ROOT; };
15781586
84A8891A28DBD28900C51DFD /* SentryDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDevice.h; path = include/SentryDevice.h; sourceTree = "<group>"; };
15791587
84A8891B28DBD28900C51DFD /* SentryDevice.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDevice.mm; sourceTree = "<group>"; };
15801588
84A8892028DBD8D600C51DFD /* SentryDeviceTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDeviceTests.mm; sourceTree = "<group>"; };
@@ -2017,6 +2025,7 @@
20172025
84C47B2B2A09239100DAEB8A /* .codecov.yml */,
20182026
844DA80628246D5000E6B62E /* .craft.yml */,
20192027
844DA80A28246D5000E6B62E /* .swiftlint.yml */,
2028+
84281C552A579C2B00EE88F2 /* SentryTestUtilsObjc */,
20202029
6304360C1EC05CEF00C4D3FA /* Frameworks */,
20212030
6327C5D41EB8A783004E799B /* Products */,
20222031
63AA756E1EB8AEDB00D153DE /* Sources */,
@@ -2215,6 +2224,7 @@
22152224
isa = PBXGroup;
22162225
children = (
22172226
7B3878E92490D90400EBDEA2 /* SentryClient+TestInit.h */,
2227+
84281C652A58A16500EE88F2 /* SentryProfiler+Test.h */,
22182228
7B569DFE2590EEF600B653FC /* SentryScope+Equality.h */,
22192229
7B569E052590F04700B653FC /* SentryScope+Properties.h */,
22202230
7B9421C4260CA393001F9349 /* SentrySDK+Tests.h */,
@@ -3103,7 +3113,9 @@
31033113
03F84D1127DD414C008FE43F /* SentryProfiler.h */,
31043114
03F84D2B27DD4191008FE43F /* SentryProfiler.mm */,
31053115
84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */,
3116+
84A888FC28D9B11700C51DFD /* SentryProfiler+Private.h */,
31063117
0354A22A2A134D9C003C3A04 /* SentryProfilerState.h */,
3118+
84281C642A57D36100EE88F2 /* SentryProfilerState+ObjCpp.h */,
31073119
84281C422A578E5600EE88F2 /* SentryProfilerState.mm */,
31083120
0356A56E288B4612008BF593 /* SentryProfilesSampler.h */,
31093121
0356A56F288B4612008BF593 /* SentryProfilesSampler.m */,
@@ -3129,6 +3141,13 @@
31293141
path = Profiling;
31303142
sourceTree = "<group>";
31313143
};
3144+
84281C552A579C2B00EE88F2 /* SentryTestUtilsObjc */ = {
3145+
isa = PBXGroup;
3146+
children = (
3147+
);
3148+
path = SentryTestUtilsObjc;
3149+
sourceTree = "<group>";
3150+
};
31323151
8431EFDB29B27B3D00D8DC56 /* SentryProfilerTests */ = {
31333152
isa = PBXGroup;
31343153
children = (
@@ -3161,6 +3180,10 @@
31613180
children = (
31623181
7BD47B4C268F0B080076A663 /* ClearTestState.swift */,
31633182
84AC61D829F7643B009EEF61 /* TestDispatchFactory.swift */,
3183+
84281C482A57933600EE88F2 /* SentryProfilerMocks.h */,
3184+
84281C492A57933600EE88F2 /* SentryProfilerMocks.mm */,
3185+
84281C4C2A579A0C00EE88F2 /* SentryProfilerMocksSwiftCompatible.h */,
3186+
84281C4D2A579A0C00EE88F2 /* SentryProfilerMocksSwiftCompatible.mm */,
31643187
84AC61DA29F7654A009EEF61 /* TestDispatchSourceWrapper.swift */,
31653188
84A5D75A29D5170700388BFA /* TimeInterval+Sentry.swift */,
31663189
7B30B68126527C55006B2752 /* TestDisplayLinkWrapper.swift */,
@@ -3469,7 +3492,7 @@
34693492
7BAF3DD92440AEC8008A5414 /* SentryRequestManager.h in Headers */,
34703493
627E7589299F6FE40085504D /* SentryInternalDefines.h in Headers */,
34713494
7BE3C77B2446111500A38442 /* SentryRateLimitParser.h in Headers */,
3472-
84A888FD28D9B11700C51DFD /* SentryProfiler+Test.h in Headers */,
3495+
84A888FD28D9B11700C51DFD /* SentryProfiler+Private.h in Headers */,
34733496
7D0637032382B34300B30749 /* SentryScope.h in Headers */,
34743497
03F84D2727DD414C008FE43F /* SentryMachLogging.hpp in Headers */,
34753498
0356A570288B4612008BF593 /* SentryProfilesSampler.h in Headers */,
@@ -4442,6 +4465,7 @@
44424465
84AC61D929F7643B009EEF61 /* TestDispatchFactory.swift in Sources */,
44434466
8431F01929B2852D00D8DC56 /* Invocation.swift in Sources */,
44444467
84B7FA4629B2935F00AD93B1 /* ClearTestState.swift in Sources */,
4468+
84281C622A579D0700EE88F2 /* SentryProfilerMocksSwiftCompatible.mm in Sources */,
44454469
8431F01529B2851500D8DC56 /* TestSentryNSTimerFactory.swift in Sources */,
44464470
84B7FA3C29B2876F00AD93B1 /* TestConstants.swift in Sources */,
44474471
8431F01A29B2852D00D8DC56 /* Dynamic.swift in Sources */,
@@ -4453,6 +4477,7 @@
44534477
84B7FA4529B2926900AD93B1 /* TestDisplayLinkWrapper.swift in Sources */,
44544478
84AC61DB29F7654A009EEF61 /* TestDispatchSourceWrapper.swift in Sources */,
44554479
8431F01729B2851500D8DC56 /* TestSentrySystemWrapper.swift in Sources */,
4480+
84281C632A579D0700EE88F2 /* SentryProfilerMocks.mm in Sources */,
44564481
84B7FA4129B28CD200AD93B1 /* TestSentryDispatchQueueWrapper.swift in Sources */,
44574482
84B7FA3E29B28ADD00AD93B1 /* TestClient.swift in Sources */,
44584483
);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#import "SentryProfilingConditionals.h"
2+
#import <Foundation/Foundation.h>
3+
4+
#if SENTRY_TARGET_PROFILING_SUPPORTED
5+
6+
# import "SentryBacktrace.hpp"
7+
8+
using namespace sentry::profiling;
9+
10+
NS_ASSUME_NONNULL_BEGIN
11+
12+
Backtrace mockBacktrace(thread::TIDType threadID, const int threadPriority,
13+
const char *_Nullable threadName, std::uint64_t queueAddress, std::string queueLabel,
14+
std::vector<std::uintptr_t> addresses);
15+
16+
NS_ASSUME_NONNULL_END
17+
18+
#endif // SENTRY_TARGET_PROFILING_SUPPORTED
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#import "SentryProfilerMocks.h"
2+
3+
#if SENTRY_TARGET_PROFILING_SUPPORTED
4+
5+
Backtrace
6+
mockBacktrace(thread::TIDType threadID, const int threadPriority, const char *threadName,
7+
std::uint64_t queueAddress, std::string queueLabel, std::vector<std::uintptr_t> addresses)
8+
{
9+
ThreadMetadata threadMetadata;
10+
if (threadName != nullptr) {
11+
threadMetadata.name = threadName;
12+
}
13+
threadMetadata.threadID = threadID;
14+
threadMetadata.priority = threadPriority;
15+
16+
QueueMetadata queueMetadata;
17+
queueMetadata.address = queueAddress;
18+
queueMetadata.label = std::make_shared<std::string>(queueLabel);
19+
20+
Backtrace backtrace;
21+
backtrace.threadMetadata = threadMetadata;
22+
backtrace.queueMetadata = queueMetadata;
23+
backtrace.addresses = std::vector<std::uintptr_t>(addresses);
24+
25+
return backtrace;
26+
}
27+
28+
#endif // SENTRY_TARGET_PROFILING_SUPPORTED
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#import "SentryProfilingConditionals.h"
2+
#import <Foundation/Foundation.h>
3+
4+
#if SENTRY_TARGET_PROFILING_SUPPORTED
5+
6+
@class SentryProfilerState;
7+
8+
NS_ASSUME_NONNULL_BEGIN
9+
10+
/**
11+
* This delivers a wrapper around the C++ function to create a mock backtrace for incorporation into
12+
* profiler state that can be called from Swift tests.
13+
*/
14+
@interface SentryProfilerMocksSwiftCompatible : NSObject
15+
16+
+ (void)appendMockBacktraceToState:(SentryProfilerState *)state
17+
threadID:(uint64_t)threadID
18+
threadPriority:(const int)threadPriority
19+
threadName:(nullable NSString *)threadName
20+
queueAddress:(uint64_t)queueAddress
21+
queueLabel:(NSString *)queueLabel
22+
addresses:(NSArray<NSNumber *> *)addresses;
23+
24+
@end
25+
26+
NS_ASSUME_NONNULL_END
27+
28+
#endif // SENTRY_TARGET_PROFILING_SUPPORTED
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#import "SentryProfilerMocksSwiftCompatible.h"
2+
3+
#if SENTRY_TARGET_PROFILING_SUPPORTED
4+
5+
# import "SentryCurrentDate.h"
6+
# import "SentryProfilerMocks.h"
7+
# import "SentryProfilerState+ObjCpp.h"
8+
# include <vector>
9+
10+
using namespace std;
11+
12+
@implementation SentryProfilerMocksSwiftCompatible
13+
14+
+ (void)appendMockBacktraceToState:(SentryProfilerState *)state
15+
threadID:(uint64_t)threadID
16+
threadPriority:(const int)threadPriority
17+
threadName:(nullable NSString *)threadName
18+
queueAddress:(uint64_t)queueAddress
19+
queueLabel:(NSString *)queueLabel
20+
addresses:(NSArray<NSNumber *> *)addresses
21+
{
22+
auto backtraceAddresses = std::vector<std::uintptr_t>();
23+
24+
for (NSNumber *address in addresses) {
25+
backtraceAddresses.push_back(address.unsignedLongLongValue);
26+
}
27+
28+
auto backtrace = mockBacktrace(threadID, threadPriority,
29+
[threadName cStringUsingEncoding:NSUTF8StringEncoding], queueAddress,
30+
[queueLabel cStringUsingEncoding:NSUTF8StringEncoding], backtraceAddresses);
31+
backtrace.absoluteTimestamp = SentryCurrentDate.getCurrentDateProvider.systemTime;
32+
[state appendBacktrace:backtrace];
33+
}
34+
35+
@end
36+
37+
#endif // SENTRY_TARGET_PROFILING_SUPPORTED

Sources/Sentry/SentryProfiler.mm

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import "SentryProfiler+Test.h"
1+
#import "SentryProfiler+Private.h"
22

33
#if SENTRY_TARGET_PROFILING_SUPPORTED
44
# import "NSDate+SentryExtras.h"
@@ -24,7 +24,7 @@
2424
# import "SentryNSProcessInfoWrapper.h"
2525
# import "SentryNSTimerFactory.h"
2626
# import "SentryProfileTimeseries.h"
27-
# import "SentryProfilerState.h"
27+
# import "SentryProfilerState+ObjCpp.h"
2828
# import "SentrySample.h"
2929
# import "SentrySamplingProfiler.hpp"
3030
# import "SentryScope+Private.h"
@@ -268,7 +268,6 @@
268268
}
269269

270270
@implementation SentryProfiler {
271-
SentryProfilerState *_state;
272271
std::shared_ptr<SamplingProfiler> _profiler;
273272
SentryMetricProfiler *_metricProfiler;
274273
SentryDebugImageProvider *_debugImageProvider;
@@ -375,7 +374,7 @@ + (SentryEnvelopeItem *)createProfilingEnvelopeItemForTransaction:(SentryTransac
375374
return nil;
376375
}
377376

378-
return serializedProfileData([_gCurrentProfiler->_state copyProfilingData], transaction,
377+
return serializedProfileData([_gCurrentProfiler._state copyProfilingData], transaction,
379378
profileID, profilerTruncationReasonName(_gCurrentProfiler->_truncationReason),
380379
_gCurrentProfiler -> _hub.scope.environmentString
381380
?: _gCurrentProfiler->_hub.getClient.options.environment,
@@ -470,7 +469,7 @@ - (void)start
470469
SENTRY_LOG_DEBUG(@"Starting profiler.");
471470

472471
SentryProfilerState *const state = [[SentryProfilerState alloc] init];
473-
_state = state;
472+
self._state = state;
474473
_profiler = std::make_shared<SamplingProfiler>(
475474
[state](auto &backtrace) {
476475
// in test, we'll overwrite the sample's timestamp to one mocked by SentryCurrentDate
@@ -529,6 +528,15 @@ - (BOOL)isRunning
529528
return _profiler->isSampling();
530529
}
531530

531+
# pragma mark - Testing helpers
532+
533+
# if defined(TEST) || defined(TESTCI)
534+
+ (SentryProfiler *)getCurrentProfiler
535+
{
536+
return _gCurrentProfiler;
537+
}
538+
# endif // defined(TEST) || defined(TESTCI)
539+
532540
@end
533541

534542
#endif

Sources/Sentry/include/SentryProfiler+Test.h renamed to Sources/Sentry/include/SentryProfiler+Private.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#include "SentryBacktrace.hpp"
21
#import "SentryProfiler.h"
32
#import "SentryProfilingConditionals.h"
43

54
#if SENTRY_TARGET_PROFILING_SUPPORTED
65

76
@class SentryDebugMeta;
87
@class SentryId;
8+
@class SentryProfilerState;
99
@class SentrySample;
1010
@class SentryTransaction;
1111

@@ -16,6 +16,13 @@ NSDictionary<NSString *, id> *serializedProfileData(NSDictionary<NSString *, id>
1616
NSString *environment, NSString *release, NSDictionary<NSString *, id> *serializedMetrics,
1717
NSArray<SentryDebugMeta *> *debugMeta, SentryHub *hub);
1818

19+
@interface
20+
SentryProfiler ()
21+
22+
@property (strong, nonatomic) SentryProfilerState *_state;
23+
24+
@end
25+
1926
NS_ASSUME_NONNULL_END
2027

21-
#endif
28+
#endif // SENTRY_TARGET_PROFILING_SUPPORTED
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#import "SentryProfilingConditionals.h"
2+
3+
#if SENTRY_TARGET_PROFILING_SUPPORTED
4+
5+
# import "SentryBacktrace.hpp"
6+
# import "SentryProfilerState.h"
7+
8+
/*
9+
* This extension defines C++ interface on SentryProfilerState that is not able to be imported into
10+
* a bridging header via SentryProfilerState.h due to C++/Swift interop limitations.
11+
*/
12+
13+
@interface
14+
SentryProfilerState ()
15+
16+
- (void)appendBacktrace:(const sentry::profiling::Backtrace &)backtrace;
17+
18+
@end
19+
20+
#endif // SENTRY_TARGET_PROFILING_SUPPORTED

Sources/Sentry/include/SentryProfilerState.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
#import "SentryBacktrace.hpp"
21
#import "SentryProfilingConditionals.h"
32
#import <Foundation/Foundation.h>
43

4+
/*
5+
* This file should not contain any C++ interfaces so it can be used from Swift tests. See
6+
* SentryProfilerState+ObjCpp.h.
7+
*/
8+
59
#if SENTRY_TARGET_PROFILING_SUPPORTED
610

711
NS_ASSUME_NONNULL_BEGIN
@@ -73,7 +77,6 @@ NSString *parseBacktraceSymbolsFunctionName(const char *symbol);
7377
@interface SentryProfilerState : NSObject
7478
// All functions are safe to call from multiple threads concurrently
7579
- (void)mutate:(void (^)(SentryProfilerMutableState *))block;
76-
- (void)appendBacktrace:(const sentry::profiling::Backtrace &)backtrace;
7780
- (NSDictionary<NSString *, id> *)copyProfilingData;
7881
@end
7982

0 commit comments

Comments
 (0)