From 2eaa94cac43747d1eed18a35db594a83031876a5 Mon Sep 17 00:00:00 2001 From: ilnik Date: Wed, 1 Nov 2023 17:22:32 +0100 Subject: [PATCH] Replace address-like thread names with a common value Sometimes threads get named like "0xdd000001", "0xdd000002", and these names don't persist across runs. This makes comparing pprofs difficult. --- ProfileWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProfileWriter.cs b/ProfileWriter.cs index 83578d6..f1e3878 100644 --- a/ProfileWriter.cs +++ b/ProfileWriter.cs @@ -114,7 +114,7 @@ public void AddSample(ICpuSample sample) } string processName = sample.Process.ImageName; string threadLabel = sample.Thread?.Name; - if (threadLabel == null || threadLabel == "") + if (threadLabel == null || threadLabel == "" || threadLabel.StartsWith("0x")) threadLabel = "anonymous thread"; if (options.includeProcessAndThreadIds) {