Commit 6079966b authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap, inspector] Emit GC events in "devtools.timeline" category

These GC events will not be visualized in DevTools UI. The intention
is to have these events in JSON trace file for manual inspection during
offline/postmortem investigation of GC performance issues.

Bug: chromium:1072352
Change-Id: I3b05a0b2e5299f9d00d4c940eaf598a48f746aa2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2154796Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67227}
parent 36e80d38
......@@ -25,19 +25,20 @@ inline BytesAndDuration MakeBytesAndDuration(uint64_t bytes, double duration) {
enum ScavengeSpeedMode { kForAllObjects, kForSurvivedObjects };
#define TRACE_GC_CATEGORIES \
TRACE_DISABLED_BY_DEFAULT("v8.gc") ",devtools.timeline"
#define TRACE_GC(tracer, scope_id) \
GCTracer::Scope::ScopeId gc_tracer_scope_id(scope_id); \
GCTracer::Scope gc_tracer_scope(tracer, gc_tracer_scope_id); \
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"), \
GCTracer::Scope::Name(gc_tracer_scope_id))
TRACE_EVENT0(TRACE_GC_CATEGORIES, GCTracer::Scope::Name(gc_tracer_scope_id))
#define TRACE_BACKGROUND_GC(tracer, scope_id) \
WorkerThreadRuntimeCallStatsScope runtime_call_stats_scope( \
tracer->worker_thread_runtime_call_stats()); \
GCTracer::BackgroundScope background_scope(tracer, scope_id, \
runtime_call_stats_scope.Get()); \
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"), \
GCTracer::BackgroundScope::Name(scope_id))
TRACE_EVENT0(TRACE_GC_CATEGORIES, GCTracer::BackgroundScope::Name(scope_id))
// GCTracer collects and prints ONE line after each garbage collector
// invocation IFF --trace_gc is used.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment