[netlog] Conditionally support full netlog data in perfetto traces [chromium/src : main]

0 views
Skip to first unread message

Camillo Bruni (Gerrit)

unread,
Jun 15, 2026, 7:45:24 AMJun 15
to Etienne Dechamps, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, network-ser...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, bnc+...@chromium.org, net-r...@chromium.org
Attention needed from Etienne Dechamps and mmenke

Camillo Bruni added 1 comment

Patchset-level comments
File-level comment, Patchset 33 (Latest):
Camillo Bruni . resolved

@edechamps PTAL components/cronet
@petrcermak PTAL base/trace_event
@mmenke PTAL the rest

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Dechamps
  • mmenke
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: I8f9bac7ba0384e652c2eb47363156aa4af96f127
Gerrit-Change-Number: 7881639
Gerrit-PatchSet: 33
Gerrit-Owner: Camillo Bruni <cbr...@chromium.org>
Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
Gerrit-Reviewer: Etienne Dechamps <edec...@google.com>
Gerrit-Reviewer: mmenke <mme...@chromium.org>
Gerrit-Attention: mmenke <mme...@chromium.org>
Gerrit-Attention: Etienne Dechamps <edec...@google.com>
Gerrit-Comment-Date: Mon, 15 Jun 2026 11:45:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

mmenke (Gerrit)

unread,
Jun 15, 2026, 11:27:55 AMJun 15
to Camillo Bruni, Etienne Dechamps, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, network-ser...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, bnc+...@chromium.org, net-r...@chromium.org
Attention needed from Camillo Bruni and Etienne Dechamps

mmenke added 1 comment

Patchset-level comments
mmenke . resolved

Have you verified the trace viewer can actually handle logs with everything?

Open in Gerrit

Related details

Attention is currently required from:
  • Camillo Bruni
  • Etienne Dechamps
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: I8f9bac7ba0384e652c2eb47363156aa4af96f127
Gerrit-Change-Number: 7881639
Gerrit-PatchSet: 33
Gerrit-Owner: Camillo Bruni <cbr...@chromium.org>
Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
Gerrit-Reviewer: Etienne Dechamps <edec...@google.com>
Gerrit-Reviewer: mmenke <mme...@chromium.org>
Gerrit-Attention: Etienne Dechamps <edec...@google.com>
Gerrit-Attention: Camillo Bruni <cbr...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Jun 2026 15:27:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

mmenke (Gerrit)

unread,
Jun 15, 2026, 11:36:09 AMJun 15
to Camillo Bruni, Etienne Dechamps, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, network-ser...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, bnc+...@chromium.org, net-r...@chromium.org
Attention needed from Camillo Bruni and Etienne Dechamps

mmenke added 2 comments

File net/log/trace_net_log_observer.h
Line 38, Patchset 33 (Latest): // - Explicitly provided value will take precedence.
// - If command line --net-log-mode is available we use that.
mmenke . unresolved

This comment is confusing. It's what NetworkService::NetworkService does when creating a NetLogObserver, not what this class does when passed a null `capture_mode`.

This is attached to a bug that's apparently targetting Cronet, but Cronet doesn't use NetworkService, or Mojo at all. Why are we making changes to NetworkService?

