Add experiment for background tracing init [chromium/src : main]

0 views
Skip to first unread message

Peter Birk Pakkenberg (Gerrit)

unread,
Feb 2, 2026, 9:40:24 AM (5 days ago) Feb 2
to Richard (Torne) Coles, Abhijith Nair, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, android-web...@chromium.org, asvitkine...@chromium.org
Attention needed from Abhijith Nair and Richard (Torne) Coles

Peter Birk Pakkenberg added 1 comment

File android_webview/browser/aw_browser_process.cc
Line 402, Patchset 4: if (g_initializing_perfetto_on_background_thread) {
Richard (Torne) Coles . resolved

If the call to InitPerfetto has been posted to a background thread then I don't think anything guarantees that it will have reached the point of setting this variable to true before this function is called?

I think you would need to always signal the event and always wait on it, and only read `g_initializing_perfetto_on_background_thread` *after* successfully waiting for it if you want to know whether it was done on the background thread or not for the purposes of the metric.

Peter Birk Pakkenberg

Agreed, good catch.

Open in Gerrit

Related details

Attention is currently required from:
  • Abhijith Nair
  • Richard (Torne) Coles
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: Iaf8af4ddb6e182b81af56ad1880beb023f5fb72a
Gerrit-Change-Number: 7525531
Gerrit-PatchSet: 6
Gerrit-Owner: Peter Birk Pakkenberg <pb...@chromium.org>
Gerrit-Reviewer: Abhijith Nair <abhiji...@chromium.org>
Gerrit-Reviewer: Peter Birk Pakkenberg <pb...@chromium.org>
Gerrit-Reviewer: Richard (Torne) Coles <to...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
Gerrit-Attention: Abhijith Nair <abhiji...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 14:40:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Richard (Torne) Coles <to...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Peter Birk Pakkenberg (Gerrit)

unread,
Feb 2, 2026, 10:48:00 AM (5 days ago) Feb 2
to Nate Fischer, Richard (Torne) Coles, Abhijith Nair, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, android-web...@chromium.org, asvitkine...@chromium.org
Attention needed from Abhijith Nair, Nate Fischer and Richard (Torne) Coles

Peter Birk Pakkenberg added 2 comments

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Peter Birk Pakkenberg . resolved

Hi Nate, do you have capacity to review this while Torne is OOO?

File android_webview/browser/aw_browser_process.cc
Line 402, Patchset 4: if (g_initializing_perfetto_on_background_thread) {
Richard (Torne) Coles . resolved

If the call to InitPerfetto has been posted to a background thread then I don't think anything guarantees that it will have reached the point of setting this variable to true before this function is called?

I think you would need to always signal the event and always wait on it, and only read `g_initializing_perfetto_on_background_thread` *after* successfully waiting for it if you want to know whether it was done on the background thread or not for the purposes of the metric.

Peter Birk Pakkenberg

Agreed, good catch.

Peter Birk Pakkenberg

I've moved the update to the global flag to the main thread instead, to ensure that we only wait when we did initialize on a background thread. Otherwise we would have a situation where the current flow would wait indefinitely because InitTracing isn't called in the baseline implementation.

Open in Gerrit

Related details

Attention is currently required from:
  • Abhijith Nair
  • Nate Fischer
  • Richard (Torne) Coles
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: Iaf8af4ddb6e182b81af56ad1880beb023f5fb72a
Gerrit-Change-Number: 7525531
Gerrit-PatchSet: 8
Gerrit-Owner: Peter Birk Pakkenberg <pb...@chromium.org>
Gerrit-Reviewer: Abhijith Nair <abhiji...@chromium.org>
Gerrit-Reviewer: Nate Fischer <ntf...@chromium.org>
Gerrit-Reviewer: Peter Birk Pakkenberg <pb...@chromium.org>
Gerrit-Reviewer: Richard (Torne) Coles <to...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
Gerrit-Attention: Nate Fischer <ntf...@chromium.org>
Gerrit-Attention: Abhijith Nair <abhiji...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 15:47:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Peter Birk Pakkenberg <pb...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Nate Fischer (Gerrit)

unread,
Feb 3, 2026, 7:21:22 PM (4 days ago) Feb 3
to Peter Birk Pakkenberg, Peter Beverloo, Richard (Torne) Coles, Abhijith Nair, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, android-web...@chromium.org, asvitkine...@chromium.org
Attention needed from Abhijith Nair, Peter Beverloo, Peter Birk Pakkenberg and Richard (Torne) Coles

Nate Fischer voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Abhijith Nair
  • Peter Beverloo
  • Peter Birk Pakkenberg
  • Richard (Torne) Coles
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: Iaf8af4ddb6e182b81af56ad1880beb023f5fb72a
    Gerrit-Change-Number: 7525531
    Gerrit-PatchSet: 8
    Gerrit-Owner: Peter Birk Pakkenberg <pb...@chromium.org>
    Gerrit-Reviewer: Abhijith Nair <abhiji...@chromium.org>
    Gerrit-Reviewer: Nate Fischer <ntf...@chromium.org>
    Gerrit-Reviewer: Peter Beverloo <pe...@chromium.org>
    Gerrit-Reviewer: Peter Birk Pakkenberg <pb...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Richard (Torne) Coles <to...@chromium.org>
    Gerrit-Attention: Peter Birk Pakkenberg <pb...@chromium.org>
    Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
    Gerrit-Attention: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Abhijith Nair <abhiji...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 00:21:05 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Peter Birk Pakkenberg (Gerrit)

    unread,
    Feb 4, 2026, 4:56:06 AM (3 days ago) Feb 4
    to Colin Blundell, Nate Fischer, Peter Beverloo, Richard (Torne) Coles, Abhijith Nair, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, android-web...@chromium.org, asvitkine...@chromium.org
    Attention needed from Abhijith Nair, Colin Blundell, Peter Beverloo and Richard (Torne) Coles

    Peter Birk Pakkenberg voted and added 1 comment

    Votes added by Peter Birk Pakkenberg

    Auto-Submit+1
    Commit-Queue+1

    1 comment

    Patchset-level comments
    Peter Birk Pakkenberg . resolved

    Colin would you mind doing an OWNERS review of //services/tracing on this CL (2 files). I am adding timing histograms to the initialization process to help improve WebView startup times.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Abhijith Nair
    • Colin Blundell
    • Peter Beverloo
    • Richard (Torne) Coles
    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: Iaf8af4ddb6e182b81af56ad1880beb023f5fb72a
    Gerrit-Change-Number: 7525531
    Gerrit-PatchSet: 8
    Gerrit-Owner: Peter Birk Pakkenberg <pb...@chromium.org>
    Gerrit-Reviewer: Abhijith Nair <abhiji...@chromium.org>
    Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
    Gerrit-Reviewer: Nate Fischer <ntf...@chromium.org>
    Gerrit-Reviewer: Peter Beverloo <pe...@chromium.org>
    Gerrit-Reviewer: Peter Birk Pakkenberg <pb...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Richard (Torne) Coles <to...@chromium.org>
    Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
    Gerrit-Attention: Colin Blundell <blun...@chromium.org>
    Gerrit-Attention: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Abhijith Nair <abhiji...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 09:55:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Colin Blundell (Gerrit)

    unread,
    Feb 4, 2026, 4:57:01 AM (3 days ago) Feb 4
    to Peter Birk Pakkenberg, Colin Blundell, Nate Fischer, Peter Beverloo, Richard (Torne) Coles, Abhijith Nair, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, android-web...@chromium.org, asvitkine...@chromium.org
    Attention needed from Abhijith Nair, Peter Beverloo, Peter Birk Pakkenberg and Richard (Torne) Coles

    Colin Blundell voted and added 1 comment

    Votes added by Colin Blundell

    Code-Review+1
    Commit-Queue+2

    1 comment

    Patchset-level comments
    Colin Blundell . resolved

    //services/tracing lgtm, thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Abhijith Nair
    • Peter Beverloo
    • Peter Birk Pakkenberg
    • Richard (Torne) Coles
    Gerrit-Attention: Peter Birk Pakkenberg <pb...@chromium.org>
    Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
    Gerrit-Attention: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Abhijith Nair <abhiji...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 09:56:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Peter Beverloo (Gerrit)

    unread,
    Feb 4, 2026, 7:47:44 AM (3 days ago) Feb 4
    to Peter Birk Pakkenberg, Peter Beverloo, Colin Blundell, Nate Fischer, Richard (Torne) Coles, Abhijith Nair, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, android-web...@chromium.org, asvitkine...@chromium.org
    Attention needed from Abhijith Nair, Colin Blundell, Peter Birk Pakkenberg and Richard (Torne) Coles

    Peter Beverloo voted

    Code-Review+1
    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Abhijith Nair
    • Colin Blundell
    • Peter Birk Pakkenberg
    • Richard (Torne) Coles
      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: Iaf8af4ddb6e182b81af56ad1880beb023f5fb72a
      Gerrit-Change-Number: 7525531
      Gerrit-PatchSet: 8
      Gerrit-Owner: Peter Birk Pakkenberg <pb...@chromium.org>
      Gerrit-Reviewer: Abhijith Nair <abhiji...@chromium.org>
      Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
      Gerrit-Reviewer: Nate Fischer <ntf...@chromium.org>
      Gerrit-Reviewer: Peter Beverloo <pe...@chromium.org>
      Gerrit-Reviewer: Peter Birk Pakkenberg <pb...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Richard (Torne) Coles <to...@chromium.org>
      Gerrit-Attention: Peter Birk Pakkenberg <pb...@chromium.org>
      Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
      Gerrit-Attention: Colin Blundell <blun...@chromium.org>
      Gerrit-Attention: Abhijith Nair <abhiji...@chromium.org>
      Gerrit-Comment-Date: Wed, 04 Feb 2026 12:47:30 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Feb 4, 2026, 7:53:14 AM (3 days ago) Feb 4
      to Peter Birk Pakkenberg, Peter Beverloo, Colin Blundell, Nate Fischer, Richard (Torne) Coles, Abhijith Nair, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, tracing...@chromium.org, spang...@chromium.org, wfh+...@chromium.org, android-web...@chromium.org, asvitkine...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      Add experiment for background tracing init

      This experiment posts the initialization of the tracing service and
      Perfetto to a background task runner as soon as the native library has
      been initialized, and ensures that startup waits for the task to finish
      before continuing.
      Bug: 480077118
      Change-Id: Iaf8af4ddb6e182b81af56ad1880beb023f5fb72a
      Commit-Queue: Peter Beverloo <pe...@chromium.org>
      Reviewed-by: Nate Fischer <ntf...@chromium.org>
      Reviewed-by: Colin Blundell <blun...@chromium.org>
      Reviewed-by: Peter Beverloo <pe...@chromium.org>
      Auto-Submit: Peter Birk Pakkenberg <pb...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1579365}
      Files:
      • M android_webview/browser/aw_browser_process.cc
      • M android_webview/browser/aw_browser_process.h
      • M android_webview/common/aw_feature_map.cc
      • M android_webview/common/aw_features.cc
      • M android_webview/common/aw_features.h
      • M android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
      • M android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
      • M android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java
      • M android_webview/java/src/org/chromium/android_webview/common/WebViewCachedFlags.java
      • M android_webview/lib/aw_main_delegate.cc
      • M services/tracing/public/cpp/perfetto/perfetto_traced_process.cc
      • M services/tracing/public/cpp/trace_startup.cc
      • M testing/variations/fieldtrial_testing_config.json
      • M tools/metrics/histograms/metadata/android/histograms.xml
      • M tools/metrics/histograms/metadata/others/histograms.xml
      Change size: M
      Delta: 15 files changed, 213 insertions(+), 30 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Colin Blundell, +1 by Nate Fischer, +1 by Peter Beverloo
      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: Iaf8af4ddb6e182b81af56ad1880beb023f5fb72a
      Gerrit-Change-Number: 7525531
      Gerrit-PatchSet: 9
      Gerrit-Owner: Peter Birk Pakkenberg <pb...@chromium.org>
      Gerrit-Reviewer: Abhijith Nair <abhiji...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
      Gerrit-Reviewer: Nate Fischer <ntf...@chromium.org>
      Gerrit-Reviewer: Peter Beverloo <pe...@chromium.org>
      Gerrit-Reviewer: Peter Birk Pakkenberg <pb...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages