[iOS tracing] Inject iOS system log events into perfetto traces [chromium/src : main]

10 views
Skip to first unread message

Etienne Pierre-Doray (Gerrit)

unread,
May 15, 2026, 2:30:21 PMMay 15
to Justin Novosad, Chromium LUCI CQ, Rohit Rao, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Justin Cohen, Justin Novosad and Rohit Rao

Etienne Pierre-Doray added 3 comments

File ios/chrome/browser/tracing/os_log_data_source.mm
Line 109, Patchset 5 (Latest): // We have no way to know whether other data sources have already added
// a track and thread descriptor for this thread, so we add one just in
// case. Perfetto's incremental state tracking handles deduplication
// automatically.
if (seen_threads.insert(thread_id).second) {
auto packet = ctx.NewTracePacket();
auto* track_descriptor = packet->set_track_descriptor();
track_descriptor->set_uuid(thread_track_uuid);
track_descriptor->set_parent_uuid(thread_track.parent_uuid);
auto* thread = track_descriptor->set_thread();
thread->set_pid(thread_track.pid);
thread->set_tid(thread_id);
const char* thread_name =
base::ThreadIdNameManager::GetInstance()->GetName(
base::PlatformThreadId(thread_id));
if (thread_name && thread_name[0] != '\0') {
thread->set_thread_name(thread_name);
} else {
// Fallback: if this thread is not known to Chromium, we must still
// provide a thread descriptor with some name for it.
thread->set_thread_name("Unknown Thread");
}
}
Etienne Pierre-Doray . unresolved

I find this awkward - emitting track event data is a lot of boilerplate when not using TRACE_EVENT macros directly.
I hit a similar problem for SystemMetricsSampler:
https://source.chromium.org/chromium/chromium/src/+/main:services/tracing/public/cpp/system_metrics_sampler.cc?q=systemmetricssampler&ss=chromium

I ended up using a combination of DataSource (to allow configuration and capturing Start/Stop) + using TRACE_EVENT directly, which is a bit weird (because it requires enabling both the category and the data source, which is the case here as well) but a lot simpler.
This could also be a simple TRACE_EVENT + TraceSessionObserver if you don't need a dedicated DataSourceConfig and state.

Line 145, Patchset 5 (Latest): track_event->add_categories("os_log");
Etienne Pierre-Doray . unresolved

Let's have this match the category in AddDataSourceConfigs()

File services/tracing/public/cpp/perfetto/perfetto_config.cc
Line 123, Patchset 5 (Latest): TRACE_DISABLED_BY_DEFAULT("os_log"))) {
Etienne Pierre-Doray . unresolved

Let's add the category in base/trace_event/builtin_categories.h
Nit: TRACE_DISABLED_BY_DEFAULT is mostly deprecated, I'd recommend seomthing like "ios.log.debug"

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 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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
Gerrit-Change-Number: 7748848
Gerrit-PatchSet: 5
Gerrit-Owner: Justin Novosad <ju...@chromium.org>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Justin Cohen <justi...@google.com>
Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
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: Fri, 15 May 2026 18:30:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Justin Novosad (Gerrit)

unread,
May 15, 2026, 3:18:20 PMMay 15
to Chromium LUCI CQ, Rohit Rao, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Etienne Pierre-Doray, Justin Cohen and Rohit Rao

Justin Novosad added 3 comments

File ios/chrome/browser/tracing/os_log_data_source.mm
Line 109, Patchset 5: // We have no way to know whether other data sources have already added

// a track and thread descriptor for this thread, so we add one just in
// case. Perfetto's incremental state tracking handles deduplication
// automatically.
if (seen_threads.insert(thread_id).second) {
auto packet = ctx.NewTracePacket();
auto* track_descriptor = packet->set_track_descriptor();
track_descriptor->set_uuid(thread_track_uuid);
track_descriptor->set_parent_uuid(thread_track.parent_uuid);
auto* thread = track_descriptor->set_thread();
thread->set_pid(thread_track.pid);
thread->set_tid(thread_id);
const char* thread_name =
base::ThreadIdNameManager::GetInstance()->GetName(
base::PlatformThreadId(thread_id));
if (thread_name && thread_name[0] != '\0') {
thread->set_thread_name(thread_name);
} else {
// Fallback: if this thread is not known to Chromium, we must still
// provide a thread descriptor with some name for it.
thread->set_thread_name("Unknown Thread");
}
}
Etienne Pierre-Doray . resolved

I find this awkward - emitting track event data is a lot of boilerplate when not using TRACE_EVENT macros directly.
I hit a similar problem for SystemMetricsSampler:
https://source.chromium.org/chromium/chromium/src/+/main:services/tracing/public/cpp/system_metrics_sampler.cc?q=systemmetricssampler&ss=chromium

I ended up using a combination of DataSource (to allow configuration and capturing Start/Stop) + using TRACE_EVENT directly, which is a bit weird (because it requires enabling both the category and the data source, which is the case here as well) but a lot simpler.
This could also be a simple TRACE_EVENT + TraceSessionObserver if you don't need a dedicated DataSourceConfig and state.

Justin Novosad

Oh, wow. It's so much simpler that way. Thanks!

Done.

Line 145, Patchset 5: track_event->add_categories("os_log");
Etienne Pierre-Doray . resolved

Let's have this match the category in AddDataSourceConfigs()

Justin Novosad

Done

File services/tracing/public/cpp/perfetto/perfetto_config.cc
Line 123, Patchset 5: TRACE_DISABLED_BY_DEFAULT("os_log"))) {
Etienne Pierre-Doray . resolved

Let's add the category in base/trace_event/builtin_categories.h
Nit: TRACE_DISABLED_BY_DEFAULT is mostly deprecated, I'd recommend seomthing like "ios.log.debug"

Justin Novosad

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
  • Justin Cohen
  • Rohit Rao
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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
    Gerrit-Change-Number: 7748848
    Gerrit-PatchSet: 6
    Gerrit-Owner: Justin Novosad <ju...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Justin Cohen <justi...@google.com>
    Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
    Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
    Gerrit-Attention: Justin Cohen <justi...@google.com>
    Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Fri, 15 May 2026 19:18:15 +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,
    May 19, 2026, 3:24:58 PMMay 19
    to Justin Novosad, Chromium LUCI CQ, Rohit Rao, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Justin Cohen, Justin Novosad and Rohit Rao

    Etienne Pierre-Doray added 3 comments

    File base/test/tracing/test_trace_processor.cc
    Line 161, Patchset 7 (Latest): session_->FlushBlocking();
    Etienne Pierre-Doray . unresolved

    I'd expect this to happen already as part of StopBlocking below.

    File ios/chrome/browser/tracing/os_log_data_source.mm
    Line 86, Patchset 7 (Latest): auto thread_track = perfetto::ThreadTrack::ForThread(thread_id);
    Etienne Pierre-Doray . unresolved

    Nit: You might want to create a named track scoped by the ThreadTrack, e.g.
    `NamedTrack("OSLog", 0, thread_track)` if you want this to appear separately from the regular thread's trace events.

    File services/tracing/public/cpp/perfetto/perfetto_data_source_names.h
    Line 34, Patchset 7 (Latest):inline constexpr char kOsLogSourceName[] = "org.chromium.os_log";
    Etienne Pierre-Doray . unresolved

    I think the data source name should have ios in the name as well?

    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 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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
      Gerrit-Change-Number: 7748848
      Gerrit-PatchSet: 7
      Gerrit-Owner: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      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: Tue, 19 May 2026 19:24:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Novosad (Gerrit)

      unread,
      May 25, 2026, 11:49:07 AMMay 25
      to Chromium LUCI CQ, Rohit Rao, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Etienne Pierre-Doray, Justin Cohen and Rohit Rao

      Justin Novosad added 3 comments

      File base/test/tracing/test_trace_processor.cc
      Line 161, Patchset 7: session_->FlushBlocking();
      Etienne Pierre-Doray . unresolved

      I'd expect this to happen already as part of StopBlocking below.

      Justin Novosad

      This call became necessary after your recommendation of using TRACE_EVENT_INSTANT directly inside `OSLogDataSource::ExtractAndTrace`. Without this flush, trace recording is stopped before the final call to `OSLogDataSource::ExtractAndTrace`, which causes the TRACE_EVENT_INSTANT invocations inside `OSLogDataSource::ExtractAndTrace` to be no-ops.

      File ios/chrome/browser/tracing/os_log_data_source.mm
      Line 86, Patchset 7: auto thread_track = perfetto::ThreadTrack::ForThread(thread_id);
      Etienne Pierre-Doray . resolved

      Nit: You might want to create a named track scoped by the ThreadTrack, e.g.
      `NamedTrack("OSLog", 0, thread_track)` if you want this to appear separately from the regular thread's trace events.

      Justin Novosad

      I tried it just to see but ended up reverting. The traces are easier to interpret this way.

      File services/tracing/public/cpp/perfetto/perfetto_data_source_names.h
      Line 34, Patchset 7:inline constexpr char kOsLogSourceName[] = "org.chromium.os_log";
      Etienne Pierre-Doray . resolved

      I think the data source name should have ios in the name as well?

      Justin Novosad

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Etienne Pierre-Doray
      • Justin Cohen
      • Rohit Rao
      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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
      Gerrit-Change-Number: 7748848
      Gerrit-PatchSet: 7
      Gerrit-Owner: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
      Gerrit-Attention: Justin Cohen <justi...@google.com>
      Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
      Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Comment-Date: Mon, 25 May 2026 15:49:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Novosad (Gerrit)

      unread,
      May 25, 2026, 1:14:34 PMMay 25
      to Chromium LUCI CQ, Rohit Rao, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Etienne Pierre-Doray, Justin Cohen, Justin Novosad and Rohit Rao

      Justin Novosad voted and added 1 comment

      Votes added by Justin Novosad

      Commit-Queue+1

      1 comment

      File base/test/tracing/test_trace_processor.cc
      Line 161, Patchset 7: session_->FlushBlocking();
      Etienne Pierre-Doray . unresolved

      I'd expect this to happen already as part of StopBlocking below.

      Justin Novosad

      This call became necessary after your recommendation of using TRACE_EVENT_INSTANT directly inside `OSLogDataSource::ExtractAndTrace`. Without this flush, trace recording is stopped before the final call to `OSLogDataSource::ExtractAndTrace`, which causes the TRACE_EVENT_INSTANT invocations inside `OSLogDataSource::ExtractAndTrace` to be no-ops.

      Justin Novosad

      Hmmm... This seems to be causing a "NOTREACHED" crash on other platforms, in `ConsumerEndpoint::Flush`. I need to figure this out....

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Etienne Pierre-Doray
      • Justin Cohen
      • Justin Novosad
      • Rohit Rao
      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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
      Gerrit-Change-Number: 7748848
      Gerrit-PatchSet: 9
      Gerrit-Owner: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Justin Cohen <justi...@google.com>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      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-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Comment-Date: Mon, 25 May 2026 17:14:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Justin Novosad <ju...@chromium.org>
      Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Novosad (Gerrit)

      unread,
      May 25, 2026, 1:30:54 PMMay 25
      to Chromium LUCI CQ, Rohit Rao, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Etienne Pierre-Doray, Justin Cohen and Rohit Rao

      Justin Novosad added 1 comment

      File base/test/tracing/test_trace_processor.cc
      Line 161, Patchset 7: session_->FlushBlocking();
      Etienne Pierre-Doray . resolved

      I'd expect this to happen already as part of StopBlocking below.

      Justin Novosad

      This call became necessary after your recommendation of using TRACE_EVENT_INSTANT directly inside `OSLogDataSource::ExtractAndTrace`. Without this flush, trace recording is stopped before the final call to `OSLogDataSource::ExtractAndTrace`, which causes the TRACE_EVENT_INSTANT invocations inside `OSLogDataSource::ExtractAndTrace` to be no-ops.

      Justin Novosad

      Hmmm... This seems to be causing a "NOTREACHED" crash on other platforms, in `ConsumerEndpoint::Flush`. I need to figure this out....

      Justin Novosad

      Fixed.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Etienne Pierre-Doray
      • Justin Cohen
      • Rohit Rao
      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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
        Gerrit-Change-Number: 7748848
        Gerrit-PatchSet: 10
        Gerrit-Owner: Justin Novosad <ju...@chromium.org>
        Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Reviewer: Justin Cohen <justi...@google.com>
        Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
        Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
        Gerrit-Attention: Justin Cohen <justi...@google.com>
        Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
        Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Comment-Date: Mon, 25 May 2026 17:30:49 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Etienne Pierre-Doray (Gerrit)

        unread,
        May 25, 2026, 2:47:58 PMMay 25
        to Justin Novosad, Chromium LUCI CQ, Rohit Rao, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
        Attention needed from Justin Cohen, Justin Novosad and Rohit Rao

        Etienne Pierre-Doray added 1 comment

        File base/test/tracing/test_trace_processor.cc
        Line 161, Patchset 7: session_->FlushBlocking();
        Etienne Pierre-Doray . unresolved

        I'd expect this to happen already as part of StopBlocking below.

        Justin Novosad

        This call became necessary after your recommendation of using TRACE_EVENT_INSTANT directly inside `OSLogDataSource::ExtractAndTrace`. Without this flush, trace recording is stopped before the final call to `OSLogDataSource::ExtractAndTrace`, which causes the TRACE_EVENT_INSTANT invocations inside `OSLogDataSource::ExtractAndTrace` to be no-ops.

        Justin Novosad

        Hmmm... This seems to be causing a "NOTREACHED" crash on other platforms, in `ConsumerEndpoint::Flush`. I need to figure this out....

        Justin Novosad

        Fixed.

        Etienne Pierre-Doray

        I see, I think this is because perfetto doesn't support emitting track event data during tear down of another data source (or rather it doesn't guarantee that such data would flush correctly).
        This suggests it isn't guaranteed to work in production either, so I don't think this is a suitable work around 😞

        I see 2 alternatives:
        1- Go back to the original impl of emitting direct track event protos (with all the boiler plate)
        2- Use TraceSessionObserver (much simpler), which hooks directly in the TrackEventDataSource. The downside is that you wouldn't be able to define a custom config, but you're not using one currently. TraceSessionObserver is currently missing OnFlush(), but I sent a perfetto pull request to fix that: https://github.com/google/perfetto/pull/6033
        This is only needed when taking snapshots, so it'd be mostly fine to do only OnStop() for now.

        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 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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
          Gerrit-Change-Number: 7748848
          Gerrit-PatchSet: 10
          Gerrit-Owner: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Justin Cohen <justi...@google.com>
          Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
          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: Mon, 25 May 2026 18:47:50 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Justin Novosad (Gerrit)

          unread,
          May 25, 2026, 6:06:12 PMMay 25
          to Chromium LUCI CQ, Rohit Rao, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
          Attention needed from Etienne Pierre-Doray, Justin Cohen and Rohit Rao

          Justin Novosad added 1 comment

          File base/test/tracing/test_trace_processor.cc
          Line 161, Patchset 7: session_->FlushBlocking();
          Etienne Pierre-Doray . unresolved

          I'd expect this to happen already as part of StopBlocking below.

          Justin Novosad

          This call became necessary after your recommendation of using TRACE_EVENT_INSTANT directly inside `OSLogDataSource::ExtractAndTrace`. Without this flush, trace recording is stopped before the final call to `OSLogDataSource::ExtractAndTrace`, which causes the TRACE_EVENT_INSTANT invocations inside `OSLogDataSource::ExtractAndTrace` to be no-ops.

          Justin Novosad

          Hmmm... This seems to be causing a "NOTREACHED" crash on other platforms, in `ConsumerEndpoint::Flush`. I need to figure this out....

          Justin Novosad

          Fixed.

          Etienne Pierre-Doray

          I see, I think this is because perfetto doesn't support emitting track event data during tear down of another data source (or rather it doesn't guarantee that such data would flush correctly).
          This suggests it isn't guaranteed to work in production either, so I don't think this is a suitable work around 😞

          I see 2 alternatives:
          1- Go back to the original impl of emitting direct track event protos (with all the boiler plate)
          2- Use TraceSessionObserver (much simpler), which hooks directly in the TrackEventDataSource. The downside is that you wouldn't be able to define a custom config, but you're not using one currently. TraceSessionObserver is currently missing OnFlush(), but I sent a perfetto pull request to fix that: https://github.com/google/perfetto/pull/6033
          This is only needed when taking snapshots, so it'd be mostly fine to do only OnStop() for now.

          Justin Novosad

          Okay, I did #2. It's just missing the OnFlush implementation, which I'll add once your perfetto PR lands.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Etienne Pierre-Doray
          • Justin Cohen
          • Rohit Rao
          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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
          Gerrit-Change-Number: 7748848
          Gerrit-PatchSet: 14
          Gerrit-Owner: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Justin Cohen <justi...@google.com>
          Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
          Gerrit-Attention: Justin Cohen <justi...@google.com>
          Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
          Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Comment-Date: Mon, 25 May 2026 22:06:03 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Justin Novosad (Gerrit)

          unread,
          May 26, 2026, 10:53:50 AMMay 26
          to Chromium LUCI CQ, Rohit Rao, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
          Attention needed from Etienne Pierre-Doray, Justin Cohen and Rohit Rao

          Justin Novosad added 1 comment

          Patchset-level comments
          File-level comment, Patchset 15 (Latest):
          Justin Novosad . unresolved

          @etiennep : This is really annoying: There is a crash on the bots that I am unable to repro locally. For some reason `perfetto::Track::MakeThreadTrack` is sometimes receiving a thread id of 0 (invalid). Have you ever seen anything like this?

          Open in Gerrit

          Related details

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

          Etienne Pierre-Doray (Gerrit)

          unread,
          May 26, 2026, 11:44:27 AMMay 26
          to Justin Novosad, Chromium LUCI CQ, Rohit Rao, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
          Attention needed from Justin Cohen, Justin Novosad and Rohit Rao

          Etienne Pierre-Doray added 1 comment

          Patchset-level comments
          Justin Novosad . unresolved

          @etiennep : This is really annoying: There is a crash on the bots that I am unable to repro locally. For some reason `perfetto::Track::MakeThreadTrack` is sometimes receiving a thread id of 0 (invalid). Have you ever seen anything like this?

          Etienne Pierre-Doray

          There is a crash on the bots that I am unable to repro locally.

          I can't find it from the CQ, do you have a link?

          ThreadTrack get its thread_id from perfetto::Platform:: GetCurrentThreadId(), which is overridden by PerfettoPlatform::GetCurrentThreadId().
          Though in test it might be using the default perfetto::base::GetThreadId().

          In both cases, this does pthread_threadid_np(nullptr, &tid), although the PlatformThreadBase::CurrentId CHECKs for error.

          https://source.chromium.org/chromium/chromium/src/+/main:third_party/perfetto/src/tracing/track.cc;l=104?q=perfetto::ThreadTrack::ForThread&ss=chromium

          https://source.chromium.org/chromium/chromium/src/+/main:base/tracing/perfetto_platform.cc;l=91;drc=6a3eac9c665a23caf101edf535b0a3479e5f0b2e;bpv=1;bpt=1

          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 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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
          Gerrit-Change-Number: 7748848
          Gerrit-PatchSet: 15
          Gerrit-Owner: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Justin Cohen <justi...@google.com>
          Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
          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: Tue, 26 May 2026 15:44:22 +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,
          May 27, 2026, 1:12:18 PMMay 27
          to Chromium LUCI CQ, Rohit Rao, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
          Attention needed from Etienne Pierre-Doray, Justin Cohen and Rohit Rao

          Justin Novosad added 1 comment

          Patchset-level comments
          Justin Novosad . resolved

          @etiennep : This is really annoying: There is a crash on the bots that I am unable to repro locally. For some reason `perfetto::Track::MakeThreadTrack` is sometimes receiving a thread id of 0 (invalid). Have you ever seen anything like this?

          Etienne Pierre-Doray

          There is a crash on the bots that I am unable to repro locally.

          I can't find it from the CQ, do you have a link?

          ThreadTrack get its thread_id from perfetto::Platform:: GetCurrentThreadId(), which is overridden by PerfettoPlatform::GetCurrentThreadId().
          Though in test it might be using the default perfetto::base::GetThreadId().

          In both cases, this does pthread_threadid_np(nullptr, &tid), although the PlatformThreadBase::CurrentId CHECKs for error.

          https://source.chromium.org/chromium/chromium/src/+/main:third_party/perfetto/src/tracing/track.cc;l=104?q=perfetto::ThreadTrack::ForThread&ss=chromium

          https://source.chromium.org/chromium/chromium/src/+/main:base/tracing/perfetto_platform.cc;l=91;drc=6a3eac9c665a23caf101edf535b0a3479e5f0b2e;bpv=1;bpt=1

          Justin Novosad

          Oh yeah, looks like my speculative fix in Patchset 15 solved the crash. It lookls like the thread ID = 0 was coming from the thread ID field of system log events. That's weird, but not a big deal. I just created a new NamedTrack for stick all the log entries that don't have thread IDs.

          Now the main issue is that one of the test became flaky due to a duplicated log entry. That's a completely separate issue.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Etienne Pierre-Doray
          • Justin Cohen
          • Rohit Rao
          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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
          Gerrit-Change-Number: 7748848
          Gerrit-PatchSet: 15
          Gerrit-Owner: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Justin Cohen <justi...@google.com>
          Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
          Gerrit-Attention: Justin Cohen <justi...@google.com>
          Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
          Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Comment-Date: Wed, 27 May 2026 17:12:09 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Justin Novosad <ju...@chromium.org>
          Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Justin Novosad (Gerrit)

          unread,
          May 27, 2026, 2:04:38 PMMay 27
          to Chromium LUCI CQ, Rohit Rao, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
          Attention needed from Etienne Pierre-Doray, Justin Cohen and Rohit Rao

          Justin Novosad added 1 comment

          File base/test/tracing/test_trace_processor.cc
          Line 161, Patchset 7: session_->FlushBlocking();
          Etienne Pierre-Doray . resolved

          I'd expect this to happen already as part of StopBlocking below.

          Justin Novosad

          This call became necessary after your recommendation of using TRACE_EVENT_INSTANT directly inside `OSLogDataSource::ExtractAndTrace`. Without this flush, trace recording is stopped before the final call to `OSLogDataSource::ExtractAndTrace`, which causes the TRACE_EVENT_INSTANT invocations inside `OSLogDataSource::ExtractAndTrace` to be no-ops.

          Justin Novosad

          Hmmm... This seems to be causing a "NOTREACHED" crash on other platforms, in `ConsumerEndpoint::Flush`. I need to figure this out....

          Justin Novosad

          Fixed.

          Etienne Pierre-Doray

          I see, I think this is because perfetto doesn't support emitting track event data during tear down of another data source (or rather it doesn't guarantee that such data would flush correctly).
          This suggests it isn't guaranteed to work in production either, so I don't think this is a suitable work around 😞

          I see 2 alternatives:
          1- Go back to the original impl of emitting direct track event protos (with all the boiler plate)
          2- Use TraceSessionObserver (much simpler), which hooks directly in the TrackEventDataSource. The downside is that you wouldn't be able to define a custom config, but you're not using one currently. TraceSessionObserver is currently missing OnFlush(), but I sent a perfetto pull request to fix that: https://github.com/google/perfetto/pull/6033
          This is only needed when taking snapshots, so it'd be mostly fine to do only OnStop() for now.

          Justin Novosad

          Okay, I did #2. It's just missing the OnFlush implementation, which I'll add once your perfetto PR lands.

          Justin Novosad

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Etienne Pierre-Doray
          • Justin Cohen
          • Rohit Rao
          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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
            Gerrit-Change-Number: 7748848
            Gerrit-PatchSet: 15
            Gerrit-Owner: Justin Novosad <ju...@chromium.org>
            Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Reviewer: Justin Cohen <justi...@google.com>
            Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
            Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
            Gerrit-Attention: Justin Cohen <justi...@google.com>
            Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
            Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Comment-Date: Wed, 27 May 2026 18:04:31 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Etienne Pierre-Doray (Gerrit)

            unread,
            May 28, 2026, 2:37:15 PM (14 days ago) May 28
            to Justin Novosad, Chromium LUCI CQ, Rohit Rao, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
            Attention needed from Justin Cohen, Justin Novosad and Rohit Rao

            Etienne Pierre-Doray voted and added 3 comments

            Votes added by Etienne Pierre-Doray

            Code-Review+1

            3 comments

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

            LGTM

            File ios/chrome/browser/tracing/os_log_trace_session_observer.mm
            Line 22, Patchset 17 (Latest):void OSLogTraceSessionObserver::OnSetup(
            const perfetto::DataSourceBase::SetupArgs&) {}
            Etienne Pierre-Doray . unresolved

            Nit: TraceSessionObserver has an empty default impl, you don't need to override/define it.


            auto thread_track = perfetto::ThreadTrack::ForThread(thread_id);
            TRACE_EVENT_INSTANT("ios.os_log.debug",
            perfetto::DynamicString(subsystem), thread_track,
            timestamp, "message", message);
            } else {
            TRACE_EVENT_INSTANT("ios.os_log.debug",
            perfetto::DynamicString(subsystem),
            perfetto::NamedTrack("Unknown Thread"), timestamp,
            "message", message);
            }
            Etienne Pierre-Doray . unresolved

            Nit:

            ```
            auto thread_track = thread_id ? perfetto::ThreadTrack::ForThread(thread_id) : perfetto::ThreadTrack::Current();

            TRACE_EVENT_INSTANT(..., thread_track, ...);
            ```

            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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
              Gerrit-Change-Number: 7748848
              Gerrit-PatchSet: 17
              Gerrit-Owner: Justin Novosad <ju...@chromium.org>
              Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
              Gerrit-Reviewer: Justin Cohen <justi...@google.com>
              Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
              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, 28 May 2026 18:37:06 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Justin Novosad (Gerrit)

              unread,
              Jun 1, 2026, 9:19:19 AM (10 days ago) Jun 1
              to Etienne Pierre-Doray, Chromium LUCI CQ, Rohit Rao, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
              Attention needed from Justin Cohen and Rohit Rao

              Justin Novosad added 2 comments

              File ios/chrome/browser/tracing/os_log_trace_session_observer.mm
              Line 22, Patchset 17:void OSLogTraceSessionObserver::OnSetup(
              const perfetto::DataSourceBase::SetupArgs&) {}
              Etienne Pierre-Doray . resolved

              Nit: TraceSessionObserver has an empty default impl, you don't need to override/define it.

              Justin Novosad

              Done

              Line 86, Patchset 17: if (thread_id) {

              auto thread_track = perfetto::ThreadTrack::ForThread(thread_id);
              TRACE_EVENT_INSTANT("ios.os_log.debug",
              perfetto::DynamicString(subsystem), thread_track,
              timestamp, "message", message);
              } else {
              TRACE_EVENT_INSTANT("ios.os_log.debug",
              perfetto::DynamicString(subsystem),
              perfetto::NamedTrack("Unknown Thread"), timestamp,
              "message", message);
              }
              Etienne Pierre-Doray . resolved

              Nit:

              ```
              auto thread_track = thread_id ? perfetto::ThreadTrack::ForThread(thread_id) : perfetto::ThreadTrack::Current();

              TRACE_EVENT_INSTANT(..., thread_track, ...);
              ```

              Justin Novosad

              Unfortunately we can't do that (I had already tried) because we're using different track types in both cases (ThreadTrack vs. NamedTrack). I want to use NamedTrack("Unknown Thread") in the case where thread_id is 0 rather than using ThreadTrack::Current(), which would put the event on the Tracing Muxer thread, which would be misleading.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Justin Cohen
              • 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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
                Gerrit-Change-Number: 7748848
                Gerrit-PatchSet: 20
                Gerrit-Owner: Justin Novosad <ju...@chromium.org>
                Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
                Gerrit-Attention: Justin Cohen <justi...@google.com>
                Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
                Gerrit-Comment-Date: Mon, 01 Jun 2026 13:19:07 +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,
                Jun 1, 2026, 10:45:37 AM (10 days ago) Jun 1
                to Justin Novosad, Chromium LUCI CQ, Rohit Rao, android-bu...@system.gserviceaccount.com, Justin Cohen, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
                Attention needed from Justin Cohen, Justin Novosad and Rohit Rao

                Etienne Pierre-Doray voted and added 2 comments

                Votes added by Etienne Pierre-Doray

                Code-Review+1

                2 comments

                Patchset-level comments
                Etienne Pierre-Doray . resolved

                LGTM

                File ios/chrome/browser/tracing/os_log_trace_session_observer.mm
                Line 86, Patchset 17: if (thread_id) {
                auto thread_track = perfetto::ThreadTrack::ForThread(thread_id);
                TRACE_EVENT_INSTANT("ios.os_log.debug",
                perfetto::DynamicString(subsystem), thread_track,
                timestamp, "message", message);
                } else {
                TRACE_EVENT_INSTANT("ios.os_log.debug",
                perfetto::DynamicString(subsystem),
                perfetto::NamedTrack("Unknown Thread"), timestamp,
                "message", message);
                }
                Etienne Pierre-Doray . resolved

                Nit:

                ```
                auto thread_track = thread_id ? perfetto::ThreadTrack::ForThread(thread_id) : perfetto::ThreadTrack::Current();

                TRACE_EVENT_INSTANT(..., thread_track, ...);
                ```

                Justin Novosad

                Unfortunately we can't do that (I had already tried) because we're using different track types in both cases (ThreadTrack vs. NamedTrack). I want to use NamedTrack("Unknown Thread") in the case where thread_id is 0 rather than using ThreadTrack::Current(), which would put the event on the Tracing Muxer thread, which would be misleading.

                Etienne Pierre-Doray

                I missed the NamedTrack bit, SG.

                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 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: I4cd63ee4d6e46247e909d1ef0783555ef8732d79
                Gerrit-Change-Number: 7748848
                Gerrit-PatchSet: 21
                Gerrit-Owner: Justin Novosad <ju...@chromium.org>
                Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Reviewer: Justin Cohen <justi...@google.com>
                Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
                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: Mon, 01 Jun 2026 14:45:22 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy
                Reply all
                Reply to author
                Forward
                0 new messages