WIP: Prevent crashes if Perfetto is not initialized [chromium/src : main]

0 views
Skip to first unread message

Etienne Pierre-Doray (Gerrit)

unread,
Jan 23, 2026, 2:59:11 PMJan 23
to Peter Birk Pakkenberg, Eric Seckler, Chromium LUCI CQ, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Peter Birk Pakkenberg

Etienne Pierre-Doray added 1 comment

File components/tracing/common/background_tracing_utils.cc
Line 59, Patchset 1: if (!perfetto::Tracing::IsInitialized()) {
Eric Seckler . unresolved

Wondering a bit weather we need this many entry points from WebView/Chrome into SetupBackgroundTracing.. calls. Maybe we can unify this somehow into one entry point that calls the right Setup.. functions in the right order, based on some params to enable certain features? i.e.

```
bool SetupBackgroundTracing(bool a) {
Setup..();
Setup..();
if (a) Setup..();
}
```

@etie...@chromium.org for ideas

Etienne Pierre-Doray

There's really 2 entry points:
1: initialization in PostCreateThreads (though this could probably happen earlier):

```
tracing::SetupSystemTracingFromFieldTrial();
tracing::SetupBackgroundTracingFromCommandLine();
tracing::SetupPresetTracingFromFieldTrial();
base::trace_event::EmitNamedTrigger(
base::trace_event::kStartupTracingTriggerName);
```

2: initialization in BackgroundTracingMetricsProvider::Init (guarded behind metric collection):

```
tracing::TraceStartupConfig::GetInstance().SetBackgroundStartupTracingEnabled(tracing::kStartupFieldTracing.Get());
SetupFieldTracingFromFieldTrial();
```
Open in Gerrit

Related details

Attention is currently required from:
  • Peter Birk Pakkenberg
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: I8a5a32ba196838bbb6fdf36f9ea23a1ef13e7bcb
Gerrit-Change-Number: 7511923
Gerrit-PatchSet: 2
Gerrit-Owner: Peter Birk Pakkenberg <pb...@chromium.org>
Gerrit-Reviewer: Peter Birk Pakkenberg <pb...@chromium.org>
Gerrit-CC: Eric Seckler <esec...@chromium.org>
Gerrit-CC: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Attention: Peter Birk Pakkenberg <pb...@chromium.org>
Gerrit-Comment-Date: Fri, 23 Jan 2026 19:59:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Eric Seckler <esec...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages