From 07d0a8d8ccd76b152cc335bfc0bf6b752c593ee4 Mon Sep 17 00:00:00 2001 From: Sara Adams Date: Mon, 27 Nov 2023 06:54:32 -0800 Subject: [PATCH] [JSON Trace Profile] Correctly identify GC thread Currently, the thread that includes the garbage collection notification events is not correctly identified. This means that in the JSON trace profile, the thread: * is not renamed, as desired. * is not sorted towards the top, as desired. The thread is identified by its name, which has changed from "Service Thread" to "Notification Thread". This change updates the profile code accordingly. In response to https://github.com/bazelbuild/bazel/issues/18548#issuecomment-1823361627 Fixes https://github.com/EngFlow/bazel_invocation_analyzer/issues/110 Closes #20299. PiperOrigin-RevId: 585639069 Change-Id: Id4aadb5451839b5be07ac98428f9367764ff46ce --- .../com/google/devtools/build/lib/profiler/ThreadMetadata.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/profiler/ThreadMetadata.java b/src/main/java/com/google/devtools/build/lib/profiler/ThreadMetadata.java index d51fb13af17196..99b1a39fc25b32 100644 --- a/src/main/java/com/google/devtools/build/lib/profiler/ThreadMetadata.java +++ b/src/main/java/com/google/devtools/build/lib/profiler/ThreadMetadata.java @@ -49,7 +49,7 @@ private static boolean isMainThread(String threadName) { } private static boolean isGCThread(String threadName) { - return threadName.equals("Service Thread"); + return threadName.equals("Notification Thread"); } private static String getReadableName(String threadName) {