Only log a few types of GC causes for the blocking cases

There are various types like debugger and GetObjectsAllocated that
can cause spam if we log all the blocking calls. In practice, these
are only used from tools and should not cause jank.

Bug: 37275712
Test: test-art-host

(cherry picked from commit 3b91fccc0a83c6c9ce7fef484495f863d739baff)

Change-Id: I457fa94985fda88b1cf208c935e1369493e036cb
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 7da7221..bd4f99b 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -3517,7 +3517,13 @@
     // is not the heap task daemon thread, it's considered as a
     // blocking GC (i.e., blocking itself).
     running_collection_is_blocking_ = true;
-    VLOG(gc) << "Starting a blocking GC " << cause;
+    // Don't log fake "GC" types that are only used for debugger or hidden APIs. If we log these,
+    // it results in log spam. kGcCauseExplicit is already logged in LogGC, so avoid it here too.
+    if (cause == kGcCauseForAlloc ||
+        cause == kGcCauseForNativeAlloc ||
+        cause == kGcCauseDisableMovingGc) {
+      VLOG(gc) << "Starting a blocking GC " << cause;
+    }
   }
   return last_gc_type;
 }