Skip to content

Commit 30d910f

Browse files
authored
Adjust cgroupv2 drive format check for .NET 10 and higher (#6877)
1 parent a4b3d62 commit 30d910f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/ResourceMonitoringLinuxCgroupVersion.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ public static bool GetCgroupType()
2323
{
2424
DriveInfo[] allDrives = DriveInfo.GetDrives();
2525
var injectParserV2 = false;
26-
const string CgroupVersion = "cgroup2fs";
26+
const string CgroupVersion =
27+
#if NET10_0_OR_GREATER
28+
"cgroup2";
29+
#else
30+
"cgroup2fs";
31+
#endif
32+
2733
const string UnifiedCgroupPath = "/sys/fs/cgroup/unified";
2834

2935
// We check which cgroup version is mounted in the system and based on that we inject the parser.

0 commit comments

Comments
 (0)