@@ -11,7 +11,7 @@ namespace Ultra.Core;
11
11
/// </summary>
12
12
internal sealed class UltraProfilerEventPipe : UltraProfiler
13
13
{
14
- private static string PathToNativeUltraSampler => Path . Combine ( AppContext . BaseDirectory , "libUltraSamplerHook.dyld " ) ;
14
+ private static string PathToNativeUltraSampler => Path . Combine ( AppContext . BaseDirectory , "libUltraSamplerHook.dylib " ) ;
15
15
16
16
/// <summary>
17
17
/// Initializes a new instance of the <see cref="UltraProfiler"/> class.
@@ -97,11 +97,13 @@ private static void SetupUltraSampler(ProcessStartInfo startInfo)
97
97
98
98
private class UltraSamplerProfilerState
99
99
{
100
+ private readonly CancellationToken _token ;
100
101
private readonly DiagnosticPortSession _samplerSession ;
101
102
private readonly DiagnosticPortSession _clrSession ;
102
-
103
+
103
104
public UltraSamplerProfilerState ( string baseName , int pid , CancellationToken token )
104
105
{
106
+ _token = token ;
105
107
_samplerSession = new ( pid , true , baseName , token ) ;
106
108
_clrSession = new ( pid , false , baseName , token ) ;
107
109
}
@@ -129,8 +131,11 @@ public long TotalFileLength()
129
131
public async Task StartProfiling ( )
130
132
{
131
133
await _samplerSession . WaitForConnectAndStartSession ( ) ;
134
+
135
+ await _samplerSession . StartProfiling ( _token ) ;
136
+ await _clrSession . StartProfiling ( _token ) ;
132
137
}
133
-
138
+
134
139
public async ValueTask StopAndDisposeAsync ( )
135
140
{
136
141
await _samplerSession . StopAndDisposeAsync ( ) . ConfigureAwait ( false ) ;
0 commit comments