[iOS tracing] Enable in-process Perfetto tracing for developer profiling [chromium/src : main]

9 views
Skip to first unread message

Justin Cohen (Gerrit)

unread,
Apr 15, 2026, 8:28:12 AM (11 days ago) Apr 15
to Justin Novosad, Justin Novosad, Etienne Pierre-Doray, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Etienne Pierre-Doray, Justin Novosad and Justin Novosad

Justin Cohen added 1 comment

File ios/chrome/browser/tracing/ios_startup_tracing_controller_unittest.mm
Line 22, Patchset 41:TEST_F(IOSStartupTracingControllerTest, CreatesValidDeveloperConfig) {
Justin Novosad . unresolved

You need an additional test that covers the recording of an actual trace by calling Initialize and OnAppEnterBackground. Make sure to reset perfetto global state to prevent crosstalk between tests. Ideally, the test should record a synthetic trace event, then ensure it is present in the recording.

Justin Cohen

Added a startup and a manual one. ptal!

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
  • Justin Novosad
  • Justin Novosad
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: I3f4d20fee4e8a80692445e907e4cfdde401de591
Gerrit-Change-Number: 7700720
Gerrit-PatchSet: 46
Gerrit-Owner: Justin Cohen <justi...@google.com>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Justin Cohen <justi...@google.com>
Gerrit-Reviewer: Justin Novosad <ju...@google.com>
Gerrit-CC: Justin Novosad <ju...@chromium.org>
Gerrit-Attention: Justin Novosad <ju...@chromium.org>
Gerrit-Attention: Justin Novosad <ju...@google.com>
Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Apr 2026 12:28:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Justin Novosad <ju...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Justin Novosad (Gerrit)

unread,
Apr 15, 2026, 9:39:48 AM (11 days ago) Apr 15
to Justin Cohen, Justin Novosad, Etienne Pierre-Doray, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Etienne Pierre-Doray, Justin Cohen and Justin Novosad

Justin Novosad voted and added 1 comment

Votes added by Justin Novosad

Code-Review+1

1 comment

File ios/chrome/browser/tracing/ios_startup_tracing_controller_unittest.mm
Line 22, Patchset 41:TEST_F(IOSStartupTracingControllerTest, CreatesValidDeveloperConfig) {
Justin Novosad . resolved

You need an additional test that covers the recording of an actual trace by calling Initialize and OnAppEnterBackground. Make sure to reset perfetto global state to prevent crosstalk between tests. Ideally, the test should record a synthetic trace event, then ensure it is present in the recording.

Justin Cohen

Added a startup and a manual one. ptal!

Justin Novosad

Nice!

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
  • Justin Cohen
  • Justin Novosad
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: I3f4d20fee4e8a80692445e907e4cfdde401de591
    Gerrit-Change-Number: 7700720
    Gerrit-PatchSet: 46
    Gerrit-Owner: Justin Cohen <justi...@google.com>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Justin Cohen <justi...@google.com>
    Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
    Gerrit-Reviewer: Justin Novosad <ju...@google.com>
    Gerrit-Attention: Justin Cohen <justi...@google.com>
    Gerrit-Attention: Justin Novosad <ju...@google.com>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Apr 2026 13:39:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Justin Novosad <ju...@chromium.org>
    Comment-In-Reply-To: Justin Cohen <justi...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Justin Novosad (Gerrit)

    unread,
    Apr 15, 2026, 9:41:48 AM (11 days ago) Apr 15
    to Justin Cohen, Justin Novosad, Etienne Pierre-Doray, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Etienne Pierre-Doray, Justin Cohen and Justin Novosad

    Justin Novosad voted and added 1 comment

    Votes added by Justin Novosad

    Code-Review+1

    1 comment

    File ios/chrome/browser/tracing/ios_startup_tracing_controller_unittest.mm
    Line 141, Patchset 46: IOSStartupTracingController::GetInstance().Initialize();
    Justin Novosad . unresolved

    Nit: Is it weird that a class with "Startup" in its name is also used for manual trace recording?

    Gerrit-Comment-Date: Wed, 15 Apr 2026 13:41:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Justin Cohen (Gerrit)

    unread,
    Apr 15, 2026, 3:37:32 PM (11 days ago) Apr 15
    to Justin Novosad, Justin Novosad, Etienne Pierre-Doray, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Etienne Pierre-Doray, Justin Novosad and Justin Novosad

    Justin Cohen added 2 comments

    File components/tracing/common/startup_tracing_controller.cc
    Line 71, Patchset 49 (Parent): static base::NoDestructor<EmergencyTraceFinalisationCoordinator> instance;
    Justin Cohen . unresolved

    I don't love this change but I need something to make this more repeatedly testable. Or I can drop the Startup test.

    File services/tracing/public/cpp/trace_startup_config.cc
    Line 84, Patchset 49 (Parent): static base::NoDestructor<TraceStartupConfig> g_instance;
    Justin Cohen . unresolved

    Same here

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Etienne Pierre-Doray
    • Justin Novosad
    • Justin Novosad
    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: I3f4d20fee4e8a80692445e907e4cfdde401de591
      Gerrit-Change-Number: 7700720
      Gerrit-PatchSet: 50
      Gerrit-Owner: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Justin Novosad <ju...@google.com>
      Gerrit-Attention: Justin Novosad <ju...@chromium.org>
      Gerrit-Attention: Justin Novosad <ju...@google.com>
      Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Comment-Date: Wed, 15 Apr 2026 19:37:25 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Cohen (Gerrit)

      unread,
      Apr 15, 2026, 3:57:05 PM (11 days ago) Apr 15
      to Justin Novosad, Justin Novosad, Etienne Pierre-Doray, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Etienne Pierre-Doray, Justin Novosad and Justin Novosad

      Justin Cohen added 3 comments

      File ios/chrome/browser/tracing/ios_startup_tracing_controller_unittest.mm
      Line 141, Patchset 46: IOSStartupTracingController::GetInstance().Initialize();
      Justin Novosad . unresolved

      Nit: Is it weird that a class with "Startup" in its name is also used for manual trace recording?

      Justin Cohen

      I'm open to suggestions. WDYT?

      File ios/chrome/browser/webui/ui_bundled/tracing/tracing_ui_egtest.mm
      Line 27, Patchset 19: [ChromeEarlGrey waitForWebStateContainingText:"Stop and Share"];
      Justin Novosad . resolved

      Isn't this condition tautological? I mean the button with this label remains visible regardless of whether or not the button is disabled. This test should instead observe UI state transitions by monitoring the statusText element. In this case, I think it should be waiting for the text to change to "Recording...".

      Justin Cohen

      moved to https://chromium-review.googlesource.com/c/chromium/src/+/7751575

      Justin Cohen

      Done

      Line 32, Patchset 19: [ChromeEarlGrey waitForWebStateContainingText:"Start Recording"];
      Justin Novosad . resolved

      Same issue here. The test should be waiting for the statusText to change back to "Ready" IMHO.

      Justin Cohen

      moved to https://chromium-review.googlesource.com/c/chromium/src/+/7751575

      Justin Cohen

      Done

      Gerrit-Comment-Date: Wed, 15 Apr 2026 19:56:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Justin Novosad <ju...@chromium.org>
      Comment-In-Reply-To: Justin Cohen <justi...@google.com>
      Comment-In-Reply-To: Justin Novosad <ju...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Novosad (Gerrit)

      unread,
      Apr 16, 2026, 10:37:35 AM (10 days ago) Apr 16
      to Justin Cohen, Justin Novosad, Etienne Pierre-Doray, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Etienne Pierre-Doray, Justin Cohen and Justin Novosad

      Justin Novosad added 2 comments

      File components/tracing/common/startup_tracing_controller.cc
      Line 71, Patchset 49 (Parent): static base::NoDestructor<EmergencyTraceFinalisationCoordinator> instance;
      Justin Cohen . unresolved

      I don't love this change but I need something to make this more repeatedly testable. Or I can drop the Startup test.

      Justin Novosad

      What if ResetForTesting did a reset of the instance's state instead of destroying it?

      File ios/chrome/browser/tracing/ios_startup_tracing_controller_unittest.mm
      Line 141, Patchset 46: IOSStartupTracingController::GetInstance().Initialize();
      Justin Novosad . unresolved

      Nit: Is it weird that a class with "Startup" in its name is also used for manual trace recording?

      Justin Cohen

      I'm open to suggestions. WDYT?

      Justin Novosad

      IOSTracingController?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Etienne Pierre-Doray
      • Justin Cohen
      • Justin Novosad
      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: I3f4d20fee4e8a80692445e907e4cfdde401de591
      Gerrit-Change-Number: 7700720
      Gerrit-PatchSet: 50
      Gerrit-Owner: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Justin Novosad <ju...@google.com>
      Gerrit-Attention: Justin Cohen <justi...@google.com>
      Gerrit-Attention: Justin Novosad <ju...@google.com>
      Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Comment-Date: Thu, 16 Apr 2026 14:37:31 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Cohen (Gerrit)

      unread,
      Apr 16, 2026, 12:31:51 PM (10 days ago) Apr 16
      to Justin Novosad, Justin Novosad, Etienne Pierre-Doray, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Etienne Pierre-Doray, Justin Novosad and Justin Novosad

      Justin Cohen added 3 comments

      Patchset-level comments
      File-level comment, Patchset 50:
      Justin Cohen . resolved

      nd

      File components/tracing/common/startup_tracing_controller.cc
      Line 71, Patchset 49 (Parent): static base::NoDestructor<EmergencyTraceFinalisationCoordinator> instance;
      Justin Cohen . resolved

      I don't love this change but I need something to make this more repeatedly testable. Or I can drop the Startup test.

      Justin Novosad

      What if ResetForTesting did a reset of the instance's state instead of destroying it?

      Justin Cohen

      Done

      File ios/chrome/browser/tracing/ios_startup_tracing_controller_unittest.mm
      Line 141, Patchset 46: IOSStartupTracingController::GetInstance().Initialize();
      Justin Novosad . resolved

      Nit: Is it weird that a class with "Startup" in its name is also used for manual trace recording?

      Justin Cohen

      I'm open to suggestions. WDYT?

      Justin Novosad

      IOSTracingController?

      Justin Cohen

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Etienne Pierre-Doray
      • Justin Novosad
      • Justin Novosad
      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: I3f4d20fee4e8a80692445e907e4cfdde401de591
      Gerrit-Change-Number: 7700720
      Gerrit-PatchSet: 51
      Gerrit-Owner: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Justin Novosad <ju...@google.com>
      Gerrit-Attention: Justin Novosad <ju...@chromium.org>
      Gerrit-Attention: Justin Novosad <ju...@google.com>
      Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Comment-Date: Thu, 16 Apr 2026 16:31:44 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Cohen (Gerrit)

      unread,
      Apr 16, 2026, 12:36:30 PM (10 days ago) Apr 16
      to Justin Novosad, Justin Novosad, Etienne Pierre-Doray, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Etienne Pierre-Doray, Justin Novosad and Justin Novosad

      Justin Cohen added 1 comment

      File services/tracing/public/cpp/trace_startup_config.cc
      Line 84, Patchset 49 (Parent): static base::NoDestructor<TraceStartupConfig> g_instance;
      Justin Cohen . resolved

      Same here

      Justin Cohen

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Etienne Pierre-Doray
      • Justin Novosad
      • Justin Novosad
      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: I3f4d20fee4e8a80692445e907e4cfdde401de591
      Gerrit-Change-Number: 7700720
      Gerrit-PatchSet: 54
      Gerrit-Owner: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Justin Novosad <ju...@google.com>
      Gerrit-Attention: Justin Novosad <ju...@chromium.org>
      Gerrit-Attention: Justin Novosad <ju...@google.com>
      Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Comment-Date: Thu, 16 Apr 2026 16:36:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Justin Cohen <justi...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Novosad (Gerrit)

      unread,
      Apr 17, 2026, 2:03:33 PM (9 days ago) Apr 17
      to Justin Cohen, Justin Novosad, Etienne Pierre-Doray, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Etienne Pierre-Doray, Justin Cohen and Justin Novosad

      Justin Novosad voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Etienne Pierre-Doray
      • Justin Cohen
      • Justin Novosad
      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: I3f4d20fee4e8a80692445e907e4cfdde401de591
        Gerrit-Change-Number: 7700720
        Gerrit-PatchSet: 55
        Gerrit-Owner: Justin Cohen <justi...@google.com>
        Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Reviewer: Justin Cohen <justi...@google.com>
        Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
        Gerrit-Reviewer: Justin Novosad <ju...@google.com>
        Gerrit-Attention: Justin Cohen <justi...@google.com>
        Gerrit-Attention: Justin Novosad <ju...@google.com>
        Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Comment-Date: Fri, 17 Apr 2026 18:03:22 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Etienne Pierre-Doray (Gerrit)

        unread,
        Apr 20, 2026, 5:13:20 PM (6 days ago) Apr 20
        to Justin Cohen, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
        Attention needed from Justin Cohen and Justin Novosad

        Etienne Pierre-Doray added 5 comments

        File ios/chrome/browser/tracing/ios_tracing_controller.mm
        Line 39, Patchset 56 (Latest): perfetto::TracingInitArgs init_args;
        Etienne Pierre-Doray . unresolved

        I'm wondering if we want to use base::PerfettoPlatform for init_args.platform.

        This uses a custom task runner. Although the main reason for it was FD watcher to support mojo, another benefit is the ability to (optionally) run in the thread pool, which is convenient in tests to flush tasks with TaskEnvironment.

        Line 87, Patchset 56 (Latest): config.mutable_buffers()->front().set_size_kb(1024 * 50);
        Etienne Pierre-Doray . unresolved

        It's probably cleaner to specify the buffer size on trace_config upfront.

        Line 98, Patchset 56 (Latest): startup_tracing_controller_->Stop(std::move(callback));
        Etienne Pierre-Doray . unresolved

        Up until now, all callers would do WaitUntilStopped() to ensure a trace is flushed before moving forward.
        Is it intentional to simply Stop() here (which approaches detach semantic)? (AFAIU on_tracing_stopped_ is only used in test to run_loop.Run()).

        The declaration comment makes it sounds like we want to run_loop.Run() still.

        File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
        Line 112, Patchset 56 (Latest): TRACE_EVENT0("startup", "StartupTestEvent");
        Etienne Pierre-Doray . unresolved

        Nit: Let's use TRACE_EVENT(...); newer and functionally equivalent.

        File services/tracing/public/cpp/BUILD.gn
        Line 47, Patchset 56 (Latest): "perfetto/trace_packet_tokenizer.cc",
        "perfetto/trace_packet_tokenizer.h",
        Etienne Pierre-Doray . resolved

        This and probably a few other things are specific to JSON export, which you could probably do without (guarded behind iOS) if you wanted to save binary size.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Justin Cohen
        • Justin Novosad
        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: I3f4d20fee4e8a80692445e907e4cfdde401de591
        Gerrit-Change-Number: 7700720
        Gerrit-PatchSet: 56
        Gerrit-Owner: Justin Cohen <justi...@google.com>
        Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Reviewer: Justin Cohen <justi...@google.com>
        Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
        Gerrit-Reviewer: Justin Novosad <ju...@google.com>
        Gerrit-Attention: Justin Cohen <justi...@google.com>
        Gerrit-Attention: Justin Novosad <ju...@google.com>
        Gerrit-Comment-Date: Mon, 20 Apr 2026 21:13:12 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Justin Cohen (Gerrit)

        unread,
        Apr 20, 2026, 10:33:01 PM (6 days ago) Apr 20
        to Justin Novosad, Justin Novosad, Etienne Pierre-Doray, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
        Attention needed from Etienne Pierre-Doray, Justin Novosad and Justin Novosad

        Justin Cohen voted and added 7 comments

        Votes added by Justin Cohen

        Commit-Queue+1

        7 comments

        Patchset-level comments
        File-level comment, Patchset 54:
        Justin Cohen . resolved

        ptal!

        File ios/chrome/browser/tracing/ios_background_tracing_manager.h
        Line 20, Patchset 19:class IOSBackgroundTracingManager {
        Etienne Pierre-Doray . resolved

        Looking at what this does, it fills a role closer to StartupTracingController than BackgroundTracingManager (counterpart in content) + some initialization logic.
        In fact, I'm wondering how much of StartupTracingController we could simply more to services and reuse here, which would support the same set of command line arguments.

        Justin Cohen

        How about something like this, moving StartupTracingController to components/tracing/common?

        https://chromium-review.googlesource.com/c/chromium/src/+/7750890

        Now IOSStartupTracingController is much smaller.

        Justin Cohen

        Done

        File ios/chrome/browser/tracing/ios_background_tracing_manager.mm
        Line 38, Patchset 19:void IOSBackgroundTracingManager::Initialize() {
        Etienne Pierre-Doray . resolved

        Even though you might not need all of PerfettoTracedProcess, I think we can improve code sharing (by extracting and reusing parts of it)

        • I think we want to use base::tracing::PerfettoPlatform on iOS
        • We should reuse the same code for DataSource registrations
        Justin Cohen

        Changed to do:

          perfetto::Tracing::Initialize(init_args);
        tracing::RegisterCommonPerfettoDataSources(/*enable_consumer=*/true);

        from this parent refactor CL:
        https://chromium-review.googlesource.com/c/chromium/src/+/7751295

        wdyt?

        Justin Cohen

        Done

        File ios/chrome/browser/tracing/ios_tracing_controller.mm
        Line 39, Patchset 56: perfetto::TracingInitArgs init_args;
        Etienne Pierre-Doray . resolved

        I'm wondering if we want to use base::PerfettoPlatform for init_args.platform.

        This uses a custom task runner. Although the main reason for it was FD watcher to support mojo, another benefit is the ability to (optionally) run in the thread pool, which is convenient in tests to flush tasks with TaskEnvironment.

        Justin Cohen

        Done

        Line 87, Patchset 56: config.mutable_buffers()->front().set_size_kb(1024 * 50);
        Etienne Pierre-Doray . resolved

        It's probably cleaner to specify the buffer size on trace_config upfront.

        Justin Cohen

        Done

        Line 98, Patchset 56: startup_tracing_controller_->Stop(std::move(callback));
        Etienne Pierre-Doray . resolved

        Up until now, all callers would do WaitUntilStopped() to ensure a trace is flushed before moving forward.
        Is it intentional to simply Stop() here (which approaches detach semantic)? (AFAIU on_tracing_stopped_ is only used in test to run_loop.Run()).

        The declaration comment makes it sounds like we want to run_loop.Run() still.

        Justin Cohen

        removed this entirely

        File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
        Line 112, Patchset 56: TRACE_EVENT0("startup", "StartupTestEvent");
        Etienne Pierre-Doray . resolved

        Nit: Let's use TRACE_EVENT(...); newer and functionally equivalent.

        Justin Cohen

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Etienne Pierre-Doray
        • Justin Novosad
        • Justin Novosad
        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: I3f4d20fee4e8a80692445e907e4cfdde401de591
          Gerrit-Change-Number: 7700720
          Gerrit-PatchSet: 61
          Gerrit-Owner: Justin Cohen <justi...@google.com>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Justin Cohen <justi...@google.com>
          Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Justin Novosad <ju...@google.com>
          Gerrit-Attention: Justin Novosad <ju...@chromium.org>
          Gerrit-Attention: Justin Novosad <ju...@google.com>
          Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Comment-Date: Tue, 21 Apr 2026 02:32:56 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Justin Cohen <justi...@google.com>
          Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Etienne Pierre-Doray (Gerrit)

          unread,
          Apr 21, 2026, 4:09:42 PM (5 days ago) Apr 21
          to Justin Cohen, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
          Attention needed from Justin Cohen, Justin Novosad and Justin Novosad

          Etienne Pierre-Doray added 5 comments

          File ios/chrome/browser/tracing/ios_tracing_controller.mm
          Line 37, Patchset 62:void IOSTracingController::Initialize() {
          Etienne Pierre-Doray . unresolved

          I don't love that we split initialization and instantiating the class in production (but it is somewhat needed for tests). In the past, this had lead to very tangled initialization sequences with PerfettoTracedProcess.

          There's an attempt to improve that for PerfettoTracedProcess, but it's still half baked. WDYT of doing a similar pattern:

          • GetInstance returns a g_instance.
          • IOSTracingController sets the g_instance pointer.
          • For production: CreateInstance() creates a static NoDestructor and initializes it.
          • For test: Ideally we instantiate the class directly (or we do MaybeCreateInstanceForTesting()) + SetupForTesting, and we plumb a custom task runner.
          Line 66, Patchset 62: // Start the shared startup tracing controller. It will check if
          // TraceStartupConfig is enabled via command line internally.
          startup_tracing_controller_->StartIfNeeded();
          Etienne Pierre-Doray . unresolved

          FYI: Not sure about initialization order during startup on iOS, but this posts a task to the ThreadPool, which means you don't get any tracing data before the ThreadPool is started.

          There are ways to work around that if you want earlier tracing.

          File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
          Line 41, Patchset 62: // Ensure background tasks (like tracer destruction) are finished before
          // resetting Perfetto.
          base::ThreadPoolInstance::Get()->FlushForTesting();
          Etienne Pierre-Doray . unresolved

          Now that the platform runs on a threadPool thread, it should be possible to follow the pattern in PerfettoTracedProcess::ResetForTesting, and do everything there.

          Line 44, Patchset 62: base::trace_event::TraceLog::ResetForTesting();
          Etienne Pierre-Doray . unresolved

          This shouldn't be needed (TraceLog is now only useful as a helper to create a tracing session)

          File services/tracing/public/cpp/trace_startup_config.cc
          Line 92, Patchset 62:TraceStartupConfig& TraceStartupConfig::GetInstance() {
          static base::NoDestructor<TraceStartupConfig> instance;
          return *instance;
          }

          // static
          void TraceStartupConfig::ResetForTesting() {
          GetInstance().Clear();
          GetInstance().Initialize();
          }
          Etienne Pierre-Doray . unresolved

          What do you think about replacing this by a scoped TraceStartupConfig + setting g_instance pointer to access it in GetInstance().

          TraceStartupConfig can live in PerfettoTracedProcess, and in IOSTracingController on iOS

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Justin Cohen
          • Justin Novosad
          • Justin Novosad
          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: I3f4d20fee4e8a80692445e907e4cfdde401de591
            Gerrit-Change-Number: 7700720
            Gerrit-PatchSet: 63
            Gerrit-Owner: Justin Cohen <justi...@google.com>
            Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Reviewer: Justin Cohen <justi...@google.com>
            Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
            Gerrit-Reviewer: Justin Novosad <ju...@google.com>
            Gerrit-Attention: Justin Novosad <ju...@chromium.org>
            Gerrit-Attention: Justin Cohen <justi...@google.com>
            Gerrit-Attention: Justin Novosad <ju...@google.com>
            Gerrit-Comment-Date: Tue, 21 Apr 2026 20:09:36 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Justin Cohen (Gerrit)

            unread,
            Apr 22, 2026, 12:13:44 AM (5 days ago) Apr 22
            to Justin Novosad, Justin Novosad, Etienne Pierre-Doray, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
            Attention needed from Etienne Pierre-Doray, Justin Novosad and Justin Novosad

            Justin Cohen added 6 comments

            Justin Cohen . resolved

            ptal!

            File ios/chrome/browser/tracing/ios_tracing_controller.mm
            Line 37, Patchset 62:void IOSTracingController::Initialize() {
            Etienne Pierre-Doray . resolved

            I don't love that we split initialization and instantiating the class in production (but it is somewhat needed for tests). In the past, this had lead to very tangled initialization sequences with PerfettoTracedProcess.

            There's an attempt to improve that for PerfettoTracedProcess, but it's still half baked. WDYT of doing a similar pattern:

            • GetInstance returns a g_instance.
            • IOSTracingController sets the g_instance pointer.
            • For production: CreateInstance() creates a static NoDestructor and initializes it.
            • For test: Ideally we instantiate the class directly (or we do MaybeCreateInstanceForTesting()) + SetupForTesting, and we plumb a custom task runner.
            Justin Cohen

            Done, although perfetto::internal::TracingMuxerImpl::InitializeInstance's globals makes this tricky. I need to keep the base::tracing::PerfettoPlatform around between tests, leading to an owned_platform_ + platform_ member.

            Line 66, Patchset 62: // Start the shared startup tracing controller. It will check if
            // TraceStartupConfig is enabled via command line internally.
            startup_tracing_controller_->StartIfNeeded();
            Etienne Pierre-Doray . resolved

            FYI: Not sure about initialization order during startup on iOS, but this posts a task to the ThreadPool, which means you don't get any tracing data before the ThreadPool is started.

            There are ways to work around that if you want earlier tracing.

            Justin Cohen

            On iOS ThreadPoolInstance::Create is called before IOSChromeMainParts::PreCreateThreads (where IOSTracingController::CreateInstance(); is called)

            File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
            Line 41, Patchset 62: // Ensure background tasks (like tracer destruction) are finished before
            // resetting Perfetto.
            base::ThreadPoolInstance::Get()->FlushForTesting();
            Etienne Pierre-Doray . resolved

            Now that the platform runs on a threadPool thread, it should be possible to follow the pattern in PerfettoTracedProcess::ResetForTesting, and do everything there.

            Justin Cohen

            Done

            Line 44, Patchset 62: base::trace_event::TraceLog::ResetForTesting();
            Etienne Pierre-Doray . resolved

            This shouldn't be needed (TraceLog is now only useful as a helper to create a tracing session)

            Justin Cohen

            Done

            File services/tracing/public/cpp/trace_startup_config.cc
            Line 92, Patchset 62:TraceStartupConfig& TraceStartupConfig::GetInstance() {
            static base::NoDestructor<TraceStartupConfig> instance;
            return *instance;
            }

            // static
            void TraceStartupConfig::ResetForTesting() {
            GetInstance().Clear();
            GetInstance().Initialize();
            }
            Etienne Pierre-Doray . unresolved

            What do you think about replacing this by a scoped TraceStartupConfig + setting g_instance pointer to access it in GetInstance().

            TraceStartupConfig can live in PerfettoTracedProcess, and in IOSTracingController on iOS

            Justin Cohen

            I tried, but a bunch of places access TraceStartupConfig::GetInstance() before PerfettoTracedProcess is created, so it'll crash.

            See 71..72 for the reversal of my attempt.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Etienne Pierre-Doray
            • Justin Novosad
            • Justin Novosad
            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: I3f4d20fee4e8a80692445e907e4cfdde401de591
            Gerrit-Change-Number: 7700720
            Gerrit-PatchSet: 72
            Gerrit-Owner: Justin Cohen <justi...@google.com>
            Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Reviewer: Justin Cohen <justi...@google.com>
            Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
            Gerrit-Reviewer: Justin Novosad <ju...@google.com>
            Gerrit-Attention: Justin Novosad <ju...@chromium.org>
            Gerrit-Attention: Justin Novosad <ju...@google.com>
            Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Comment-Date: Wed, 22 Apr 2026 04:13:39 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Etienne Pierre-Doray (Gerrit)

            unread,
            Apr 23, 2026, 8:19:54 AM (3 days ago) Apr 23
            to Justin Cohen, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
            Attention needed from Justin Cohen, Justin Novosad and Justin Novosad

            Etienne Pierre-Doray added 7 comments

            File ios/chrome/browser/tracing/ios_tracing_controller.mm
            Line 37, Patchset 62:void IOSTracingController::Initialize() {
            Etienne Pierre-Doray . unresolved

            I don't love that we split initialization and instantiating the class in production (but it is somewhat needed for tests). In the past, this had lead to very tangled initialization sequences with PerfettoTracedProcess.

            There's an attempt to improve that for PerfettoTracedProcess, but it's still half baked. WDYT of doing a similar pattern:

            • GetInstance returns a g_instance.
            • IOSTracingController sets the g_instance pointer.
            • For production: CreateInstance() creates a static NoDestructor and initializes it.
            • For test: Ideally we instantiate the class directly (or we do MaybeCreateInstanceForTesting()) + SetupForTesting, and we plumb a custom task runner.
            Justin Cohen

            Done, although perfetto::internal::TracingMuxerImpl::InitializeInstance's globals makes this tricky. I need to keep the base::tracing::PerfettoPlatform around between tests, leading to an owned_platform_ + platform_ member.

            Etienne Pierre-Doray

            Right, considering platform_ that needs to survive through tests, I think I prefer MaybeCreateInstanceForTesting() (with static NoDestructor) + SetupForTesting() (or InitializeForTest()?).

            But either way, I think ResetForTesting() should be the only method needed to reset the state (and makes it so that we can initialize it again)

            Line 74, Patchset 72 (Latest): if (!platform_) {
            owned_platform_ = std::make_unique<base::tracing::PerfettoPlatform>(
            base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()}));
            platform_ = owned_platform_.get();
            }
            Etienne Pierre-Doray . unresolved

            If going with MaybeCreateInstanceForTesting(), I think this can happen in constructor unconditionally.

            Line 80, Patchset 72 (Latest): if (!perfetto::Tracing::IsInitialized()) {
            Etienne Pierre-Doray . unresolved

            Can this be a DCHECK, now that Initialize is only called once (in test it's called multiple time, but ResetForTesting() should put it back to uninitialized).

            Line 96, Patchset 72 (Latest): startup_tracing_controller_ =
            std::make_unique<tracing::StartupTracingController>(
            base::NullCallback(),
            base::SingleThreadTaskRunner::GetCurrentDefault());
            Etienne Pierre-Doray . unresolved

            I think this could happen in constructor, and if so we can do it unconditionally.

            File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
            Line 37, Patchset 72 (Latest): if (!g_test_platform) {
            g_test_platform = new base::tracing::PerfettoPlatform(
            base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()}));
            }
            Etienne Pierre-Doray . unresolved

            Not really an issue yet, but this seems somewhat incompatible with having multiple tests files in the same test targets using IOSTracingController.

            I think this is solved by making IOSTracingController in charge of creating the PerfettoPlatform.

            Line 48, Patchset 72 (Latest): tracing::StartupTracingController::ResetForTesting();
            tracing::TraceStartupConfig::ResetForTesting();
            perfetto::Tracing::ResetForTesting();
            Etienne Pierre-Doray . unresolved

            These should all be part of StartupTracingController::ResetForTesting()

            File services/tracing/public/cpp/trace_startup_config.cc
            Line 92, Patchset 62:TraceStartupConfig& TraceStartupConfig::GetInstance() {
            static base::NoDestructor<TraceStartupConfig> instance;
            return *instance;
            }

            // static
            void TraceStartupConfig::ResetForTesting() {
            GetInstance().Clear();
            GetInstance().Initialize();
            }
            Etienne Pierre-Doray . resolved

            What do you think about replacing this by a scoped TraceStartupConfig + setting g_instance pointer to access it in GetInstance().

            TraceStartupConfig can live in PerfettoTracedProcess, and in IOSTracingController on iOS

            Justin Cohen

            I tried, but a bunch of places access TraceStartupConfig::GetInstance() before PerfettoTracedProcess is created, so it'll crash.

            See 71..72 for the reversal of my attempt.

            Etienne Pierre-Doray

            Ack, thanks for checking!

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Justin Cohen
            • Justin Novosad
            • Justin Novosad
            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: I3f4d20fee4e8a80692445e907e4cfdde401de591
            Gerrit-Change-Number: 7700720
            Gerrit-PatchSet: 72
            Gerrit-Owner: Justin Cohen <justi...@google.com>
            Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Reviewer: Justin Cohen <justi...@google.com>
            Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
            Gerrit-Reviewer: Justin Novosad <ju...@google.com>
            Gerrit-Attention: Justin Novosad <ju...@chromium.org>
            Gerrit-Attention: Justin Cohen <justi...@google.com>
            Gerrit-Attention: Justin Novosad <ju...@google.com>
            Gerrit-Comment-Date: Thu, 23 Apr 2026 12:19:48 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Justin Cohen (Gerrit)

            unread,
            Apr 23, 2026, 9:28:38 AM (3 days ago) Apr 23
            to Justin Novosad, Justin Novosad, Etienne Pierre-Doray, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
            Attention needed from Etienne Pierre-Doray, Justin Novosad and Justin Novosad

            Justin Cohen added 7 comments

            Patchset-level comments
            File-level comment, Patchset 73 (Latest):
            Justin Cohen . resolved

            Thanks for the review. PTAL!

            File ios/chrome/browser/tracing/ios_tracing_controller.mm
            Line 37, Patchset 62:void IOSTracingController::Initialize() {
            Etienne Pierre-Doray . resolved

            I don't love that we split initialization and instantiating the class in production (but it is somewhat needed for tests). In the past, this had lead to very tangled initialization sequences with PerfettoTracedProcess.

            There's an attempt to improve that for PerfettoTracedProcess, but it's still half baked. WDYT of doing a similar pattern:

            • GetInstance returns a g_instance.
            • IOSTracingController sets the g_instance pointer.
            • For production: CreateInstance() creates a static NoDestructor and initializes it.
            • For test: Ideally we instantiate the class directly (or we do MaybeCreateInstanceForTesting()) + SetupForTesting, and we plumb a custom task runner.
            Justin Cohen

            Done, although perfetto::internal::TracingMuxerImpl::InitializeInstance's globals makes this tricky. I need to keep the base::tracing::PerfettoPlatform around between tests, leading to an owned_platform_ + platform_ member.

            Etienne Pierre-Doray

            Right, considering platform_ that needs to survive through tests, I think I prefer MaybeCreateInstanceForTesting() (with static NoDestructor) + SetupForTesting() (or InitializeForTest()?).

            But either way, I think ResetForTesting() should be the only method needed to reset the state (and makes it so that we can initialize it again)

            Justin Cohen

            Done

            Line 74, Patchset 72: if (!platform_) {

            owned_platform_ = std::make_unique<base::tracing::PerfettoPlatform>(
            base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()}));
            platform_ = owned_platform_.get();
            }
            Etienne Pierre-Doray . resolved

            If going with MaybeCreateInstanceForTesting(), I think this can happen in constructor unconditionally.

            Justin Cohen

            Done

            Line 80, Patchset 72: if (!perfetto::Tracing::IsInitialized()) {
            Etienne Pierre-Doray . resolved

            Can this be a DCHECK, now that Initialize is only called once (in test it's called multiple time, but ResetForTesting() should put it back to uninitialized).

            Justin Cohen

            Done

            Line 96, Patchset 72: startup_tracing_controller_ =

            std::make_unique<tracing::StartupTracingController>(
            base::NullCallback(),
            base::SingleThreadTaskRunner::GetCurrentDefault());
            Etienne Pierre-Doray . resolved

            I think this could happen in constructor, and if so we can do it unconditionally.

            Justin Cohen

            Done

            File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
            Line 37, Patchset 72: if (!g_test_platform) {

            g_test_platform = new base::tracing::PerfettoPlatform(
            base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()}));
            }
            Etienne Pierre-Doray . resolved

            Not really an issue yet, but this seems somewhat incompatible with having multiple tests files in the same test targets using IOSTracingController.

            I think this is solved by making IOSTracingController in charge of creating the PerfettoPlatform.

            Justin Cohen

            Done

            Line 48, Patchset 72: tracing::StartupTracingController::ResetForTesting();

            tracing::TraceStartupConfig::ResetForTesting();
            perfetto::Tracing::ResetForTesting();
            Etienne Pierre-Doray . resolved

            These should all be part of StartupTracingController::ResetForTesting()

            Justin Cohen

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Etienne Pierre-Doray
            • Justin Novosad
            • Justin Novosad
            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: I3f4d20fee4e8a80692445e907e4cfdde401de591
              Gerrit-Change-Number: 7700720
              Gerrit-PatchSet: 73
              Gerrit-Owner: Justin Cohen <justi...@google.com>
              Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
              Gerrit-Reviewer: Justin Cohen <justi...@google.com>
              Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
              Gerrit-Reviewer: Justin Novosad <ju...@google.com>
              Gerrit-Attention: Justin Novosad <ju...@chromium.org>
              Gerrit-Attention: Justin Novosad <ju...@google.com>
              Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
              Gerrit-Comment-Date: Thu, 23 Apr 2026 13:28:29 +0000
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Etienne Pierre-Doray (Gerrit)

              unread,
              Apr 23, 2026, 9:41:49 AM (3 days ago) Apr 23
              to Justin Cohen, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
              Attention needed from Justin Cohen, Justin Novosad and Justin Novosad

              Etienne Pierre-Doray voted and added 5 comments

              Votes added by Etienne Pierre-Doray

              Code-Review+1

              5 comments

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

              LGTM % comments, thanks!

              File ios/chrome/browser/tracing/ios_tracing_controller.mm
              Line 48, Patchset 73: g_instance = instance.get();
              Etienne Pierre-Doray . unresolved

              Nit: Not needed considering the constructor does it?

              Line 105, Patchset 73: if (startup_tracing_controller_) {
              Etienne Pierre-Doray . unresolved

              Nit: is this ever nullptr?

              Line 112, Patchset 73:void IOSTracingController::UpdateTaskRunnerForTesting() {
              Etienne Pierre-Doray . unresolved

              Nit: How about

              ```
              void InitializeForTesting() {
              platform_->ResetTaskRunner(...);
              Initialize();
              }
              ```

              And we can make Initialize() private.

              File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
              Line 48, Patchset 72: tracing::StartupTracingController::ResetForTesting();
              tracing::TraceStartupConfig::ResetForTesting();
              perfetto::Tracing::ResetForTesting();
              Etienne Pierre-Doray . unresolved

              These should all be part of StartupTracingController::ResetForTesting()

              Justin Cohen

              Done

              Etienne Pierre-Doray

              Looks like perfetto::Tracing::ResetForTesting is gone now; which I'd expect cause failures when trying re Initialize() again.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Justin Cohen
              • Justin Novosad
              • Justin Novosad
              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: I3f4d20fee4e8a80692445e907e4cfdde401de591
                Gerrit-Change-Number: 7700720
                Gerrit-PatchSet: 74
                Gerrit-Owner: Justin Cohen <justi...@google.com>
                Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                Gerrit-Reviewer: Justin Novosad <ju...@google.com>
                Gerrit-Attention: Justin Novosad <ju...@chromium.org>
                Gerrit-Attention: Justin Cohen <justi...@google.com>
                Gerrit-Attention: Justin Novosad <ju...@google.com>
                Gerrit-Comment-Date: Thu, 23 Apr 2026 13:41:39 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Etienne Pierre-Doray (Gerrit)

                unread,
                Apr 23, 2026, 10:07:00 AM (3 days ago) Apr 23
                to Justin Cohen, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Justin Cohen, Justin Novosad and Justin Novosad

                Etienne Pierre-Doray added 1 comment

                File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
                Line 48, Patchset 72: tracing::StartupTracingController::ResetForTesting();
                tracing::TraceStartupConfig::ResetForTesting();
                perfetto::Tracing::ResetForTesting();
                Etienne Pierre-Doray . unresolved

                These should all be part of StartupTracingController::ResetForTesting()

                Justin Cohen

                Done

                Etienne Pierre-Doray

                Looks like perfetto::Tracing::ResetForTesting is gone now; which I'd expect cause failures when trying re Initialize() again.

                Etienne Pierre-Doray

                Oh sorry, I see you put it in StartupTracingController::ResetForTesting(), but I meant it should be in IOSTracingController::ResetForTesting() 😊

                Gerrit-Comment-Date: Thu, 23 Apr 2026 14:06:53 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Justin Cohen (Gerrit)

                unread,
                Apr 23, 2026, 10:23:40 AM (3 days ago) Apr 23
                to Etienne Pierre-Doray, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Justin Novosad and Justin Novosad

                Justin Cohen added 4 comments

                File ios/chrome/browser/tracing/ios_tracing_controller.mm
                Line 48, Patchset 73: g_instance = instance.get();
                Etienne Pierre-Doray . resolved

                Nit: Not needed considering the constructor does it?

                Justin Cohen

                Done

                Line 105, Patchset 73: if (startup_tracing_controller_) {
                Etienne Pierre-Doray . resolved

                Nit: is this ever nullptr?

                Justin Cohen

                Done

                Line 112, Patchset 73:void IOSTracingController::UpdateTaskRunnerForTesting() {
                Etienne Pierre-Doray . resolved

                Nit: How about

                ```
                void InitializeForTesting() {
                platform_->ResetTaskRunner(...);
                Initialize();
                }
                ```

                And we can make Initialize() private.

                Justin Cohen

                Done

                File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
                Line 48, Patchset 72: tracing::StartupTracingController::ResetForTesting();
                tracing::TraceStartupConfig::ResetForTesting();
                perfetto::Tracing::ResetForTesting();
                Etienne Pierre-Doray . resolved

                These should all be part of StartupTracingController::ResetForTesting()

                Justin Cohen

                Done

                Etienne Pierre-Doray

                Looks like perfetto::Tracing::ResetForTesting is gone now; which I'd expect cause failures when trying re Initialize() again.

                Etienne Pierre-Doray

                Oh sorry, I see you put it in StartupTracingController::ResetForTesting(), but I meant it should be in IOSTracingController::ResetForTesting() 😊

                Justin Cohen

                Got it, moved TraceStartupConfig::ResetForTesting(); and perfetto::Tracing::ResetForTesting() to IOSTracingController::ResetForTesting()

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Justin Novosad
                • Justin Novosad
                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: I3f4d20fee4e8a80692445e907e4cfdde401de591
                  Gerrit-Change-Number: 7700720
                  Gerrit-PatchSet: 75
                  Gerrit-Owner: Justin Cohen <justi...@google.com>
                  Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                  Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                  Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                  Gerrit-Reviewer: Justin Novosad <ju...@google.com>
                  Gerrit-Attention: Justin Novosad <ju...@chromium.org>
                  Gerrit-Attention: Justin Novosad <ju...@google.com>
                  Gerrit-Comment-Date: Thu, 23 Apr 2026 14:23:32 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Justin Cohen (Gerrit)

                  unread,
                  Apr 23, 2026, 10:26:39 AM (3 days ago) Apr 23
                  to Rohit Rao, Etienne Pierre-Doray, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                  Attention needed from Justin Novosad, Justin Novosad and Rohit Rao

                  Justin Cohen added 1 comment

                  Patchset-level comments
                  File-level comment, Patchset 75 (Latest):
                  Justin Cohen . resolved

                  Over to junov@ for iOS, and then rohitrao for iOS OWNERS

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Justin Novosad
                  • Justin Novosad
                  • Rohit Rao
                  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: I3f4d20fee4e8a80692445e907e4cfdde401de591
                  Gerrit-Change-Number: 7700720
                  Gerrit-PatchSet: 75
                  Gerrit-Owner: Justin Cohen <justi...@google.com>
                  Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                  Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                  Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                  Gerrit-Reviewer: Justin Novosad <ju...@google.com>
                  Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
                  Gerrit-Attention: Justin Novosad <ju...@chromium.org>
                  Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
                  Gerrit-Attention: Justin Novosad <ju...@google.com>
                  Gerrit-Comment-Date: Thu, 23 Apr 2026 14:26:32 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Justin Novosad (Gerrit)

                  unread,
                  Apr 23, 2026, 10:40:33 AM (3 days ago) Apr 23
                  to Justin Cohen, Rohit Rao, Etienne Pierre-Doray, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                  Attention needed from Justin Cohen, Justin Novosad and Rohit Rao

                  Justin Novosad added 5 comments

                  Patchset-level comments
                  Justin Novosad . resolved

                  LGTM with nits.

                  File ios/chrome/browser/tracing/ios_tracing_controller.mm
                  Line 69, Patchset 75 (Latest): DCHECK(!perfetto::Tracing::IsInitialized());
                  Justin Novosad . unresolved
                  File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
                  Line 99, Patchset 75 (Latest): tracing::TraceStartupConfig::ResetForTesting();
                  Justin Novosad . unresolved

                  Is this really needed? The test fixture already takes care of this in the TearDown

                  Line 102, Patchset 75 (Latest): IOSTracingController::GetInstance().InitializeForTesting();
                  Justin Novosad . unresolved

                  Should this be move to the fixture's setup method?

                  Line 144, Patchset 75 (Latest): IOSTracingController::GetInstance().InitializeForTesting();
                  Justin Novosad . unresolved

                  same here.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Justin Cohen
                  • Justin Novosad
                  • Rohit Rao
                  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: I3f4d20fee4e8a80692445e907e4cfdde401de591
                    Gerrit-Change-Number: 7700720
                    Gerrit-PatchSet: 75
                    Gerrit-Owner: Justin Cohen <justi...@google.com>
                    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                    Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                    Gerrit-Reviewer: Justin Novosad <ju...@google.com>
                    Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
                    Gerrit-Attention: Justin Novosad <ju...@chromium.org>
                    Gerrit-Attention: Justin Cohen <justi...@google.com>
                    Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
                    Gerrit-Comment-Date: Thu, 23 Apr 2026 14:40:27 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Rohit Rao (Gerrit)

                    unread,
                    Apr 23, 2026, 11:07:33 AM (3 days ago) Apr 23
                    to Justin Cohen, Rohit Rao, Etienne Pierre-Doray, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                    Attention needed from Justin Cohen and Justin Novosad

                    Rohit Rao voted and added 3 comments

                    Votes added by Rohit Rao

                    Code-Review+1

                    3 comments

                    Patchset-level comments
                    Rohit Rao . resolved

                    lgtm but please wait for junov as well

                    File ios/chrome/browser/tracing/ios_tracing_controller.mm
                    Line 47, Patchset 75 (Latest): static base::NoDestructor<IOSTracingController> instance;
                    Rohit Rao . unresolved

                    How does this work?

                    File services/tracing/public/cpp/BUILD.gn
                    Line 31, Patchset 75 (Latest):tracing_lib_type = "component"
                    Rohit Rao . unresolved

                    Can we remove this variable and just define line 33 as `component("cpp")` instead?

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Justin Cohen
                    • Justin Novosad
                    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: I3f4d20fee4e8a80692445e907e4cfdde401de591
                    Gerrit-Change-Number: 7700720
                    Gerrit-PatchSet: 75
                    Gerrit-Owner: Justin Cohen <justi...@google.com>
                    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                    Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                    Gerrit-Reviewer: Justin Novosad <ju...@google.com>
                    Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
                    Gerrit-Attention: Justin Novosad <ju...@chromium.org>
                    Gerrit-Attention: Justin Cohen <justi...@google.com>
                    Gerrit-Comment-Date: Thu, 23 Apr 2026 15:07:22 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Justin Cohen (Gerrit)

                    unread,
                    Apr 23, 2026, 1:01:54 PM (3 days ago) Apr 23
                    to Rohit Rao, Etienne Pierre-Doray, Justin Novosad, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                    Attention needed from Justin Novosad and Justin Novosad

                    Justin Cohen voted and added 6 comments

                    Votes added by Justin Cohen

                    Auto-Submit+1

                    6 comments

                    File ios/chrome/browser/tracing/ios_tracing_controller.mm
                    Line 47, Patchset 75: static base::NoDestructor<IOSTracingController> instance;
                    Rohit Rao . resolved

                    How does this work?

                    Justin Cohen

                    We use a separate static NoDestructor in MaybeCreateInstanceForTesting() to ensure that tests have their own dedicated singleton instance of IOSTracingController. This ensures that the platform_ (which Perfetto requires to survive) is not destroyed between tests, avoiding crashes related to Perfetto's global state.

                    CreateInstance() calls Initialize() immediately because production code needs the controller to be active as soon as it is created in PreCreateThreads(). In contrast, MaybeCreateInstanceForTesting() does not call Initialize() because tests often need to set up specific conditions (like command-line switches in base::test::ScopedCommandLine) before tracing is initialized. Tests can then call InitializeForTesting() when they are ready.

                    Line 69, Patchset 75: DCHECK(!perfetto::Tracing::IsInitialized());
                    Justin Novosad . resolved
                    Justin Cohen

                    Done

                    File ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
                    Line 99, Patchset 75: tracing::TraceStartupConfig::ResetForTesting();
                    Justin Novosad . resolved

                    Is this really needed? The test fixture already takes care of this in the TearDown

                    Justin Cohen

                    It's needed to pick up the ScopedCommandLine

                    Line 102, Patchset 75: IOSTracingController::GetInstance().InitializeForTesting();
                    Justin Novosad . resolved

                    Should this be move to the fixture's setup method?

                    Justin Cohen
                    tl;dr yes and no. I moved it to setup, but we also need this to pick up the ScopedCommandLine, e.g.
                    ```
                    // Reset the config to pick up the new command line switches.
                    tracing::TraceStartupConfig::ResetForTesting();
                      // Reset and re-initialize to restart startup tracing.
                    IOSTracingController::GetInstance().ResetForTesting();
                    IOSTracingController::GetInstance().InitializeForTesting();
                    ```
                    Line 144, Patchset 75: IOSTracingController::GetInstance().InitializeForTesting();
                    Justin Novosad . resolved

                    same here.

                    Justin Cohen

                    Done

                    File services/tracing/public/cpp/BUILD.gn
                    Line 31, Patchset 75:tracing_lib_type = "component"
                    Rohit Rao . resolved

                    Can we remove this variable and just define line 33 as `component("cpp")` instead?

                    Justin Cohen

                    Acknowledged

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Justin Novosad
                    • Justin Novosad
                    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: I3f4d20fee4e8a80692445e907e4cfdde401de591
                      Gerrit-Change-Number: 7700720
                      Gerrit-PatchSet: 77
                      Gerrit-Owner: Justin Cohen <justi...@google.com>
                      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                      Gerrit-Reviewer: Justin Novosad <ju...@google.com>
                      Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
                      Gerrit-Attention: Justin Novosad <ju...@chromium.org>
                      Gerrit-Attention: Justin Novosad <ju...@google.com>
                      Gerrit-Comment-Date: Thu, 23 Apr 2026 17:01:43 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: Yes
                      Comment-In-Reply-To: Rohit Rao <rohi...@chromium.org>
                      Comment-In-Reply-To: Justin Novosad <ju...@google.com>
                      satisfied_requirement
                      open
                      diffy

                      Justin Novosad (Gerrit)

                      unread,
                      Apr 23, 2026, 1:38:09 PM (3 days ago) Apr 23
                      to Justin Cohen, Rohit Rao, Etienne Pierre-Doray, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                      Attention needed from Justin Cohen and Justin Novosad

                      Justin Novosad voted

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

                      Related details

                      Attention is currently required from:
                      • Justin Cohen
                      • Justin Novosad
                      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: I3f4d20fee4e8a80692445e907e4cfdde401de591
                      Gerrit-Change-Number: 7700720
                      Gerrit-PatchSet: 77
                      Gerrit-Owner: Justin Cohen <justi...@google.com>
                      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                      Gerrit-Reviewer: Justin Novosad <ju...@google.com>
                      Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
                      Gerrit-Attention: Justin Cohen <justi...@google.com>
                      Gerrit-Attention: Justin Novosad <ju...@google.com>
                      Gerrit-Comment-Date: Thu, 23 Apr 2026 17:38:02 +0000
                      Gerrit-HasComments: No
                      Gerrit-Has-Labels: Yes
                      satisfied_requirement
                      open
                      diffy

                      Chromium LUCI CQ (Gerrit)

                      unread,
                      Apr 23, 2026, 3:34:10 PM (3 days ago) Apr 23
                      to Justin Cohen, Justin Novosad, Rohit Rao, Etienne Pierre-Doray, Justin Novosad, chromium...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org

                      Chromium LUCI CQ submitted the change

                      Change information

                      Commit message:
                      [iOS tracing] Enable in-process Perfetto tracing for developer profiling

                      This CL brings up the native Perfetto tracing infrastructure on iOS by
                      introducing `IOSTracingController`, a lightweight tracing manager.

                      Because iOS cannot use the standard multi-process tracing stack, this
                      controller initializes Perfetto locally using `kInProcessBackend` and
                      delegates to `tracing::StartupTracingController` to handle
                      `--trace-startup` flags.

                      Specifically, this CL:
                      - Initializes the tracing controller in
                      `IOSChromeMainParts::PreCreateThreads()` so background threads can
                      be captured and named.
                      - Configures a standard developer trace config that supports native
                      flamegraphs (stack sampling), system metrics, and track events.
                      - Compiles `services/tracing/public/cpp` components for iOS (previously
                      excluded), guarding Blink-specific shared memory logic in
                      `trace_startup_config.cc` behind `USE_BLINK`.
                      - Removes incompatible content-layer dependencies from
                      `components/tracing` build targets on iOS.
                      Bypass-Check-License: File moves
                      Bug: 495937056
                      Test: autoninja -C out/Debug-iphonesimulator chrome
                      Change-Id: I3f4d20fee4e8a80692445e907e4cfdde401de591
                      Reviewed-by: Justin Novosad <ju...@chromium.org>
                      Reviewed-by: Etienne Pierre-Doray <etie...@chromium.org>
                      Commit-Queue: Justin Cohen <justi...@google.com>
                      Reviewed-by: Rohit Rao <rohi...@chromium.org>
                      Commit-Queue: Justin Novosad <ju...@chromium.org>
                      Auto-Submit: Justin Cohen <justi...@google.com>
                      Cr-Commit-Position: refs/heads/main@{#1619700}
                      Files:
                      • M components/tracing/BUILD.gn
                      • A ios/chrome/browser/tracing/BUILD.gn
                      • A ios/chrome/browser/tracing/DEPS
                      • A ios/chrome/browser/tracing/ios_tracing_controller.h
                      • A ios/chrome/browser/tracing/ios_tracing_controller.mm
                      • A ios/chrome/browser/tracing/ios_tracing_controller_unittest.mm
                      • M ios/chrome/browser/web/model/BUILD.gn
                      • M ios/chrome/browser/web/model/DEPS
                      • M ios/chrome/browser/web/model/chrome_main_parts.mm
                      • M ios/chrome/test/BUILD.gn
                      • M services/tracing/public/cpp/BUILD.gn
                      • M services/tracing/public/cpp/startup_tracing_controller.cc
                      • M services/tracing/public/cpp/startup_tracing_controller.h
                      • M services/tracing/public/cpp/trace_startup_config.cc
                      • M services/tracing/public/cpp/trace_startup_config.h
                      Change size: L
                      Delta: 15 files changed, 572 insertions(+), 61 deletions(-)
                      Branch: refs/heads/main
                      Submit Requirements:
                      • requirement satisfiedCode-Review: +1 by Justin Novosad, +1 by Etienne Pierre-Doray, +1 by Rohit Rao
                      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: I3f4d20fee4e8a80692445e907e4cfdde401de591
                      Gerrit-Change-Number: 7700720
                      Gerrit-PatchSet: 78
                      Gerrit-Owner: Justin Cohen <justi...@google.com>
                      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                      Gerrit-Reviewer: Justin Novosad <ju...@google.com>
                      Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
                      open
                      diffy
                      satisfied_requirement
                      Reply all
                      Reply to author
                      Forward
                      0 new messages