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
This commit is contained in:
Adam Barth 2015-03-25 10:46:19 -07:00
parent 4e7a413422
commit 018bf2ba17

View File

@ -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