Commit e43dfd7f authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[perfetto,heap] Fix the order of GC trace event categories

This changes "v8[.gc],devtools.timeline" to "devtools.timeline,v8[.gc"
in some of the GC trace events because perfetto requires all categories
to be predefined.

Change-Id: I0e9a91c826f4e620f4946a1a96713aa2b45da26f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2193591
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67727}
parent 4e1bf2bc
......@@ -26,7 +26,7 @@ inline BytesAndDuration MakeBytesAndDuration(uint64_t bytes, double duration) {
enum ScavengeSpeedMode { kForAllObjects, kForSurvivedObjects };
#define TRACE_GC_CATEGORIES \
TRACE_DISABLED_BY_DEFAULT("v8.gc") ",devtools.timeline"
"devtools.timeline," TRACE_DISABLED_BY_DEFAULT("v8.gc")
#define TRACE_GC(tracer, scope_id) \
GCTracer::Scope::ScopeId gc_tracer_scope_id(scope_id); \
......
......@@ -1444,7 +1444,7 @@ void Heap::ReportExternalMemoryPressure() {
isolate()->isolate_data()->external_memory_low_since_mark_compact_;
int64_t limit = isolate()->isolate_data()->external_memory_limit_;
TRACE_EVENT2(
"v8,devtools.timeline", "V8.ExternalMemoryPressure", "external_memory_mb",
"devtools.timeline,v8", "V8.ExternalMemoryPressure", "external_memory_mb",
static_cast<int>((current - baseline) / MB), "external_memory_limit_mb",
static_cast<int>((limit - baseline) / MB));
if (current > baseline + external_memory_hard_limit()) {
......@@ -3852,11 +3852,11 @@ void Heap::CheckMemoryPressure() {
// the finalizers.
memory_pressure_level_ = MemoryPressureLevel::kNone;
if (memory_pressure_level == MemoryPressureLevel::kCritical) {
TRACE_EVENT0("v8,devtools.timeline", "V8.CheckMemoryPressure");
TRACE_EVENT0("devtools.timeline,v8", "V8.CheckMemoryPressure");
CollectGarbageOnMemoryPressure();
} else if (memory_pressure_level == MemoryPressureLevel::kModerate) {
if (FLAG_incremental_marking && incremental_marking()->IsStopped()) {
TRACE_EVENT0("v8,devtools.timeline", "V8.CheckMemoryPressure");
TRACE_EVENT0("devtools.timeline,v8", "V8.CheckMemoryPressure");
StartIncrementalMarking(kReduceMemoryFootprintMask,
GarbageCollectionReason::kMemoryPressure);
}
......@@ -3901,7 +3901,7 @@ void Heap::CollectGarbageOnMemoryPressure() {
void Heap::MemoryPressureNotification(MemoryPressureLevel level,
bool is_isolate_locked) {
TRACE_EVENT1("v8,devtools.timeline", "V8.MemoryPressureNotification", "level",
TRACE_EVENT1("devtools.timeline,v8", "V8.MemoryPressureNotification", "level",
static_cast<int>(level));
MemoryPressureLevel previous = memory_pressure_level_;
memory_pressure_level_ = level;
......
......@@ -33,7 +33,8 @@ PERFETTO_DEFINE_CATEGORIES(
perfetto::Category("v8.execute"),
perfetto::Category("v8.runtime"),
perfetto::Category::Group("devtools.timeline,v8"),
perfetto::Category::Group("devtools.timeline,"
TRACE_DISABLED_BY_DEFAULT("v8.gc")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("devtools.timeline")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.compile")),
......@@ -49,9 +50,7 @@ PERFETTO_DEFINE_CATEGORIES(
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.wasm")),
perfetto::Category::Group("v8,devtools.timeline"),
perfetto::Category::Group(TRACE_DISABLED_BY_DEFAULT("v8.turbofan") ","
TRACE_DISABLED_BY_DEFAULT("v8.wasm")),
perfetto::Category::Group(TRACE_DISABLED_BY_DEFAULT("v8.gc")
",devtools.timeline"));
TRACE_DISABLED_BY_DEFAULT("v8.wasm")));
// clang-format on
#endif // defined(V8_USE_PERFETTO)
......
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