File services/network/public/cpp/network_switches.cc
Line 160, Patchset 33 (Latest):net::NetLogCaptureMode GetNetCaptureModeFromCommandLine(
mmenke . unresolved

I'm not comfortable with command line flags affecting TraceNetLog observer (i.e., anything other than --log-net-log=). Can we do something more trace-API-friendly? e.g., use a different trace category.

TraceNetLogObserver::SelectCaptureMode() already seems to do this, in fact, so I'm not clear on why this is needed.

Open in Gerrit

Related details

Attention is currently required from:
  • Camillo Bruni
  • Etienne Dechamps
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: I8f9bac7ba0384e652c2eb47363156aa4af96f127
    Gerrit-Change-Number: 7881639
    Gerrit-PatchSet: 33
    Gerrit-Owner: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Dechamps <edec...@google.com>
    Gerrit-Reviewer: mmenke <mme...@chromium.org>
    Gerrit-Attention: Etienne Dechamps <edec...@google.com>
    Gerrit-Attention: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Jun 2026 15:36:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Camillo Bruni (Gerrit)

    unread,
    Jun 16, 2026, 9:40:18 AMJun 16
    to Etienne Dechamps, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, network-ser...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, bnc+...@chromium.org, net-r...@chromium.org
    Attention needed from mmenke

    Camillo Bruni added 3 comments

    Patchset-level comments
    mmenke . resolved

    Have you verified the trace viewer can actually handle logs with everything?

    Camillo Bruni

    Yes, I have a WIP network panel for perfetto that displays most of the data that is now captured (so far I've tried with traces created on linux).

    https://github.com/google/perfetto/compare/dev/cbruni/2026-05-22_network_panel

    File net/log/trace_net_log_observer.h
    Line 38, Patchset 33 (Latest): // - Explicitly provided value will take precedence.
    // - If command line --net-log-mode is available we use that.
    mmenke . unresolved

    This comment is confusing. It's what NetworkService::NetworkService does when creating a NetLogObserver, not what this class does when passed a null `capture_mode`.

    This is attached to a bug that's apparently targetting Cronet, but Cronet doesn't use NetworkService, or Mojo at all. Why are we making changes to NetworkService?

    Camillo Bruni
    • oops, this should be `--net-log-capture-mode`

    Re why the changes:

    • currently we can't get full netlogs in perfetto
    • cronet uses TraceNetLogObserver with a slightly custom trace_net_log_capture_mode approach that I do not want to change since I'm not sure about the implications (maybe components/cronet/android/cronet_library_loader.cc is unused?)
    File services/network/public/cpp/network_switches.cc
    Line 160, Patchset 33 (Latest):net::NetLogCaptureMode GetNetCaptureModeFromCommandLine(
    mmenke . resolved

    I'm not comfortable with command line flags affecting TraceNetLog observer (i.e., anything other than --log-net-log=). Can we do something more trace-API-friendly? e.g., use a different trace category.

    TraceNetLogObserver::SelectCaptureMode() already seems to do this, in fact, so I'm not clear on why this is needed.

    Camillo Bruni

    IMO it's more consistent with using the other netlog observers but no strong opinon on this (it was mentioned in older comments that this might be pending work see the cronet todo for https://crbug.com/410018349).

    I personally have the preference of command line flags having higher priority than trace configs. And thus I was a bit confused initially when `--net-log-capture-mode=...` had no impact on the trace data.

    I can revert this part since the crucial bit is getting the data to perfetto.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • mmenke
    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: I8f9bac7ba0384e652c2eb47363156aa4af96f127
    Gerrit-Change-Number: 7881639
    Gerrit-PatchSet: 33
    Gerrit-Owner: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Dechamps <edec...@google.com>
    Gerrit-Reviewer: mmenke <mme...@chromium.org>
    Gerrit-Attention: mmenke <mme...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Jun 2026 13:39:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: mmenke <mme...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Etienne Dechamps (Gerrit)

    unread,
    Jun 16, 2026, 9:43:27 AMJun 16
    to Camillo Bruni, Etienne Dechamps, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, network-ser...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, bnc+...@chromium.org, net-r...@chromium.org
    Attention needed from Camillo Bruni and mmenke

    Etienne Dechamps added 1 comment

    File net/log/trace_net_log_observer.h
    Line 38, Patchset 33 (Latest): // - Explicitly provided value will take precedence.
    // - If command line --net-log-mode is available we use that.
    mmenke . unresolved

    This comment is confusing. It's what NetworkService::NetworkService does when creating a NetLogObserver, not what this class does when passed a null `capture_mode`.

    This is attached to a bug that's apparently targetting Cronet, but Cronet doesn't use NetworkService, or Mojo at all. Why are we making changes to NetworkService?

    Camillo Bruni
    • oops, this should be `--net-log-capture-mode`

    Re why the changes:

    • currently we can't get full netlogs in perfetto
    • cronet uses TraceNetLogObserver with a slightly custom trace_net_log_capture_mode approach that I do not want to change since I'm not sure about the implications (maybe components/cronet/android/cronet_library_loader.cc is unused?)
    Etienne Dechamps

    It is definitely used. See https://chromium.googlesource.com/chromium/src/+/main/components/cronet/tracing.md for how Cronet tracing works. If you are making any changes to how this works, please update tracing.md accordingly in this CL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Camillo Bruni
    • mmenke
    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: I8f9bac7ba0384e652c2eb47363156aa4af96f127
    Gerrit-Change-Number: 7881639
    Gerrit-PatchSet: 33
    Gerrit-Owner: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Dechamps <edec...@google.com>
    Gerrit-Reviewer: mmenke <mme...@chromium.org>
    Gerrit-Attention: mmenke <mme...@chromium.org>
    Gerrit-Attention: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Jun 2026 13:43:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: mmenke <mme...@chromium.org>
    Comment-In-Reply-To: Camillo Bruni <cbr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Camillo Bruni (Gerrit)

    unread,
    Jun 16, 2026, 9:49:40 AMJun 16
    to Etienne Dechamps, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, network-ser...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, bnc+...@chromium.org, net-r...@chromium.org
    Attention needed from Etienne Dechamps and mmenke

    Camillo Bruni added 1 comment

    File net/log/trace_net_log_observer.h
    Line 38, Patchset 33 (Latest): // - Explicitly provided value will take precedence.
    // - If command line --net-log-mode is available we use that.
    mmenke . unresolved

    This comment is confusing. It's what NetworkService::NetworkService does when creating a NetLogObserver, not what this class does when passed a null `capture_mode`.

    This is attached to a bug that's apparently targetting Cronet, but Cronet doesn't use NetworkService, or Mojo at all. Why are we making changes to NetworkService?

    Camillo Bruni
    • oops, this should be `--net-log-capture-mode`

    Re why the changes:

    • currently we can't get full netlogs in perfetto
    • cronet uses TraceNetLogObserver with a slightly custom trace_net_log_capture_mode approach that I do not want to change since I'm not sure about the implications (maybe components/cronet/android/cronet_library_loader.cc is unused?)
    Etienne Dechamps

    It is definitely used. See https://chromium.googlesource.com/chromium/src/+/main/components/cronet/tracing.md for how Cronet tracing works. If you are making any changes to how this works, please update tracing.md accordingly in this CL.

    Camillo Bruni

    ok, then this makes sense - and I've tried to be behavior preserving for cronet.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Etienne Dechamps
    • mmenke
    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: I8f9bac7ba0384e652c2eb47363156aa4af96f127
    Gerrit-Change-Number: 7881639
    Gerrit-PatchSet: 33
    Gerrit-Owner: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Dechamps <edec...@google.com>
    Gerrit-Reviewer: mmenke <mme...@chromium.org>
    Gerrit-Attention: mmenke <mme...@chromium.org>
    Gerrit-Attention: Etienne Dechamps <edec...@google.com>
    Gerrit-Comment-Date: Tue, 16 Jun 2026 13:49:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: mmenke <mme...@chromium.org>
    Comment-In-Reply-To: Etienne Dechamps <edec...@google.com>
    Comment-In-Reply-To: Camillo Bruni <cbr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Matt Menke (Gerrit)

    unread,
    Jun 16, 2026, 9:57:14 AMJun 16
    to Camillo Bruni, Etienne Dechamps, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, network-ser...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, bnc+...@chromium.org, net-r...@chromium.org
    Attention needed from Camillo Bruni, Etienne Dechamps and mmenke

    Matt Menke added 1 comment

    File services/network/public/cpp/network_switches.cc
    Line 160, Patchset 33 (Latest):net::NetLogCaptureMode GetNetCaptureModeFromCommandLine(
    mmenke . unresolved

    I'm not comfortable with command line flags affecting TraceNetLog observer (i.e., anything other than --log-net-log=). Can we do something more trace-API-friendly? e.g., use a different trace category.

    TraceNetLogObserver::SelectCaptureMode() already seems to do this, in fact, so I'm not clear on why this is needed.

    Camillo Bruni

    IMO it's more consistent with using the other netlog observers but no strong opinon on this (it was mentioned in older comments that this might be pending work see the cronet todo for https://crbug.com/410018349).

    I personally have the preference of command line flags having higher priority than trace configs. And thus I was a bit confused initially when `--net-log-capture-mode=...` had no impact on the trace data.

    I can revert this part since the crucial bit is getting the data to perfetto.

    Matt Menke

    This CL introduces trace categories for this. I don't think we should have a way to override them. Command line doesn't affect about:net-export either, because it has its own, user-visible way to set mode. Given the sensitivity of NetLog data, there should be as few surprises as possible (admittedly, NetLog being global and not per-profile is a surprise as well, unfortunately)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Camillo Bruni
    • Etienne Dechamps
    • mmenke
    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: I8f9bac7ba0384e652c2eb47363156aa4af96f127
    Gerrit-Change-Number: 7881639
    Gerrit-PatchSet: 33
    Gerrit-Owner: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Dechamps <edec...@google.com>
    Gerrit-Reviewer: mmenke <mme...@chromium.org>
    Gerrit-CC: Matt Menke <mme...@google.com>
    Gerrit-Attention: mmenke <mme...@chromium.org>
    Gerrit-Attention: Etienne Dechamps <edec...@google.com>
    Gerrit-Attention: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Jun 2026 13:57:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: mmenke <mme...@chromium.org>
    Comment-In-Reply-To: Camillo Bruni <cbr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    mmenke (Gerrit)

    unread,
    Jun 17, 2026, 1:44:20 PMJun 17
    to Camillo Bruni, kokoro, Etienne Dechamps, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, network-ser...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, bnc+...@chromium.org, net-r...@chromium.org
    Attention needed from Camillo Bruni and Etienne Dechamps

    mmenke added 5 comments

    File net/log/trace_net_log_observer.cc
    Line 301, Patchset 35 (Latest):NetLogCaptureMode TraceNetLogObserver::SelectCaptureMode() const {
    mmenke . unresolved

    Definition order should match order in header file.

    Line 301, Patchset 35 (Latest):NetLogCaptureMode TraceNetLogObserver::SelectCaptureMode() const {
    mmenke . unresolved

    Let's call this GetCaptureMode() or CaptureMode(). Select implies to me, at least, that it sets state (i.e., `capture_mode_ = foo`)

    Line 340, Patchset 35 (Latest): if (net_log() || !net_log_to_watch_) {
    mmenke . unresolved

    Can this happen? The only place this is cleared is StopWatchForTraceStart(), and this shouldn't be called after we stop watching for trace start, no? Only place it's set is WatchForTraceStart(), which doesn't seem to support it being nullptr.

    File net/log/trace_net_log_observer_unittest.cc
    Line 158, Patchset 35 (Latest): void TriggerByteTransferAndFlush(
    std::optional<std::string_view> category,
    mmenke . unresolved

    Should mention what an empty category means (we don't actually enable tracing). SHould also mention the byte transfer event.

    Line 549, Patchset 35 (Latest): const base::Value* item = &trace_events()[0];
    ASSERT_TRUE(item->is_dict());
    mmenke . unresolved

    Can we check that this doesn't have args.params.bytes? Same for the others - and we should make sure we have something that wouldn't appear in non-sensitive logs as well. Pulling the actual category should ideally ensure all that works, anyways, but as long as it's not that difficult, seems safest to be complete here.

    We are already relying on the details of byte transfer event logic.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Camillo Bruni
    • Etienne Dechamps
    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: I8f9bac7ba0384e652c2eb47363156aa4af96f127
    Gerrit-Change-Number: 7881639
    Gerrit-PatchSet: 35
    Gerrit-Owner: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Reviewer: Etienne Dechamps <edec...@google.com>
    Gerrit-Reviewer: mmenke <mme...@chromium.org>
    Gerrit-Attention: Etienne Dechamps <edec...@google.com>
    Gerrit-Attention: Camillo Bruni <cbr...@chromium.org>
    Gerrit-Comment-Date: Wed, 17 Jun 2026 17:44:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages