File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
src/tests/tracing/eventpipe/processinfo3 Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,29 @@ public static int Main()
288288 }
289289 else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
290290 {
291- expectedPortableRidOs = "linux" ;
291+ // Check process modules for C library type indication to determine
292+ // which linux RID OS is applicable.
293+ Logger . logger . Log ( "Begin checking process modules to determine C library type." ) ;
294+ for ( int i = 0 ; i < currentProcess . Modules . Count ; i ++ )
295+ {
296+ ProcessModule module = currentProcess . Modules [ i ] ;
297+ Logger . logger . Log ( $ "- { module . ModuleName } ") ;
298+
299+ if ( module . ModuleName . StartsWith ( "libc." , StringComparison . Ordinal ) ||
300+ module . ModuleName . StartsWith ( "libc-" , StringComparison . Ordinal ) )
301+ {
302+ Logger . logger . Log ( "Found gnu libc indicator." ) ;
303+ expectedPortableRidOs = "linux" ;
304+ break ;
305+ }
306+ else if ( module . ModuleName . StartsWith ( "ld-musl-" , StringComparison . Ordinal ) )
307+ {
308+ Logger . logger . Log ( "Found musl libc indicator." ) ;
309+ expectedPortableRidOs = "linux-musl" ;
310+ break ;
311+ }
312+ }
313+ Logger . logger . Log ( "Finished checking process modules." ) ;
292314 }
293315
294316 Utils . Assert ( ! string . IsNullOrEmpty ( expectedPortableRidOs ) , $ "Unable to calculate expected portable RID OS.") ;
You can’t perform that action at this time.
0 commit comments