[GC] Improve tracing counters [v8/v8 : main]

0 views
Skip to first unread message

Etienne Pierre-Doray (Gerrit)

unread,
Sep 19, 2025, 7:22:11 AM (5 days ago) Sep 19
to Fadi Meawad, AyeAye, Omer Katz, V8 LUCI CQ, Hannes Payer, alph+...@chromium.org, cbruni...@chromium.org, lpy+v8...@chromium.org, devtools-...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Omer Katz

Etienne Pierre-Doray added 4 comments

Patchset-level comments
File-level comment, Patchset 13 (Latest):
Etienne Pierre-Doray . resolved

PTAnL?

File src/heap/gc-tracer.cc
Line 1411, Patchset 6: "v8", perfetto::CounterTrack("OldGenerationConsumedBytes", parent_track_),
Omer Katz . resolved

I think these counters should still use the same category it used before. Why do you want to change the category?

Etienne Pierre-Doray

I want to distinguish these counters, that are generally useful to measure memory footprint, from the other counters that are meant to debug GC heuristics, and are in a disabled-by-default category.

Omer Katz

I suspect disabled-by-default is appropriate for these counters as well, since most use cases won't need it, by I get the want to distinguish them from other more GC-specific counters. We usually use the "v8" category for top level V8 events. How about adding a new (disabled-by-default) "v8.memory" category for these counters? I think that would be preferable.

Etienne Pierre-Doray

Done

File src/heap/heap.cc
Line 194, Patchset 11: "v8::Heap", this, perfetto::ThreadTrack::Current())
Omer Katz . resolved

nit: Instead of the named track showing up as "v8::Heap (xxx)", could we have it use the name of the thread as well? So for the main thread for example we'd get "v8::Heap (CrRendererMain xxx)" and for worker threads "v8::Heap (ServiceWorker thread xxx)"?
I think that would slightly better. Wdyt?

Etienne Pierre-Doray

could we have it use the name of the thread as well

Not really (at least in this CL): the thread name comes from an enum translated within perfetto - dynamic strings are filtered out in field traces.
Doing this would involve changing perfetto to display the parent thread name.

Line 1531, Patchset 11: TRACE_DISABLED_BY_DEFAULT("v8.gc"),
Omer Katz . resolved

I think the allocation limits could also be part of a new "v8.memory" category. I assume these and the consumed bytes counters should always be used together.

Etienne Pierre-Doray

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Omer Katz
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I57690556199b144283026b4c0344a18e76f3f5ac
Gerrit-Change-Number: 6961539
Gerrit-PatchSet: 13
Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Fadi Meawad <fme...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Sep 2025 11:22:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Omer Katz <omer...@chromium.org>
Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
unsatisfied_requirement
open
diffy

Omer Katz (Gerrit)

unread,
Sep 19, 2025, 7:56:09 AM (5 days ago) Sep 19
to Etienne Pierre-Doray, Fadi Meawad, AyeAye, V8 LUCI CQ, Hannes Payer, alph+...@chromium.org, cbruni...@chromium.org, lpy+v8...@chromium.org, devtools-...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Etienne Pierre-Doray

Omer Katz voted and added 1 comment

Votes added by Omer Katz

Code-Review+1

1 comment

Patchset-level comments
Omer Katz . resolved

lgtm

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I57690556199b144283026b4c0344a18e76f3f5ac
    Gerrit-Change-Number: 6961539
    Gerrit-PatchSet: 13
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
    Gerrit-CC: Fadi Meawad <fme...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Sep 2025 11:56:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    Sep 19, 2025, 7:56:37 AM (5 days ago) Sep 19
    to Camillo Bruni, Omer Katz, Fadi Meawad, AyeAye, V8 LUCI CQ, Hannes Payer, alph+...@chromium.org, cbruni...@chromium.org, lpy+v8...@chromium.org, devtools-...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Camillo Bruni

    Etienne Pierre-Doray added 1 comment

    Patchset-level comments
    Etienne Pierre-Doray . resolved

    +cbruni@ for src/tracing/trace-categories.h

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Camillo Bruni
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I57690556199b144283026b4c0344a18e76f3f5ac
    Gerrit-Change-Number: 6961539
    Gerrit-PatchSet: 13
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
    Gerrit-CC: Fadi Meawad <fme...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Sep 2025 11:56:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Camillo Bruni (Gerrit)

    unread,
    Sep 22, 2025, 4:38:57 AM (2 days ago) Sep 22
    to Etienne Pierre-Doray, Omer Katz, Fadi Meawad, AyeAye, V8 LUCI CQ, Hannes Payer, alph+...@chromium.org, cbruni...@chromium.org, lpy+v8...@chromium.org, devtools-...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Etienne Pierre-Doray

    Camillo Bruni voted and added 2 comments

    Votes added by Camillo Bruni

    Code-Review+1

    2 comments

    Patchset-level comments
    Camillo Bruni . resolved

    nice! LGTM

    File src/heap/gc-tracer.cc
    Line 1411, Patchset 13 (Latest): "v8.memory",
    Camillo Bruni . unresolved

    we probably need to go around and update all (debug) scripts / tooling to include this new category:

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Etienne Pierre-Doray
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I57690556199b144283026b4c0344a18e76f3f5ac
    Gerrit-Change-Number: 6961539
    Gerrit-PatchSet: 13
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
    Gerrit-CC: Fadi Meawad <fme...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Mon, 22 Sep 2025 08:38:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    Sep 23, 2025, 10:50:27 AM (18 hours ago) Sep 23
    to Camillo Bruni, Omer Katz, Fadi Meawad, AyeAye, V8 LUCI CQ, Hannes Payer, alph+...@chromium.org, cbruni...@chromium.org, lpy+v8...@chromium.org, devtools-...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com

    Etienne Pierre-Doray voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I57690556199b144283026b4c0344a18e76f3f5ac
    Gerrit-Change-Number: 6961539
    Gerrit-PatchSet: 13
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
    Gerrit-CC: Fadi Meawad <fme...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Sep 2025 14:50:22 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    Sep 23, 2025, 10:50:33 AM (18 hours ago) Sep 23
    to Camillo Bruni, Omer Katz, Fadi Meawad, AyeAye, V8 LUCI CQ, Hannes Payer, alph+...@chromium.org, cbruni...@chromium.org, lpy+v8...@chromium.org, devtools-...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com

    Etienne Pierre-Doray added 1 comment

    File src/heap/gc-tracer.cc
    Camillo Bruni . resolved

    we probably need to go around and update all (debug) scripts / tooling to include this new category:

    Etienne Pierre-Doray

    I'll add the category to slow reports (field tracing).
    No need to add categories to perfetto UI anymore (it fetches automatically)
    For the telemetry/crossbench: this is (somewhat) new events that no benchmark relies on; so we can add if helpful, but it won't break anything otherwise.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I57690556199b144283026b4c0344a18e76f3f5ac
    Gerrit-Change-Number: 6961539
    Gerrit-PatchSet: 13
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
    Gerrit-CC: Fadi Meawad <fme...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Sep 2025 14:50:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Camillo Bruni <cbr...@chromium.org>
    satisfied_requirement
    open
    diffy

    V8 LUCI CQ (Gerrit)

    unread,
    Sep 23, 2025, 11:28:48 AM (17 hours ago) Sep 23
    to Etienne Pierre-Doray, Camillo Bruni, Omer Katz, Fadi Meawad, AyeAye, Hannes Payer, alph+...@chromium.org, cbruni...@chromium.org, lpy+v8...@chromium.org, devtools-...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com

    V8 LUCI CQ submitted the change

    Change information

    Commit message:
    [GC] Improve tracing counters

    This CL does a few improvement in gc tracing counters:
    - Groups counters together per-heap using a base NamedTrack; this makes it easier to look at a specific heap behavior when there's multiple
    heaps in the same process.
    - Emits consumed Bytes and limits in "v8.memory" category
    - Emits new gc speed counters

    Before: https://ui.perfetto.dev/#!/?s=97fa22c3836dbdfb18c71c998b2f54a499800e71

    After: https://ui.perfetto.dev/#!/?s=829b1dd00ed384a080ae5a77175b775d33729ed0
    Screenshot: https://screenshot.googleplex.com/3PZmVzMbAmhGePe
    Change-Id: I57690556199b144283026b4c0344a18e76f3f5ac
    Reviewed-by: Omer Katz <omer...@chromium.org>
    Commit-Queue: Etienne Pierre-Doray <etie...@chromium.org>
    Reviewed-by: Camillo Bruni <cbr...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#102702}
    Files:
    • M src/heap/gc-tracer.cc
    • M src/heap/gc-tracer.h
    • M src/heap/heap.cc
    • M src/heap/heap.h
    • M src/tracing/trace-categories.h
    Change size: M
    Delta: 5 files changed, 70 insertions(+), 34 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Omer Katz, +1 by Camillo Bruni
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I57690556199b144283026b4c0344a18e76f3f5ac
    Gerrit-Change-Number: 6961539
    Gerrit-PatchSet: 14
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages