TaskAttribution: Add BlinkTaskState trace events for microtasks [chromium/src : main]

2 views
Skip to first unread message

Scott Haseley (Gerrit)

unread,
Oct 21, 2025, 3:31:55 PMOct 21
to Michal Mocny, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
Attention needed from Michal Mocny

Scott Haseley added 1 comment

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Scott Haseley . resolved

Can you take a first pass?

Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
Gerrit-Change-Number: 6986393
Gerrit-PatchSet: 8
Gerrit-Owner: Scott Haseley <shas...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Oct 2025 19:31:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dave Tapuska (Gerrit)

unread,
Oct 21, 2025, 3:37:16 PMOct 21
to Scott Haseley, Michal Mocny, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
Attention needed from Michal Mocny and Scott Haseley

Dave Tapuska added 1 comment

File third_party/blink/renderer/platform/scheduler/common/event_loop.cc
Line 105, Patchset 8 (Latest): TaskAttributionTracker::MicrotaskTraceScope scope(self->isolate_);
Dave Tapuska . unresolved

Can you run speedometer and make sure there is no regression?

Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
    Gerrit-Change-Number: 6986393
    Gerrit-PatchSet: 8
    Gerrit-Owner: Scott Haseley <shas...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Tue, 21 Oct 2025 19:37:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Oct 21, 2025, 4:19:05 PMOct 21
    to Dave Tapuska, Michal Mocny, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
    Attention needed from Dave Tapuska and Michal Mocny

    Scott Haseley added 1 comment

    File third_party/blink/renderer/platform/scheduler/common/event_loop.cc
    Line 105, Patchset 8 (Latest): TaskAttributionTracker::MicrotaskTraceScope scope(self->isolate_);
    Dave Tapuska . unresolved

    Can you run speedometer and make sure there is no regression?

    Scott Haseley

    Sure, kicked off that and Jetstream. Note: I've tried to make this do very little if the tracing category isn't enabled, hopefully it's close enough to a no-op in that case.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dave Tapuska
    • Michal Mocny
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
    Gerrit-Change-Number: 6986393
    Gerrit-PatchSet: 8
    Gerrit-Owner: Scott Haseley <shas...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Comment-Date: Tue, 21 Oct 2025 20:18:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dave Tapuska <dtap...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    chromeperf@appspot.gserviceaccount.com (Gerrit)

    unread,
    Oct 21, 2025, 5:41:20 PMOct 21
    to Scott Haseley, Dave Tapuska, Michal Mocny, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
    Attention needed from Dave Tapuska, Michal Mocny and Scott Haseley

    Message from chrom...@appspot.gserviceaccount.com

    📍 Job mac-m1_mini_2020-perf-pgo/speedometer3 complete.

    See results at: https://pinpoint-dot-chromeperf.appspot.com/job/1457a488510000

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dave Tapuska
    • Michal Mocny
    • Scott Haseley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
    Gerrit-Change-Number: 6986393
    Gerrit-PatchSet: 8
    Gerrit-Owner: Scott Haseley <shas...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Comment-Date: Tue, 21 Oct 2025 21:41:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    chromeperf@appspot.gserviceaccount.com (Gerrit)

    unread,
    Oct 21, 2025, 5:49:45 PMOct 21
    to Scott Haseley, Dave Tapuska, Michal Mocny, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
    Attention needed from Dave Tapuska, Michal Mocny and Scott Haseley

    Message from chrom...@appspot.gserviceaccount.com

    📍 Job mac-m1_mini_2020-perf-pgo/jetstream2 complete.

    See results at: https://pinpoint-dot-chromeperf.appspot.com/job/167b2588510000

    Gerrit-Comment-Date: Tue, 21 Oct 2025 21:49:34 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Oct 21, 2025, 5:56:37 PMOct 21
    to chrom...@appspot.gserviceaccount.com, Dave Tapuska, Michal Mocny, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
    Attention needed from Dave Tapuska, Michal Mocny and Scott Haseley

    Scott Haseley added 1 comment

    File third_party/blink/renderer/platform/scheduler/common/event_loop.cc
    Line 105, Patchset 8 (Latest): TaskAttributionTracker::MicrotaskTraceScope scope(self->isolate_);
    Dave Tapuska . resolved

    Can you run speedometer and make sure there is no regression?

    Scott Haseley

    Sure, kicked off that and Jetstream. Note: I've tried to make this do very little if the tracing category isn't enabled, hopefully it's close enough to a no-op in that case.

    Scott Haseley

    Speedometer results are neutral: https://pinpoint-dot-chromeperf.appspot.com/job/1457a488510000.

    Jetstream shows -0.1 in score, but not statistically significant (and it's less than the 0.3 threshold). I'm assuming this is noise. The only thing showing stat sig are a couple improvements, which I'd also assume is noise. https://pinpoint-dot-chromeperf.appspot.com/job/167b2588510000

    Combined with this being ~ a no-op, this looks all looks neutral to me.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dave Tapuska
    • Michal Mocny
    • Scott Haseley
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
      Gerrit-Change-Number: 6986393
      Gerrit-PatchSet: 8
      Gerrit-Owner: Scott Haseley <shas...@chromium.org>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
      Gerrit-Attention: Scott Haseley <shas...@chromium.org>
      Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
      Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
      Gerrit-Comment-Date: Tue, 21 Oct 2025 21:56:29 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
      Comment-In-Reply-To: Dave Tapuska <dtap...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michal Mocny (Gerrit)

      unread,
      Oct 22, 2025, 3:21:18 PMOct 22
      to Scott Haseley, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
      Attention needed from Dave Tapuska and Scott Haseley

      Michal Mocny voted and added 3 comments

      Votes added by Michal Mocny

      Code-Review+1

      3 comments

      Patchset-level comments
      Michal Mocny . resolved

      So fun using this locally!

      Commit Message
      Line 18, Patchset 8 (Latest):into EventLoop for internal microtasks. The PromiseHook API is not
      cheap, so we don't want to enable this all the time, so we only register
      Michal Mocny . resolved

      Is not, or may not?

      Seems benchmarks suggest its okay given the way you use it? Or were the benchmarks just for the case where the expensive parts are disabled?

      (Would it be hard to try benchmark with the feature enabled?)

      File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
      Line 114, Patchset 8 (Latest): // a task runner. Note that it's safe to remove a non-existent observer.
      Michal Mocny . unresolved

      Nit: Could you move the comment for "safe to remove" to destructor?

      I think you should just document the conditions for registration here, and then the note about conditions not matching below

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dave Tapuska
      • Scott Haseley
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
        Gerrit-Change-Number: 6986393
        Gerrit-PatchSet: 8
        Gerrit-Owner: Scott Haseley <shas...@chromium.org>
        Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
        Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
        Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
        Gerrit-Attention: Scott Haseley <shas...@chromium.org>
        Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
        Gerrit-Comment-Date: Wed, 22 Oct 2025 19:21:12 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Scott Haseley (Gerrit)

        unread,
        Oct 22, 2025, 4:38:10 PMOct 22
        to Michal Mocny, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
        Attention needed from Dave Tapuska

        Scott Haseley voted and added 3 comments

        Votes added by Scott Haseley

        Commit-Queue+1

        3 comments

        Patchset-level comments
        Michal Mocny . resolved

        So fun using this locally!

        Scott Haseley

        Thanks for testing it!

        Commit Message
        Line 18, Patchset 8:into EventLoop for internal microtasks. The PromiseHook API is not

        cheap, so we don't want to enable this all the time, so we only register
        Michal Mocny . resolved

        Is not, or may not?

        Seems benchmarks suggest its okay given the way you use it? Or were the benchmarks just for the case where the expensive parts are disabled?

        (Would it be hard to try benchmark with the feature enabled?)

        Scott Haseley

        I meant it'd be expensive if we were to unconditionally register a PromiseHook, but this is mitigated by putting it behind a tracing category. Cleaned up the comment a bit.

        File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
        Line 114, Patchset 8: // a task runner. Note that it's safe to remove a non-existent observer.
        Michal Mocny . resolved

        Nit: Could you move the comment for "safe to remove" to destructor?

        I think you should just document the conditions for registration here, and then the note about conditions not matching below

        Scott Haseley

        SGTM. I lifted this from MainThreadSchedulerImpl and didn't update :).

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dave Tapuska
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
          Gerrit-Change-Number: 6986393
          Gerrit-PatchSet: 10
          Gerrit-Owner: Scott Haseley <shas...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
          Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Comment-Date: Wed, 22 Oct 2025 20:38:00 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Scott Haseley (Gerrit)

          unread,
          Oct 22, 2025, 4:38:54 PMOct 22
          to Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
          Attention needed from Dave Tapuska and Nate Chapin

          Scott Haseley added 1 comment

          Patchset-level comments
          File-level comment, Patchset 10 (Latest):
          Scott Haseley . resolved

          Nate: would you mind taking a pass?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dave Tapuska
          • Nate Chapin
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
          Gerrit-Change-Number: 6986393
          Gerrit-PatchSet: 10
          Gerrit-Owner: Scott Haseley <shas...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
          Gerrit-Attention: Nate Chapin <jap...@chromium.org>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Comment-Date: Wed, 22 Oct 2025 20:38:41 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Nate Chapin (Gerrit)

          unread,
          Oct 23, 2025, 1:11:19 PMOct 23
          to Scott Haseley, Michal Mocny, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
          Attention needed from Dave Tapuska and Scott Haseley

          Nate Chapin voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dave Tapuska
          • Scott Haseley
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
          Gerrit-Change-Number: 6986393
          Gerrit-PatchSet: 10
          Gerrit-Owner: Scott Haseley <shas...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
          Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
          Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Attention: Scott Haseley <shas...@chromium.org>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Comment-Date: Thu, 23 Oct 2025 17:11:08 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Scott Haseley (Gerrit)

          unread,
          Oct 23, 2025, 1:39:30 PMOct 23
          to Etienne Pierre-Doray, Leszek Swirski, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
          Attention needed from Dave Tapuska, Etienne Pierre-Doray and Leszek Swirski

          Scott Haseley added 1 comment

          Patchset-level comments
          Scott Haseley . resolved

          +Etienne for tracing
          +Leszek for PromiseHooks usage

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dave Tapuska
          • Etienne Pierre-Doray
          • Leszek Swirski
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
          Gerrit-Change-Number: 6986393
          Gerrit-PatchSet: 10
          Gerrit-Owner: Scott Haseley <shas...@chromium.org>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
          Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
          Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Attention: Leszek Swirski <les...@chromium.org>
          Gerrit-Comment-Date: Thu, 23 Oct 2025 17:39:19 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Etienne Pierre-Doray (Gerrit)

          unread,
          Oct 23, 2025, 3:09:18 PMOct 23
          to Scott Haseley, Leszek Swirski, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
          Attention needed from Dave Tapuska, Leszek Swirski and Scott Haseley

          Etienne Pierre-Doray voted and added 3 comments

          Votes added by Etienne Pierre-Doray

          Code-Review+1

          3 comments

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

          LGTM

          File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
          Line 71, Patchset 11 (Latest): TRACE_EVENT_BEGIN(
          Etienne Pierre-Doray . unresolved

          "synchronous" TRACE_EVENT_BEGIN/END is hard to get right because they must nest correctly w.r.t. *all* other trace events on the same thread (otherwise traces behave weird)
          Makes sure this is always the case; I'm guessing it is the case because we're at the scheduler level but I just want to flag this.
          Otherwise consider creating a specific track for these events.

          File third_party/blink/renderer/platform/scheduler/public/task_attribution_tracker.h
          Line 136, Patchset 11 (Latest): bool enabled;
          TRACE_EVENT_CATEGORY_GROUP_ENABLED(kTracingCategory, &enabled);
          return enabled;
          Etienne Pierre-Doray . unresolved

          Nit: this is the legacy one, prefer:
          `return TRACE_EVENT_CATEGORY_ENABLED(kTracingCategory)`

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dave Tapuska
          • Leszek Swirski
          • Scott Haseley
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
          Gerrit-Change-Number: 6986393
          Gerrit-PatchSet: 11
          Gerrit-Owner: Scott Haseley <shas...@chromium.org>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
          Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
          Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Attention: Scott Haseley <shas...@chromium.org>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Attention: Leszek Swirski <les...@chromium.org>
          Gerrit-Comment-Date: Thu, 23 Oct 2025 19:09:11 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Scott Haseley (Gerrit)

          unread,
          Oct 23, 2025, 6:40:46 PMOct 23
          to Etienne Pierre-Doray, Leszek Swirski, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
          Attention needed from Dave Tapuska and Leszek Swirski

          Scott Haseley added 2 comments

          File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
          Line 71, Patchset 11: TRACE_EVENT_BEGIN(
          Etienne Pierre-Doray . resolved

          "synchronous" TRACE_EVENT_BEGIN/END is hard to get right because they must nest correctly w.r.t. *all* other trace events on the same thread (otherwise traces behave weird)
          Makes sure this is always the case; I'm guessing it is the case because we're at the scheduler level but I just want to flag this.
          Otherwise consider creating a specific track for these events.

          Scott Haseley

          "synchronous" TRACE_EVENT_BEGIN/END is hard to get right because they must nest correctly w.r.t. *all* other trace events on the same thread (otherwise traces behave weird)

          Yep, I've definitely seen this issue before. And I'm generally hesitant to use them for that reason.

          Makes sure this is always the case; I'm guessing it is the case because we're at the scheduler level but I just want to flag this.
          Otherwise consider creating a specific track for these events.

          Yeah I gave this some consideration and thought it should be fine because:
          1. Here, there's an existing one that works fine that's being converted (it's lifetime matches an on-stack scoped object (`TaskScope`).

          2. The addition in this CL is the for each individual microtask, start = start of microtask / end = end of microtask, and I think the scoping to that scheduling unit will work, as I'd assume any async traces starting in the middle of a microtask and not ending would be broken. IOW I think this is equivalent to adding a scoped TRACE_EVENT around the invoke-microtask method (which we can't access here). We've been using this locally w/ all categories enabled, and it's working very well.

          One way we've been using this is to "visualize the arg values" and comparing those with the other work on the main thread, so there is an advantage to having this on the main thread track. If we run into any snags though, I'll move this.
          File third_party/blink/renderer/platform/scheduler/public/task_attribution_tracker.h
          Line 136, Patchset 11: bool enabled;
          TRACE_EVENT_CATEGORY_GROUP_ENABLED(kTracingCategory, &enabled);
          return enabled;
          Etienne Pierre-Doray . resolved

          Nit: this is the legacy one, prefer:
          `return TRACE_EVENT_CATEGORY_ENABLED(kTracingCategory)`

          Scott Haseley

          Ooh nice, thanks.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dave Tapuska
          • Leszek Swirski
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
            Gerrit-Change-Number: 6986393
            Gerrit-PatchSet: 12
            Gerrit-Owner: Scott Haseley <shas...@chromium.org>
            Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
            Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
            Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
            Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
            Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
            Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
            Gerrit-Attention: Leszek Swirski <les...@chromium.org>
            Gerrit-Comment-Date: Thu, 23 Oct 2025 22:40:33 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
            satisfied_requirement
            open
            diffy

            Leszek Swirski (Gerrit)

            unread,
            Oct 24, 2025, 5:39:56 AMOct 24
            to Scott Haseley, Etienne Pierre-Doray, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
            Attention needed from Dave Tapuska and Scott Haseley

            Leszek Swirski added 1 comment

            File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
            Line 123, Patchset 12 (Latest): isolate_->SetPromiseHook(TaskAttributionPromiseHook);
            Leszek Swirski . unresolved

            This is something to be careful about -- `Isolate::SetPromiseHook` only allows one promise hook, and we expect the embedder to handle dispatching to multiple hooks, so if some other Blink code wanted to set promise hooks, they would conflict with each other. I don't see any other uses of `SetPromiseHook` in Blink at the moment, but it might be something to think about.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Dave Tapuska
            • Scott Haseley
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
              Gerrit-Change-Number: 6986393
              Gerrit-PatchSet: 12
              Gerrit-Owner: Scott Haseley <shas...@chromium.org>
              Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
              Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
              Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
              Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
              Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
              Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
              Gerrit-Attention: Scott Haseley <shas...@chromium.org>
              Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
              Gerrit-Comment-Date: Fri, 24 Oct 2025 09:39:36 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Scott Haseley (Gerrit)

              unread,
              Oct 24, 2025, 10:58:59 AMOct 24
              to Etienne Pierre-Doray, Leszek Swirski, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, Dave Tapuska, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
              Attention needed from Dave Tapuska and Leszek Swirski

              Scott Haseley added 1 comment

              File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
              Line 123, Patchset 12 (Latest): isolate_->SetPromiseHook(TaskAttributionPromiseHook);
              Leszek Swirski . unresolved

              This is something to be careful about -- `Isolate::SetPromiseHook` only allows one promise hook, and we expect the embedder to handle dispatching to multiple hooks, so if some other Blink code wanted to set promise hooks, they would conflict with each other. I don't see any other uses of `SetPromiseHook` in Blink at the moment, but it might be something to think about.

              Scott Haseley

              Thanks, yeah, it's similar to CPED. I also checked usage beforehand and thought about this. If we need to, we can add a management layer on top, but given performance concerns, we might not be able to add other hooks.

              I'll follow up and add a check in audit_non_blink_usage.py -- there's a similar one there for CPED for the same reason.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Dave Tapuska
              • Leszek Swirski
              Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
              Gerrit-Attention: Leszek Swirski <les...@chromium.org>
              Gerrit-Comment-Date: Fri, 24 Oct 2025 14:58:45 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Leszek Swirski <les...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Dave Tapuska (Gerrit)

              unread,
              Oct 24, 2025, 11:00:46 AMOct 24
              to Scott Haseley, Etienne Pierre-Doray, Leszek Swirski, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
              Attention needed from Leszek Swirski and Scott Haseley

              Dave Tapuska voted Code-Review+1

              Code-Review+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Leszek Swirski
              • Scott Haseley
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
              Gerrit-Change-Number: 6986393
              Gerrit-PatchSet: 12
              Gerrit-Owner: Scott Haseley <shas...@chromium.org>
              Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
              Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
              Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
              Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
              Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
              Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
              Gerrit-Attention: Scott Haseley <shas...@chromium.org>
              Gerrit-Attention: Leszek Swirski <les...@chromium.org>
              Gerrit-Comment-Date: Fri, 24 Oct 2025 15:00:34 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Scott Haseley (Gerrit)

              unread,
              Oct 24, 2025, 2:56:38 PMOct 24
              to Dave Tapuska, Etienne Pierre-Doray, Leszek Swirski, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
              Attention needed from Leszek Swirski

              Scott Haseley voted and added 1 comment

              Votes added by Scott Haseley

              Commit-Queue+1

              1 comment

              File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
              Line 123, Patchset 12: isolate_->SetPromiseHook(TaskAttributionPromiseHook);
              Leszek Swirski . resolved

              This is something to be careful about -- `Isolate::SetPromiseHook` only allows one promise hook, and we expect the embedder to handle dispatching to multiple hooks, so if some other Blink code wanted to set promise hooks, they would conflict with each other. I don't see any other uses of `SetPromiseHook` in Blink at the moment, but it might be something to think about.

              Scott Haseley

              Thanks, yeah, it's similar to CPED. I also checked usage beforehand and thought about this. If we need to, we can add a management layer on top, but given performance concerns, we might not be able to add other hooks.

              I'll follow up and add a check in audit_non_blink_usage.py -- there's a similar one there for CPED for the same reason.

              Scott Haseley

              I'll add the usage check in a separate CL.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Leszek Swirski
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement satisfiedCode-Owners
                • requirement satisfiedCode-Review
                • requirement satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
                Gerrit-Change-Number: 6986393
                Gerrit-PatchSet: 13
                Gerrit-Owner: Scott Haseley <shas...@chromium.org>
                Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
                Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
                Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
                Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
                Gerrit-Attention: Leszek Swirski <les...@chromium.org>
                Gerrit-Comment-Date: Fri, 24 Oct 2025 18:56:24 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
                Comment-In-Reply-To: Leszek Swirski <les...@chromium.org>
                satisfied_requirement
                open
                diffy

                Scott Haseley (Gerrit)

                unread,
                Oct 24, 2025, 2:56:46 PMOct 24
                to Dave Tapuska, Etienne Pierre-Doray, Leszek Swirski, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org
                Attention needed from Leszek Swirski

                Scott Haseley voted Commit-Queue+2

                Commit-Queue+2
                Gerrit-Comment-Date: Fri, 24 Oct 2025 18:56:33 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                open
                diffy

                Chromium LUCI CQ (Gerrit)

                unread,
                Oct 24, 2025, 2:59:56 PMOct 24
                to Scott Haseley, Dave Tapuska, Etienne Pierre-Doray, Leszek Swirski, Nate Chapin, Michal Mocny, chrom...@appspot.gserviceaccount.com, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, ddrone...@google.com, dtapuska+...@chromium.org, kinuko...@chromium.org, scheduler-...@chromium.org, spang...@chromium.org, tracing...@chromium.org, web-schedulin...@chromium.org, wfh+...@chromium.org

                Chromium LUCI CQ submitted the change

                Unreviewed changes

                12 is the latest approved patch-set.
                No files were changed between the latest approved patch-set and the submitted one.

                Change information

                Commit message:
                TaskAttribution: Add BlinkTaskState trace events for microtasks

                This CL primarily adds trace events with task state information for
                microtasks, so we can get the task_state_id. We already output this for
                async task propagation when creating a TaskScope, e.g. postMessage,
                setTimeout propagation, but don't for microtasks since this is handled
                by v8. This will be valuable to diagnose soft nav detection issues
                related to task attribution.

                To add these trace events, we use v8's PromiseHook API to get callbacks
                before and after running Promise-related microtask, as well as add hooks
                into EventLoop for internal microtasks. Unconditionally registering a
                PromiseHook would likely be too expensive, so we mitigate this by only
                registering the hook when tracing is enabled for the relevant category,
                and we only check this at construction time and when tracing is turned
                on (via AsyncEnabledStateObserver).

                This also unifies the existing trace event, renaming BlinkTaskScope to
                BlinkTaskState, and moving this to a new "task_attribution" trace
                category (given the additional PromiseHook overhead and main use case, I
                wanted to separate this from "scheduler", which has other use cases).
                Bug: 447555069
                Enabled-by-default-reason: killswitch
                Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
                Reviewed-by: Nate Chapin <jap...@chromium.org>
                Commit-Queue: Scott Haseley <shas...@chromium.org>
                Reviewed-by: Michal Mocny <mmo...@chromium.org>
                Reviewed-by: Dave Tapuska <dtap...@chromium.org>
                Reviewed-by: Etienne Pierre-Doray <etie...@chromium.org>
                Cr-Commit-Position: refs/heads/main@{#1535210}
                Files:
                • M base/trace_event/builtin_categories.h
                • M base/tracing/protos/chrome_track_event.proto
                • M third_party/blink/common/features.cc
                • M third_party/blink/public/common/features.h
                • M third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
                • M third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.h
                • M third_party/blink/renderer/platform/scheduler/common/event_loop.cc
                • M third_party/blink/renderer/platform/scheduler/public/task_attribution_tracker.h
                Change size: M
                Delta: 8 files changed, 163 insertions(+), 14 deletions(-)
                Branch: refs/heads/main
                Submit Requirements:
                • requirement satisfiedCode-Review: +1 by Nate Chapin, +1 by Michal Mocny, +1 by Etienne Pierre-Doray, +1 by Dave Tapuska
                Open in Gerrit
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: merged
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I1579ca66c60202ed4f597d7167ec37df3b5aff7c
                Gerrit-Change-Number: 6986393
                Gerrit-PatchSet: 14
                Gerrit-Owner: Scott Haseley <shas...@chromium.org>
                Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
                Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
                Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
                Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
                open
                diffy
                satisfied_requirement
                Reply all
                Reply to author
                Forward
                0 new messages