@@ -43,8 +43,9 @@ public void SetDynamicTag(string key, string value)
4343 {
4444 NativeInterop . SetDynamicTag ( key , value ) ;
4545 }
46- catch ( DllNotFoundException )
46+ catch ( DllNotFoundException ex )
4747 {
48+ DllNotFound ( ex ) ;
4849 _dllNotFound = true ;
4950 }
5051 }
@@ -59,8 +60,9 @@ public void ClearDynamicTags()
5960 {
6061 NativeInterop . ClearDynamicTags ( ) ;
6162 }
62- catch ( DllNotFoundException )
63+ catch ( DllNotFoundException ex )
6364 {
65+ DllNotFound ( ex ) ;
6466 _dllNotFound = true ;
6567 }
6668 }
@@ -80,8 +82,9 @@ public void SetCPUTrackingEnabled(bool enabled)
8082 {
8183 NativeInterop . SetCPUTrackingEnabled ( enabled ) ;
8284 }
83- catch ( DllNotFoundException )
85+ catch ( DllNotFoundException ex )
8486 {
87+ DllNotFound ( ex ) ;
8588 _dllNotFound = true ;
8689 }
8790 }
@@ -100,8 +103,9 @@ public void SetAllocationTrackingEnabled(bool enabled)
100103 {
101104 NativeInterop . SetAllocationTrackingEnabled ( enabled ) ;
102105 }
103- catch ( DllNotFoundException )
106+ catch ( DllNotFoundException ex )
104107 {
108+ DllNotFound ( ex ) ;
105109 _dllNotFound = true ;
106110 }
107111 }
@@ -120,8 +124,9 @@ public void SetContentionTrackingEnabled(bool enabled)
120124 {
121125 NativeInterop . SetContentionTrackingEnabled ( enabled ) ;
122126 }
123- catch ( DllNotFoundException )
127+ catch ( DllNotFoundException ex )
124128 {
129+ DllNotFound ( ex ) ;
125130 _dllNotFound = true ;
126131 }
127132 }
@@ -140,8 +145,9 @@ public void SetExceptionTrackingEnabled(bool enabled)
140145 {
141146 NativeInterop . SetExceptionTrackingEnabled ( enabled ) ;
142147 }
143- catch ( DllNotFoundException )
148+ catch ( DllNotFoundException ex )
144149 {
150+ DllNotFound ( ex ) ;
145151 _dllNotFound = true ;
146152 }
147153 }
@@ -156,8 +162,9 @@ public void SetAuthToken(string authToken)
156162 {
157163 NativeInterop . SetAuthToken ( authToken ) ;
158164 }
159- catch ( DllNotFoundException )
165+ catch ( DllNotFoundException ex )
160166 {
167+ DllNotFound ( ex ) ;
161168 _dllNotFound = true ;
162169 }
163170 }
@@ -172,11 +179,16 @@ public void SetBasicAuth(string username, string password)
172179 {
173180 NativeInterop . SetBasicAuth ( username , password ) ;
174181 }
175- catch ( DllNotFoundException )
182+ catch ( DllNotFoundException ex )
176183 {
184+ DllNotFound ( ex ) ;
177185 _dllNotFound = true ;
178186 }
179187 }
188+
189+ private static void DllNotFound ( DllNotFoundException ex ) {
190+ Console . WriteLine ( $ "[Profiler] Failed to load Pyroscope.Profiler.Native.so : { ex } .\n Consider setting LD_LIBRARY_PATH pointing to the directory containing the Pyroscope.Profiler.Native.so") ;
191+ }
180192
181193 private readonly ContextTracker _contextTracker ;
182194 private bool _dllNotFound ;
0 commit comments