etw-stackwalk: add simple stack walk events [chromium/src : main]

1 view
Skip to first unread message

Jesse McKenna (Gerrit)

unread,
May 15, 2026, 7:51:01 PM (6 days ago) May 15
to Etienne Pierre-Doray, Sean Maher, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Etienne Pierre-Doray and Sean Maher

Jesse McKenna added 1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Jesse McKenna . resolved

PTAL - any and all feedback is welcome!

I found that I had to finalize the previous packet and create a new one in order to add interned data to the trace packet, but I'm open to suggestions if there's a better way.

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
  • Sean Maher
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: I0aeccd860eaadcc910ac4e2583f32f982dde537b
Gerrit-Change-Number: 7794326
Gerrit-PatchSet: 7
Gerrit-Owner: Jesse McKenna <jessem...@google.com>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Sean Maher <sp...@chromium.org>
Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Attention: Sean Maher <sp...@chromium.org>
Gerrit-Comment-Date: Fri, 15 May 2026 23:50:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sean Maher (Gerrit)

unread,
May 16, 2026, 9:17:23 PM (5 days ago) May 16
to Jesse McKenna, Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Etienne Pierre-Doray and Jesse McKenna

Sean Maher added 1 comment

File components/tracing/common/etw_consumer_win.cc
Line 365, Patchset 7 (Latest):void EtwConsumer::HandleStackWalkEvent(const EVENT_HEADER& header,
Sean Maher . unresolved

naisu

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
  • Jesse McKenna
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: I0aeccd860eaadcc910ac4e2583f32f982dde537b
    Gerrit-Change-Number: 7794326
    Gerrit-PatchSet: 7
    Gerrit-Owner: Jesse McKenna <jessem...@google.com>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Sean Maher <sp...@chromium.org>
    Gerrit-Attention: Jesse McKenna <jessem...@google.com>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Sun, 17 May 2026 01:17:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    May 19, 2026, 3:13:46 PM (2 days ago) May 19
    to Jesse McKenna, Sean Maher, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Jesse McKenna

    Etienne Pierre-Doray added 6 comments

    Patchset-level comments
    Etienne Pierre-Doray . resolved

    Nice!

    File components/tracing/common/etw_consumer_win.h
    Line 252, Patchset 7 (Latest): InterningIndex<TypeList<uintptr_t>, SizeList<1024>> interned_frames_;
    Etienne Pierre-Doray . unresolved

    See my comment re. pointer_size below. This would need to be uint64_t to work in all cases.

    Line 250, Patchset 7 (Latest): InterningIndex<TypeList<size_t>, SizeList<1024>> interned_callstacks_;
    Etienne Pierre-Doray . unresolved

    Interned data needs to reset on EtwSystemDataSource::WillClearIncrementalState, so it gets emitted again.

    File components/tracing/common/etw_consumer_win.cc
    Line 374, Patchset 7 (Latest): // Read and validate the contents of `packet_data`.
    base::BufferIterator<const uint8_t> iterator{packet_data};
    auto qpc_timestamp = *iterator.CopyObject<uint64_t>();
    auto process_id = *iterator.CopyObject<uint32_t>();
    auto thread_id = *iterator.CopyObject<uint32_t>();
    Etienne Pierre-Doray . unresolved

    This is missing the typical bound check:

    ```
    if (packet_data.size() < kMinimumSize) {
    return false;
    }
    ```
    Line 384, Patchset 7 (Latest): base::span<const uintptr_t> call_stack =
    iterator.Span<const uintptr_t>(remaining_bytes / pointer_size);
    Etienne Pierre-Doray . unresolved

    I think this incorrectly assumes "Stack" members are uintptr_t, but they are documented as pointer_size.
    To correctly handle this while keeping the zero copy impl, you could do a template <class T> HandleStackWalkEventImpl() and then

    ```
    if (pointer_size == sizeof(uint32_t)) {
    HandleStackWalkEventImpl<uint32_t>(...);
    ) else {
    HandleStackWalkEventImpl<uint64_t>(...);
    }
    ```
    Line 1016, Patchset 7 (Latest): packet_handle_ = trace_writer_->NewTracePacket();
    Etienne Pierre-Doray . unresolved

    I think we need to unconditionally set SEQ_NEEDS_INCREMENTAL_STATE, since the packet may be reused for stackwalk after interned data was emitted in a previous packet.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jesse McKenna
    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: I0aeccd860eaadcc910ac4e2583f32f982dde537b
    Gerrit-Change-Number: 7794326
    Gerrit-PatchSet: 7
    Gerrit-Owner: Jesse McKenna <jessem...@google.com>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Sean Maher <sp...@chromium.org>
    Gerrit-Attention: Jesse McKenna <jessem...@google.com>
    Gerrit-Comment-Date: Tue, 19 May 2026 19:13:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages