From 018bf2ba174d6a93249cf779ed6e10d220907ddf Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 25 Mar 2015 10:46:19 -0700 Subject: [PATCH] Add tracing for major GC in Sky Ideally we'd trace VM operations from inside the VM, but we don't yet have DartVM wired into tracing. Instead, we use these GC hooks to trace how long major GC takes. R=rafaelw@chromium.org Review URL: https://codereview.chromium.org/1031083003 --- engine/tonic/dart_gc_controller.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/tonic/dart_gc_controller.cc b/engine/tonic/dart_gc_controller.cc index 61a830eecd9..379fa690cdc 100644 --- a/engine/tonic/dart_gc_controller.cc +++ b/engine/tonic/dart_gc_controller.cc @@ -5,6 +5,7 @@ #include "sky/engine/config.h" #include "sky/engine/tonic/dart_gc_controller.h" +#include "base/trace_event/trace_event.h" #include "dart/runtime/include/dart_api.h" #include "sky/engine/tonic/dart_gc_context.h" #include "sky/engine/tonic/dart_gc_visitor.h" @@ -33,6 +34,8 @@ void Visit(void* isolate_callback_data, } // namespace void DartGCPrologue() { + TRACE_EVENT_ASYNC_BEGIN0("sky", "DartGC", 0); + Dart_EnterScope(); DCHECK(!g_gc_context); g_gc_context = new DartGCContext(); @@ -43,6 +46,8 @@ void DartGCEpilogue() { delete g_gc_context; g_gc_context = nullptr; Dart_ExitScope(); + + TRACE_EVENT_ASYNC_END0("sky", "DartGC", 0); } } // namespace blink