etw payload support [chromium/src : main]

1 view
Skip to first unread message

Todd Reifsteck (Gerrit)

unread,
Jun 14, 2024, 2:20:47 PMJun 14
to Myungsub Kim, Bruce Dawson, Chromium LUCI CQ, Etienne Pierre-Doray, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Myungsub Kim

Todd Reifsteck added 2 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Todd Reifsteck . resolved

Adding Bruce Dawson to reviewers to see if we can get a speed up a prompt review as this issue is causing us to have problems with using ETW to diagnose/investigate issues in Edge. Thanks so much!

File base/trace_event/trace_logging_minimal_win.h
Line 235, Patchset 2: // Untemplate version of WreiteEvent, taking series of TlmField objects.
Todd Reifsteck . unresolved
```suggestion
// Untemplated version of WriteEvent, taking series of TlmField objects.
```
Open in Gerrit

Related details

Attention is currently required from:
  • Bruce Dawson
  • Chris Davis
  • Etienne Pierre-Doray
  • Joe Laughlin
  • Myungsub Kim
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
Gerrit-Change-Number: 5631658
Gerrit-PatchSet: 3
Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
Gerrit-Comment-Date: Fri, 14 Jun 2024 18:20:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Myungsub Kim (Gerrit)

unread,
Jun 14, 2024, 2:34:30 PMJun 14
to Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Etienne Pierre-Doray, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

Myungsub Kim added 1 comment

File base/trace_event/trace_logging_minimal_win.h
Line 235, Patchset 2: // Untemplate version of WreiteEvent, taking series of TlmField objects.
Todd Reifsteck . resolved
```suggestion
// Untemplated version of WriteEvent, taking series of TlmField objects.
```
Myungsub Kim

@Todd Reifsteck, thanks.

Open in Gerrit

Related details

Attention is currently required from:
  • Bruce Dawson
  • Chris Davis
  • Etienne Pierre-Doray
  • Joe Laughlin
  • Todd Reifsteck
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
Gerrit-Change-Number: 5631658
Gerrit-PatchSet: 4
Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
Gerrit-Comment-Date: Fri, 14 Jun 2024 18:34:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Todd Reifsteck <todd...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Bruce Dawson (Gerrit)

unread,
Jun 14, 2024, 7:42:26 PMJun 14
to Myungsub Kim, Todd Reifsteck, Chromium LUCI CQ, Etienne Pierre-Doray, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

Bruce Dawson voted and added 5 comments

Votes added by Bruce Dawson

Code-Review+1

5 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Bruce Dawson . resolved

This seems plausible to me.

File base/trace_event/etw_interceptor_win.h
Line 74, Patchset 5 (Latest): uint8_t in_type_ = 2 /* TlgInANSISTRING*/;
Bruce Dawson . unresolved

For consistency there should be a space before */

Line 17, Patchset 5 (Latest):namespace perfetto {
Bruce Dawson . unresolved

Can/should this be done as:
namespace perfetto::protos::pbzero {
?

See line 25.

File base/trace_event/etw_interceptor_win.cc
Line 70, Patchset 5 (Latest): // The maximum number of fields is 6, which is including maximum of 2 debug
Bruce Dawson . unresolved

Instead of a comment can you add a DCHECK just before the call to WriteEvent?

Line 158, Patchset 5 (Latest): in_type_ = 2 /* TlgInANSISTRING*/;
Bruce Dawson . unresolved

For consistency there should be a space after /* and before */

Open in Gerrit

Related details

Attention is currently required from:
  • Chris Davis
  • Etienne Pierre-Doray
  • Joe Laughlin
  • Myungsub Kim
  • Todd Reifsteck
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
    Gerrit-Change-Number: 5631658
    Gerrit-PatchSet: 5
    Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
    Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
    Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
    Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
    Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
    Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
    Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
    Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
    Gerrit-Comment-Date: Fri, 14 Jun 2024 23:42:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Myungsub Kim (Gerrit)

    unread,
    Jun 14, 2024, 8:28:57 PMJun 14
    to Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Etienne Pierre-Doray, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

    Myungsub Kim added 4 comments

    File base/trace_event/etw_interceptor_win.h
    Line 74, Patchset 5: uint8_t in_type_ = 2 /* TlgInANSISTRING*/;
    Bruce Dawson . resolved

    For consistency there should be a space before */

    Myungsub Kim

    Update to match the format

    Line 17, Patchset 5:namespace perfetto {
    Bruce Dawson . resolved

    Can/should this be done as:
    namespace perfetto::protos::pbzero {
    ?

    See line 25.

    Myungsub Kim

    Thanks, updated the name spaces.

    File base/trace_event/etw_interceptor_win.cc
    Line 70, Patchset 5: // The maximum number of fields is 6, which is including maximum of 2 debug
    Bruce Dawson . resolved

    Instead of a comment can you add a DCHECK just before the call to WriteEvent?

    Myungsub Kim

    @bruce Dawson, remove the comment as there is no limit on number of arguments we can handle here.

    Line 158, Patchset 5: in_type_ = 2 /* TlgInANSISTRING*/;
    Bruce Dawson . resolved

    For consistency there should be a space after /* and before */

    Myungsub Kim

    Thanks, added a space for consistency.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chris Davis
    • Etienne Pierre-Doray
    • Joe Laughlin
    • Todd Reifsteck
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
    Gerrit-Change-Number: 5631658
    Gerrit-PatchSet: 7
    Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
    Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
    Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
    Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
    Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
    Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
    Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
    Gerrit-Comment-Date: Sat, 15 Jun 2024 00:28:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Bruce Dawson <bruce...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Bruce Dawson (Gerrit)

    unread,
    Jun 15, 2024, 1:57:31 AMJun 15
    to Myungsub Kim, Eric Seckler, Todd Reifsteck, Chromium LUCI CQ, Etienne Pierre-Doray, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Chris Davis, Eric Seckler, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

    Bruce Dawson voted and added 2 comments

    Votes added by Bruce Dawson

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 7 (Latest):
    Bruce Dawson . resolved

    Thanks for the comment fixes. One more textual nit.

    Commit Message
    Line 9, Patchset 7 (Latest):When generating etw event, trace arguments are not populated,
    Bruce Dawson . unresolved

    The body of git commit messages should be wrapped at 72 columns.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chris Davis
    • Eric Seckler
    • Etienne Pierre-Doray
    • Joe Laughlin
    • Myungsub Kim
    • Todd Reifsteck
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
      Gerrit-Change-Number: 5631658
      Gerrit-PatchSet: 7
      Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
      Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
      Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
      Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
      Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
      Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
      Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
      Gerrit-Attention: Eric Seckler <esec...@chromium.org>
      Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
      Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Comment-Date: Sat, 15 Jun 2024 05:57:17 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Etienne Pierre-Doray (Gerrit)

      unread,
      Jun 15, 2024, 10:51:27 AMJun 15
      to Myungsub Kim, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Chris Davis, Eric Seckler, Joe Laughlin, Myungsub Kim and Todd Reifsteck

      Etienne Pierre-Doray added 3 comments

      Patchset-level comments
      Etienne Pierre-Doray . resolved

      Overall LGTM, but I worry about added overhead (ETW users are the main interested)
      I suggested ways to mitigate, feel free to ignore or do in a follow-up.

      File base/trace_event/etw_interceptor_win.cc
      Line 72, Patchset 2: std::vector<std::unique_ptr<TlmFieldBase>> etw_payloads;
      Etienne Pierre-Doray . unresolved

      Since most events don't have debug_annotations, you could eihter

      • add a fast path that calls WriteEvent() early as before, and avoid allocations.
      • Use absl::InlineVector that fits the minimum number of elements.
      File base/trace_event/trace_logging_minimal_win.cc
      Line 260, Patchset 7 (Latest): // Pack the event data.
      std::vector<EVENT_DATA_DESCRIPTOR> descriptors(descriptors_count);
      uint8_t descriptors_index = 2;
      for (const auto& field : fields) {
      const auto& value = *field;
      value.FillEventDescriptor(&descriptors[descriptors_index]);
      descriptors_index += value.GetDataDescCount();
      }
      Etienne Pierre-Doray . unresolved

      One idea to reduce overhead:

      • Wrap std::vector<EVENT_DATA_DESCRIPTOR> and char metadata[kMaxEventMetadataSize] in a helper class
      • The caller inserts elements by calling a (templated) method on the helper (instead of vector insert), fields get serialized right away (with FillEventDescriptor), this avoid unique_ptr allocation for each field, and a second vector.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Chris Davis
      • Eric Seckler
      Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
      Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Comment-Date: Sat, 15 Jun 2024 14:51:14 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Etienne Pierre-Doray (Gerrit)

      unread,
      Jun 15, 2024, 10:51:36 AMJun 15
      to Myungsub Kim, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Chris Davis, Eric Seckler, Joe Laughlin, Myungsub Kim and Todd Reifsteck

      Etienne Pierre-Doray voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Chris Davis
      • Eric Seckler
      • Joe Laughlin
      • Myungsub Kim
      • Todd Reifsteck
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
      Gerrit-Change-Number: 5631658
      Gerrit-PatchSet: 7
      Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
      Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
      Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
      Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
      Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
      Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
      Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
      Gerrit-Attention: Eric Seckler <esec...@chromium.org>
      Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
      Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Comment-Date: Sat, 15 Jun 2024 14:51:24 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Etienne Pierre-Doray (Gerrit)

      unread,
      Jun 15, 2024, 10:52:03 AMJun 15
      to Myungsub Kim, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Chris Davis, Eric Seckler, Joe Laughlin, Myungsub Kim and Todd Reifsteck

      Etienne Pierre-Doray added 1 comment

      Patchset-level comments
      Etienne Pierre-Doray . resolved

      Thanks for taking this on btw!

      Gerrit-Comment-Date: Sat, 15 Jun 2024 14:51:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Myungsub Kim (Gerrit)

      unread,
      Jun 15, 2024, 2:13:23 PMJun 15
      to Etienne Pierre-Doray, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Chris Davis, Eric Seckler, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

      Myungsub Kim added 3 comments

      Commit Message
      Line 9, Patchset 7:When generating etw event, trace arguments are not populated,
      Bruce Dawson . resolved

      The body of git commit messages should be wrapped at 72 columns.

      Myungsub Kim

      Thanks, I updated the commit message.

      File base/trace_event/etw_interceptor_win.cc
      Line 72, Patchset 2: std::vector<std::unique_ptr<TlmFieldBase>> etw_payloads;
      Etienne Pierre-Doray . resolved

      Since most events don't have debug_annotations, you could eihter

      • add a fast path that calls WriteEvent() early as before, and avoid allocations.
      • Use absl::InlineVector that fits the minimum number of elements.
      Myungsub Kim

      Thanks for the InlinedVector suggestion. changed to it and set the the default size to 6.

      File base/trace_event/trace_logging_minimal_win.cc
      Line 260, Patchset 7: // Pack the event data.

      std::vector<EVENT_DATA_DESCRIPTOR> descriptors(descriptors_count);
      uint8_t descriptors_index = 2;
      for (const auto& field : fields) {
      const auto& value = *field;
      value.FillEventDescriptor(&descriptors[descriptors_index]);
      descriptors_index += value.GetDataDescCount();
      }
      Etienne Pierre-Doray . unresolved

      One idea to reduce overhead:

      • Wrap std::vector<EVENT_DATA_DESCRIPTOR> and char metadata[kMaxEventMetadataSize] in a helper class
      • The caller inserts elements by calling a (templated) method on the helper (instead of vector insert), fields get serialized right away (with FillEventDescriptor), this avoid unique_ptr allocation for each field, and a second vector.
      Myungsub Kim

      @Etienne, thanks for the suggestion but I will have to ask you more help on that implementation as I am not clear. So, I will pass on this iteration for now.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Chris Davis
      • Eric Seckler
      • Etienne Pierre-Doray
      • Joe Laughlin
      • Todd Reifsteck
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
      Gerrit-Change-Number: 5631658
      Gerrit-PatchSet: 9
      Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
      Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
      Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
      Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
      Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
      Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
      Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Attention: Eric Seckler <esec...@chromium.org>
      Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
      Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Comment-Date: Sat, 15 Jun 2024 18:13:11 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
      Comment-In-Reply-To: Bruce Dawson <bruce...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Myungsub Kim (Gerrit)

      unread,
      Jun 15, 2024, 2:28:50 PMJun 15
      to Etienne Pierre-Doray, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Chris Davis, Eric Seckler, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

      Myungsub Kim added 1 comment

      File base/trace_event/trace_logging_minimal_win.cc
      Line 260, Patchset 7: // Pack the event data.
      std::vector<EVENT_DATA_DESCRIPTOR> descriptors(descriptors_count);
      uint8_t descriptors_index = 2;
      for (const auto& field : fields) {
      const auto& value = *field;
      value.FillEventDescriptor(&descriptors[descriptors_index]);
      descriptors_index += value.GetDataDescCount();
      }
      Etienne Pierre-Doray . resolved

      One idea to reduce overhead:

      • Wrap std::vector<EVENT_DATA_DESCRIPTOR> and char metadata[kMaxEventMetadataSize] in a helper class
      • The caller inserts elements by calling a (templated) method on the helper (instead of vector insert), fields get serialized right away (with FillEventDescriptor), this avoid unique_ptr allocation for each field, and a second vector.
      Myungsub Kim

      @Etienne, thanks for the suggestion but I will have to ask you more help on that implementation as I am not clear. So, I will pass on this iteration for now.

      Myungsub Kim

      Checking on as "Resolved" to satisfy the check-in condition. Please let me know if this isn't supposed to be like this.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Chris Davis
      • Eric Seckler
      • Etienne Pierre-Doray
      • Joe Laughlin
      • Todd Reifsteck
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Review
      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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
      Gerrit-Change-Number: 5631658
      Gerrit-PatchSet: 10
      Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
      Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
      Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
      Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
      Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
      Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
      Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Attention: Eric Seckler <esec...@chromium.org>
      Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
      Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
      Gerrit-Comment-Date: Sat, 15 Jun 2024 18:28:35 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Myungsub Kim <ms...@microsoft.com>
      Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
      satisfied_requirement
      open
      diffy

      Eric Seckler (Gerrit)

      unread,
      Jun 17, 2024, 6:12:42 AMJun 17
      to Myungsub Kim, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

      Eric Seckler voted and added 6 comments

      Votes added by Eric Seckler

      Code-Review+1

      6 comments

      Commit Message
      Line 9, Patchset 10 (Latest):When generating etw event, trace arguments are not populated,
      Eric Seckler . unresolved

      nit: now?

      Line 22, Patchset 10 (Latest):Deligate for TrackEventStateTracker was modified to take SequenceState
      Eric Seckler . unresolved

      nit: Delegate

      Line 25, Patchset 10 (Latest):to pass SequenceState directly to ETWInterceptor::Delegate::OnTrackEven() instead.
      Eric Seckler . unresolved

      nit: OnTrackEvent

      File base/trace_event/etw_interceptor_win.cc
      Line 71, Patchset 10 (Latest): // TODO(crbug.com/40276149): Consider exporting thread time once
      Eric Seckler . unresolved

      Half of this comment got removed

      Line 97, Patchset 10 (Latest): TlmFieldVector etw_payloads;
      Eric Seckler . unresolved

      Consider computing the required length of this in advance (e.g. N + M*event.track_event.debug_annotations_size())

      File base/trace_event/trace_logging_minimal_win.cc
      Line 260, Patchset 7: // Pack the event data.
      std::vector<EVENT_DATA_DESCRIPTOR> descriptors(descriptors_count);
      uint8_t descriptors_index = 2;
      for (const auto& field : fields) {
      const auto& value = *field;
      value.FillEventDescriptor(&descriptors[descriptors_index]);
      descriptors_index += value.GetDataDescCount();
      }
      Etienne Pierre-Doray . resolved

      One idea to reduce overhead:

      • Wrap std::vector<EVENT_DATA_DESCRIPTOR> and char metadata[kMaxEventMetadataSize] in a helper class
      • The caller inserts elements by calling a (templated) method on the helper (instead of vector insert), fields get serialized right away (with FillEventDescriptor), this avoid unique_ptr allocation for each field, and a second vector.
      Myungsub Kim

      @Etienne, thanks for the suggestion but I will have to ask you more help on that implementation as I am not clear. So, I will pass on this iteration for now.

      Myungsub Kim

      Checking on as "Resolved" to satisfy the check-in condition. Please let me know if this isn't supposed to be like this.

      Eric Seckler

      General +1 to considering reducing overhead 😊

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Chris Davis
      • Etienne Pierre-Doray
      • Joe Laughlin
      • Myungsub Kim
      • Todd Reifsteck
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
        Gerrit-Change-Number: 5631658
        Gerrit-PatchSet: 10
        Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
        Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
        Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
        Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
        Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
        Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
        Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
        Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
        Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
        Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
        Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
        Gerrit-Comment-Date: Mon, 17 Jun 2024 10:12:28 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Myungsub Kim (Gerrit)

        unread,
        Jun 17, 2024, 11:57:02 AM (14 days ago) Jun 17
        to Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
        Attention needed from Chris Davis, Eric Seckler, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

        Myungsub Kim added 5 comments

        Commit Message
        Line 9, Patchset 10:When generating etw event, trace arguments are not populated,
        Eric Seckler . unresolved

        nit: now?

        Myungsub Kim

        I am not sure what do you mean for this though. Can you help?

        Line 22, Patchset 10:Deligate for TrackEventStateTracker was modified to take SequenceState
        Eric Seckler . resolved

        nit: Delegate

        Myungsub Kim

        Thanks.

        Line 25, Patchset 10:to pass SequenceState directly to ETWInterceptor::Delegate::OnTrackEven() instead.
        Eric Seckler . resolved

        nit: OnTrackEvent

        Myungsub Kim

        Thanks for the catch

        File base/trace_event/etw_interceptor_win.cc
        Line 71, Patchset 10: // TODO(crbug.com/40276149): Consider exporting thread time once
        Eric Seckler . resolved

        Half of this comment got removed

        Myungsub Kim

        Thanks

        Line 97, Patchset 10: TlmFieldVector etw_payloads;
        Eric Seckler . unresolved

        Consider computing the required length of this in advance (e.g. N + M*event.track_event.debug_annotations_size())

        Myungsub Kim

        I have set the default size to 6, I will try out this shortly.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Chris Davis
        • Eric Seckler
        • Etienne Pierre-Doray
        • Joe Laughlin
        • Todd Reifsteck
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
        Gerrit-Change-Number: 5631658
        Gerrit-PatchSet: 11
        Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
        Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
        Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
        Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
        Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
        Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
        Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
        Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
        Gerrit-Attention: Eric Seckler <esec...@chromium.org>
        Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
        Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
        Gerrit-Comment-Date: Mon, 17 Jun 2024 15:56:47 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Eric Seckler <esec...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Eric Seckler (Gerrit)

        unread,
        Jun 18, 2024, 5:02:14 AM (13 days ago) Jun 18
        to Myungsub Kim, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
        Attention needed from Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

        Eric Seckler voted and added 1 comment

        Votes added by Eric Seckler

        Code-Review+1

        1 comment

        Commit Message
        Line 9, Patchset 10:When generating etw event, trace arguments are not populated,
        Eric Seckler . unresolved

        nit: now?

        Myungsub Kim

        I am not sure what do you mean for this though. Can you help?

        Eric Seckler

        Ah I just wasn't following this sentence.

        "trace arguments are not populated" -> does this describe the status-quo before the patch? Your next subclause talks about adding support to do this, I guess. Semantically, there's an issue there 😊

        Here's an alternative formulation:

        "This patch adds support to emit legacy trace arguments into ETW events by converting these arguments into additional ETW fields."
        ...

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Chris Davis
        • Etienne Pierre-Doray
        • Joe Laughlin
        • Myungsub Kim
        • Todd Reifsteck
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
        Gerrit-Change-Number: 5631658
        Gerrit-PatchSet: 11
        Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
        Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
        Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
        Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
        Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
        Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
        Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
        Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
        Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
        Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
        Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
        Gerrit-Comment-Date: Tue, 18 Jun 2024 09:01:56 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Myungsub Kim <ms...@microsoft.com>
        Comment-In-Reply-To: Eric Seckler <esec...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Myungsub Kim (Gerrit)

        unread,
        Jun 18, 2024, 11:52:53 AM (13 days ago) Jun 18
        to Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
        Attention needed from Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

        Myungsub Kim added 1 comment

        Commit Message
        Line 9, Patchset 10:When generating etw event, trace arguments are not populated,
        Eric Seckler . resolved

        nit: now?

        Myungsub Kim

        I am not sure what do you mean for this though. Can you help?

        Eric Seckler

        Ah I just wasn't following this sentence.

        "trace arguments are not populated" -> does this describe the status-quo before the patch? Your next subclause talks about adding support to do this, I guess. Semantically, there's an issue there 😊

        Here's an alternative formulation:

        "This patch adds support to emit legacy trace arguments into ETW events by converting these arguments into additional ETW fields."
        ...

        Myungsub Kim

        Thanks Eric.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Chris Davis
        • Etienne Pierre-Doray
        • Joe Laughlin
        • Todd Reifsteck
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
        Gerrit-Change-Number: 5631658
        Gerrit-PatchSet: 12
        Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
        Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
        Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
        Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
        Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
        Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
        Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
        Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
        Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
        Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
        Gerrit-Comment-Date: Tue, 18 Jun 2024 15:52:32 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Myungsub Kim (Gerrit)

        unread,
        Jun 18, 2024, 3:41:56 PM (13 days ago) Jun 18
        to Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
        Attention needed from Bruce Dawson, Chris Davis, Eric Seckler, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

        Myungsub Kim added 1 comment

        File base/trace_event/etw_interceptor_win.cc
        Line 97, Patchset 10: TlmFieldVector etw_payloads;
        Eric Seckler . resolved

        Consider computing the required length of this in advance (e.g. N + M*event.track_event.debug_annotations_size())

        Myungsub Kim

        I have set the default size to 6, I will try out this shortly.

        Myungsub Kim

        vector has been removed on the new iteration.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Bruce Dawson
        • Chris Davis
        • Eric Seckler
        • Etienne Pierre-Doray
        • Joe Laughlin
        • Todd Reifsteck
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Review
          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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
          Gerrit-Change-Number: 5631658
          Gerrit-PatchSet: 13
          Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
          Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
          Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
          Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
          Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
          Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
          Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
          Gerrit-Attention: Eric Seckler <esec...@chromium.org>
          Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
          Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
          Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
          Gerrit-Comment-Date: Tue, 18 Jun 2024 19:41:45 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Myungsub Kim (Gerrit)

          unread,
          Jun 18, 2024, 3:54:00 PM (13 days ago) Jun 18
          to Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
          Attention needed from Bruce Dawson, Chris Davis, Eric Seckler, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

          Myungsub Kim added 1 comment

          File base/trace_event/trace_logging_minimal_win.cc
          Line 260, Patchset 7: // Pack the event data.
          std::vector<EVENT_DATA_DESCRIPTOR> descriptors(descriptors_count);
          uint8_t descriptors_index = 2;
          for (const auto& field : fields) {
          const auto& value = *field;
          value.FillEventDescriptor(&descriptors[descriptors_index]);
          descriptors_index += value.GetDataDescCount();
          }
          Etienne Pierre-Doray . resolved

          One idea to reduce overhead:

          • Wrap std::vector<EVENT_DATA_DESCRIPTOR> and char metadata[kMaxEventMetadataSize] in a helper class
          • The caller inserts elements by calling a (templated) method on the helper (instead of vector insert), fields get serialized right away (with FillEventDescriptor), this avoid unique_ptr allocation for each field, and a second vector.
          Myungsub Kim

          @Etienne, thanks for the suggestion but I will have to ask you more help on that implementation as I am not clear. So, I will pass on this iteration for now.

          Myungsub Kim

          Checking on as "Resolved" to satisfy the check-in condition. Please let me know if this isn't supposed to be like this.

          Eric Seckler

          General +1 to considering reducing overhead 😊

          Myungsub Kim

          Patch 13 has this implemented, please take a look. Thanks

          Gerrit-Comment-Date: Tue, 18 Jun 2024 19:53:47 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Myungsub Kim <ms...@microsoft.com>
          Comment-In-Reply-To: Eric Seckler <esec...@chromium.org>
          Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Eric Seckler (Gerrit)

          unread,
          Jun 19, 2024, 9:51:45 AM (12 days ago) Jun 19
          to Myungsub Kim, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
          Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

          Eric Seckler voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Bruce Dawson
          • Chris Davis
          • Etienne Pierre-Doray
          • Joe Laughlin
          • Myungsub Kim
          • Todd Reifsteck
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Review
          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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
          Gerrit-Change-Number: 5631658
          Gerrit-PatchSet: 17
          Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
          Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
          Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
          Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
          Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
          Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
          Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
          Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
          Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
          Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
          Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
          Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
          Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
          Gerrit-Comment-Date: Wed, 19 Jun 2024 13:51:25 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Eric Seckler (Gerrit)

          unread,
          Jun 19, 2024, 9:56:21 AM (12 days ago) Jun 19
          to Myungsub Kim, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
          Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

          Eric Seckler added 2 comments

          File base/trace_event/etw_interceptor_win.cc
          Line 156, Patchset 17 (Latest): void WriteEvent(const T& value) {
          Eric Seckler . unresolved

          I'd consider renaming this to WriteField, since that's what you pass as an arg?

          Line 276, Patchset 17 (Latest): const TlmUInt64Field timestamp_event(
          Eric Seckler . unresolved

          s/_event/_field/ ?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Bruce Dawson
          • Chris Davis
          • Etienne Pierre-Doray
          • Joe Laughlin
          • Myungsub Kim
          • Todd Reifsteck
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
            Gerrit-Change-Number: 5631658
            Gerrit-PatchSet: 17
            Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
            Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
            Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
            Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
            Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
            Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
            Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
            Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
            Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
            Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
            Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
            Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
            Gerrit-Comment-Date: Wed, 19 Jun 2024 13:56:07 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Myungsub Kim (Gerrit)

            unread,
            Jun 19, 2024, 11:28:13 AM (12 days ago) Jun 19
            to Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
            Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

            Myungsub Kim added 3 comments

            Patchset-level comments
            File-level comment, Patchset 18 (Latest):
            Myungsub Kim . resolved

            Update per CR.

            File base/trace_event/etw_interceptor_win.cc
            Line 156, Patchset 17: void WriteEvent(const T& value) {
            Eric Seckler . resolved

            I'd consider renaming this to WriteField, since that's what you pass as an arg?

            Myungsub Kim

            thanks

            Line 276, Patchset 17: const TlmUInt64Field timestamp_event(
            Eric Seckler . resolved

            s/_event/_field/ ?

            Myungsub Kim

            thanks, good suggestion.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Bruce Dawson
            • Chris Davis
            • Etienne Pierre-Doray
            • Joe Laughlin
            • Todd Reifsteck
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Review
            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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
            Gerrit-Change-Number: 5631658
            Gerrit-PatchSet: 18
            Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
            Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
            Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
            Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
            Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
            Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
            Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
            Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
            Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
            Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
            Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
            Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
            Gerrit-Comment-Date: Wed, 19 Jun 2024 15:27:58 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Eric Seckler <esec...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Etienne Pierre-Doray (Gerrit)

            unread,
            Jun 21, 2024, 11:36:56 AM (10 days ago) Jun 21
            to Myungsub Kim, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
            Attention needed from Bruce Dawson, Chris Davis, Joe Laughlin, Myungsub Kim and Todd Reifsteck

            Etienne Pierre-Doray added 7 comments

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

            I like the new solution!

            File base/trace_event/etw_interceptor_win.cc
            Line 69, Patchset 19 (Latest): absl::variant<std::string, uint64_t, int64_t, bool, double> value_;
            Etienne Pierre-Doray . unresolved

            Could this be string_view? Considering pbzero::DebugAnnotation already has storage for the string and will outlive TlmFieldDebugAnnotation.

            Line 72, Patchset 19 (Latest):TlmFieldDebugAnnotation::TlmFieldDebugAnnotation(
            std::string_view name,
            perfetto::protos::pbzero::DebugAnnotation_Decoder& annotation)
            : TlmFieldBase(name) {
            CHECK_NE(Name(), nullptr);

            if (annotation.has_bool_value()) {
            in_type_ = 4 /* TlgInUINT8 */;
            out_type_ = 3 /* TlgOutBOOLEAN */;
            value_ = annotation.bool_value();
            } else if (annotation.has_int_value()) {
            in_type_ = 9;
            value_ = annotation.int_value();
            } else if (annotation.has_uint_value()) {
            in_type_ = 10;
            value_ = annotation.uint_value();
            } else if (annotation.has_string_value()) {
            in_type_ = 2 /* TlgInANSISTRING */;
            value_.emplace<std::string>(annotation.string_value().data,
            annotation.string_value().size);
            } else if (annotation.has_legacy_json_value()) {
            in_type_ = 2 /* TlgInANSISTRING */;
            value_.emplace<std::string>(annotation.legacy_json_value().data,
            annotation.legacy_json_value().size);
            } else if (annotation.has_pointer_value()) {
            in_type_ = 21 /* TlgInINTPTR */;
            value_ = annotation.pointer_value();
            } else if (annotation.has_double_value()) {
            in_type_ = 12 /* TlgInDOUBLE */;
            value_ = annotation.double_value();
            }
            }
            Etienne Pierre-Doray . unresolved

            Suggestion: I think we could leverage existing TlmField classes and avoid TlmFieldDebugAnnotation with a variant, by having a function that calls MultiEtwPayloadHandler::WriteField directly:

            ```
            void WriteDebugAnnotationTlmField(
            std::string_view name,
            perfetto::protos::pbzero::DebugAnnotation_Decoder& annotation,
            MultiEtwPayloadHandler& handler) {
            if (annotation.has_bool_value()) {
            handler.WriteField(TlmIntBoolField(name, annotation.bool_value()));
            } else (annotation.has_int_value()) {
            handler.WriteField(TlmInt64Field(name, annotation.int_value()));
            }
            ...
            else if (annotation.has_string_value()) {
            handler.WriteField(TlmMbcsStringField(name, annotation.string_value()));
            }
            ...
            }
            ```
            Line 174, Patchset 19 (Latest): return provider_->EventEnd(metadata_, metadata_index_, &descriptors_[0],
            Etienne Pierre-Doray . unresolved

            Nit: we could clear provider_ here, and

            • CHECK_EQ(nullptr, provider_) in destructor to enforce EventEnd gets called
            • CHECK_NE(nullptr, provider_) at the beginning of EventEnd to enforce it's only called once.
            Line 295, Patchset 19 (Latest): absl::InlinedVector<TlmFieldDebugAnnotation, 2> debug__fields;
            for (auto it = event.track_event.debug_annotations(); it; ++it) {
            perfetto::protos::pbzero::DebugAnnotation_Decoder annotation(*it);
            debug__fields.emplace_back(GetDebugAnnotationName(annotation), annotation);
            }
            Etienne Pierre-Doray . unresolved

            Following up on previous comment about string_view, we might not need additional storage for strings, so this could directly call WriteField()?

            Line 338, Patchset 19 (Latest):std::string_view ETWInterceptor::Delegate::GetDebugAnnotationName(
            Etienne Pierre-Doray . unresolved

            Nit: this can be a free function (non-member) in anonymous namespace.

            File base/trace_event/trace_logging_minimal_win.h
            Line 348, Patchset 19 (Latest): absl::variant<const char*, std::string> name_;
            Etienne Pierre-Doray . unresolved

            Same as TlmFieldDebugAnnotation, I think this could just be a string_view, since the data comes from either string literals, or pbzero::DebugAnnotation which outlives this.

            Additionally add a comment on constructor to mention the data is expected to oulive this class.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Bruce Dawson
            • Chris Davis
            • Joe Laughlin
            • Myungsub Kim
            • Todd Reifsteck
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
              Gerrit-Change-Number: 5631658
              Gerrit-PatchSet: 19
              Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
              Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
              Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
              Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
              Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
              Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
              Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
              Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
              Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
              Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
              Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
              Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
              Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
              Gerrit-Comment-Date: Fri, 21 Jun 2024 15:36:41 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Myungsub Kim (Gerrit)

              unread,
              Jun 21, 2024, 3:58:50 PM (10 days ago) Jun 21
              to Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
              Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

              Myungsub Kim added 7 comments

              Patchset-level comments
              File-level comment, Patchset 20 (Latest):
              Myungsub Kim . resolved

              Updated per code review comments.

              File base/trace_event/etw_interceptor_win.cc
              Line 69, Patchset 19: absl::variant<std::string, uint64_t, int64_t, bool, double> value_;
              Etienne Pierre-Doray . resolved

              Could this be string_view? Considering pbzero::DebugAnnotation already has storage for the string and will outlive TlmFieldDebugAnnotation.

              Myungsub Kim

              If we can use std::string_view instead of std::string, it would been great as we don't have to copy but TlmField string has to be a null terminated string hence I couldn't use it as DebugAnnotation isn't null terminated.

              Line 72, Patchset 19:TlmFieldDebugAnnotation::TlmFieldDebugAnnotation(
              Etienne Pierre-Doray . resolved

              Suggestion: I think we could leverage existing TlmField classes and avoid TlmFieldDebugAnnotation with a variant, by having a function that calls MultiEtwPayloadHandler::WriteField directly:

              ```
              void WriteDebugAnnotationTlmField(
              std::string_view name,
              perfetto::protos::pbzero::DebugAnnotation_Decoder& annotation,
              MultiEtwPayloadHandler& handler) {
              if (annotation.has_bool_value()) {
              handler.WriteField(TlmIntBoolField(name, annotation.bool_value()));
              } else (annotation.has_int_value()) {
              handler.WriteField(TlmInt64Field(name, annotation.int_value()));
              }
              ...
              else if (annotation.has_string_value()) {
              handler.WriteField(TlmMbcsStringField(name, annotation.string_value()));
              }
              ...
              }
              ```
              Myungsub Kim

              Good suggestion but we can't use std::string_view so we will need new class for it and couple more (pointer and boolean) those are not used anywhere else. Rather keep it under single class as TlmFieldDebugAnnotation.

              Line 174, Patchset 19: return provider_->EventEnd(metadata_, metadata_index_, &descriptors_[0],
              Etienne Pierre-Doray . resolved

              Nit: we could clear provider_ here, and

              • CHECK_EQ(nullptr, provider_) in destructor to enforce EventEnd gets called
              • CHECK_NE(nullptr, provider_) at the beginning of EventEnd to enforce it's only called once.
              Myungsub Kim

              Added those checks and clear provider_ on EndEvent. Thanks.

              Line 295, Patchset 19: absl::InlinedVector<TlmFieldDebugAnnotation, 2> debug__fields;

              for (auto it = event.track_event.debug_annotations(); it; ++it) {
              perfetto::protos::pbzero::DebugAnnotation_Decoder annotation(*it);
              debug__fields.emplace_back(GetDebugAnnotationName(annotation), annotation);
              }
              Etienne Pierre-Doray . resolved

              Following up on previous comment about string_view, we might not need additional storage for strings, so this could directly call WriteField()?

              Myungsub Kim

              Due to std::string_view can't be used in the Etw field, we can't do that.

              Line 338, Patchset 19:std::string_view ETWInterceptor::Delegate::GetDebugAnnotationName(
              Etienne Pierre-Doray . resolved

              Nit: this can be a free function (non-member) in anonymous namespace.

              Myungsub Kim

              moved out from Delegate class.

              File base/trace_event/trace_logging_minimal_win.h
              Line 348, Patchset 19: absl::variant<const char*, std::string> name_;
              Etienne Pierre-Doray . resolved

              Same as TlmFieldDebugAnnotation, I think this could just be a string_view, since the data comes from either string literals, or pbzero::DebugAnnotation which outlives this.

              Additionally add a comment on constructor to mention the data is expected to oulive this class.

              Myungsub Kim

              Good catch, this works

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Bruce Dawson
              • Chris Davis
              • Etienne Pierre-Doray
              • Joe Laughlin
              • Todd Reifsteck
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Review
              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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
              Gerrit-Change-Number: 5631658
              Gerrit-PatchSet: 20
              Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
              Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
              Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
              Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
              Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
              Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
              Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
              Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
              Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
              Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
              Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
              Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
              Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
              Gerrit-Comment-Date: Fri, 21 Jun 2024 19:58:35 +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 21, 2024, 4:44:35 PM (10 days ago) Jun 21
              to Myungsub Kim, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
              Attention needed from Bruce Dawson, Chris Davis, Joe Laughlin, Myungsub Kim and Todd Reifsteck

              Etienne Pierre-Doray added 2 comments

              File base/trace_event/etw_interceptor_win.cc
              Line 69, Patchset 19: absl::variant<std::string, uint64_t, int64_t, bool, double> value_;
              Etienne Pierre-Doray . unresolved

              Could this be string_view? Considering pbzero::DebugAnnotation already has storage for the string and will outlive TlmFieldDebugAnnotation.

              Myungsub Kim

              If we can use std::string_view instead of std::string, it would been great as we don't have to copy but TlmField string has to be a null terminated string hence I couldn't use it as DebugAnnotation isn't null terminated.

              Etienne Pierre-Doray

              Ah I see.
              There is a size deliminted string TlgInCOUNTEDANSISTRING (found at https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/shared/TraceLoggingProvider.h)
              in_type_ = 23
              Could we add that as another TlmFieldWithConstants?

              File base/trace_event/trace_logging_minimal_win.h
              Line 349, Patchset 20 (Latest): absl::variant<const char*, std::string_view> name_;
              Etienne Pierre-Doray . unresolved

              The member can just be `std::string_view name_`
              And the constructors becomes

              ```
              explicit TlmFieldBase(const char* name) noexcept : name_(name, strlen(name)) {}
              ```

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Bruce Dawson
              • Chris Davis
              • Joe Laughlin
              • Myungsub Kim
              • Todd Reifsteck
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                Gerrit-Change-Number: 5631658
                Gerrit-PatchSet: 20
                Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
                Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                Gerrit-Comment-Date: Fri, 21 Jun 2024 20:44:23 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Chandranath Bhattacharyya (Gerrit)

                unread,
                Jun 21, 2024, 6:41:49 PM (10 days ago) Jun 21
                to Myungsub Kim, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                Chandranath Bhattacharyya added 1 comment

                File base/trace_event/trace_logging_minimal_win.h
                Line 349, Patchset 20 (Latest): absl::variant<const char*, std::string_view> name_;
                Etienne Pierre-Doray . unresolved

                The member can just be `std::string_view name_`
                And the constructors becomes

                ```
                explicit TlmFieldBase(const char* name) noexcept : name_(name, strlen(name)) {}
                ```

                Chandranath Bhattacharyya

                `string_view` already has a `(const char*)` constructor which does the `strlen` portion. So `name_(name)` should suffice.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Bruce Dawson
                • Chris Davis
                • Etienne Pierre-Doray
                • Joe Laughlin
                • Myungsub Kim
                • Todd Reifsteck
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                Gerrit-Change-Number: 5631658
                Gerrit-PatchSet: 20
                Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
                Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                Gerrit-Comment-Date: Fri, 21 Jun 2024 22:41:35 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Chandranath Bhattacharyya (Gerrit)

                unread,
                Jun 21, 2024, 6:53:33 PM (10 days ago) Jun 21
                to Myungsub Kim, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                Chandranath Bhattacharyya added 1 comment

                File base/trace_event/etw_interceptor_win.cc
                Line 174, Patchset 19: return provider_->EventEnd(metadata_, metadata_index_, &descriptors_[0],
                Etienne Pierre-Doray . unresolved

                Nit: we could clear provider_ here, and

                • CHECK_EQ(nullptr, provider_) in destructor to enforce EventEnd gets called
                • CHECK_NE(nullptr, provider_) at the beginning of EventEnd to enforce it's only called once.
                Myungsub Kim

                Added those checks and clear provider_ on EndEvent. Thanks.

                Chandranath Bhattacharyya
                The current iteration of `~MultiEtwPayloadHandler() { CHECK_EQ(nullptr, provider_); }` will start crashing in destructor if an early exit happened in the `EventEnd`.
                ```cpp
                ULONG EventEnd(const EVENT_DESCRIPTOR& event_descriptor) {
                if (!is_enabled_) {
                return 0;
                }
                ```
                Considering `void ETWInterceptor::Delegate::OnTrackEvent(` is returning `void`, can we store the `const EVENT_DESCRIPTOR& event_descriptor` as member variable do the `EventEnd` in the destructor?
                ```cpp
                MultiEtwPayloadHandler(TlmProvider* provider,
                std::string_view event_name,
                const EVENT_DESCRIPTOR& event_descriptor)
                : provider_(provider), event_descriptor_(event_descriptor) {
                is_enabled_ = provider_->IsEnabled(event_descriptor_);
                if (!is_enabled_) {
                return;
                }
                metadata_index_ = provider_->EventBegin(metadata_, event_name);
                }
                  // OTHER STUFF.
                ~MultiEtwPayloadHandler() { std::ignore = EventEnd(); }
                private:
                ULONG EventEnd() {
                if (!is_enabled_) {
                return 0;
                }
                CHECK_NE(nullptr, provider_);
                ULONG ret =

                provider_->EventEnd(metadata_, metadata_index_, &descriptors_[0],
                                            descriptors_index_, event_descriptor_);
                provider_ = nullptr;
                return ret;
                }

                // OTHER STUFF.
                EVENT_DESCRIPTOR event_descriptor_;
                ```
                Then we can just remove the call to:
                ```cpp
                etw_payload_handler.EventEnd(event_descriptor);
                ```
                Gerrit-Comment-Date: Fri, 21 Jun 2024 22:53:18 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Chandranath Bhattacharyya (Gerrit)

                unread,
                Jun 21, 2024, 11:30:36 PM (9 days ago) Jun 21
                to Myungsub Kim, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                Chandranath Bhattacharyya added 1 comment

                File base/trace_event/etw_interceptor_win.cc
                Etienne Pierre-Doray . unresolved

                Suggestion: I think we could leverage existing TlmField classes and avoid TlmFieldDebugAnnotation with a variant, by having a function that calls MultiEtwPayloadHandler::WriteField directly:

                ```
                void WriteDebugAnnotationTlmField(
                std::string_view name,
                perfetto::protos::pbzero::DebugAnnotation_Decoder& annotation,
                MultiEtwPayloadHandler& handler) {
                if (annotation.has_bool_value()) {
                handler.WriteField(TlmIntBoolField(name, annotation.bool_value()));
                } else (annotation.has_int_value()) {
                handler.WriteField(TlmInt64Field(name, annotation.int_value()));
                }
                ...
                else if (annotation.has_string_value()) {
                handler.WriteField(TlmMbcsStringField(name, annotation.string_value()));
                }
                ...
                }
                ```
                Myungsub Kim

                Good suggestion but we can't use std::string_view so we will need new class for it and couple more (pointer and boolean) those are not used anywhere else. Rather keep it under single class as TlmFieldDebugAnnotation.

                Chandranath Bhattacharyya

                To me it seems the approach of using temporary like: `handler.WriteField(TlmInt64Field(name, annotation.int_value()));` leads to a problem.

                The `FillEventDescriptor` is implemented in the following manner:

                ```cpp
                void TlmInt64Field::FillEventDescriptor(
                EVENT_DATA_DESCRIPTOR* descriptors) const noexcept {
                EventDataDescCreate(&descriptors[0], (void*)&value_, sizeof(value_));
                }
                ```
                So the object `TlmInt64Field` needs to be valid till `EventWrite` is called later, since the pointer to its member `value_` is being used there.

                Since the `EventWrite` is getting called outside of `WriteField`, when the temporary `TlmInt64Field` has already been destroyed, the access will happen after the destruction.

                Calling the `EventWrite` within `WriteField` will lead to multiple events getting fired.

                Seems to me that the following function was deleted in order to ensure that this temporary object case leads to compilation error:
                ```cpp
                // Ensures that this function cannot be called with temporary objects.
                template <EtwFieldWithDataDescType T>
                void WriteField(const T&& value) = delete;
                ```
                Gerrit-Comment-Date: Sat, 22 Jun 2024 03:30:23 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Chandranath Bhattacharyya (Gerrit)

                unread,
                Jun 21, 2024, 11:36:30 PM (9 days ago) Jun 21
                to Myungsub Kim, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                Chandranath Bhattacharyya added 1 comment

                File base/trace_event/etw_interceptor_win.cc
                Line 204, Patchset 20 (Latest): uint8_t descriptors_index_ = 2;
                absl::InlinedVector<EVENT_DATA_DESCRIPTOR, 6> descriptors_{2};
                Chandranath Bhattacharyya . unresolved
                nit: Can consider using a named constant to express what `6` and `2` means:
                ```cpp
                static constexpr int kMaxPossibleDescriptors = 6;
                static constexpr int kMinPossibleDescriptors = 2;
                uint8_t descriptors_index_ = kMinPossibleDescriptors;
                absl::InlinedVector<EVENT_DATA_DESCRIPTOR, kMaxPossibleDescriptors>
                descriptors_{kMinPossibleDescriptors};
                ```
                Gerrit-Comment-Date: Sat, 22 Jun 2024 03:36:16 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Chandranath Bhattacharyya (Gerrit)

                unread,
                Jun 21, 2024, 11:37:46 PM (9 days ago) Jun 21
                to Myungsub Kim, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                Chandranath Bhattacharyya added 1 comment

                File base/trace_event/etw_interceptor_win.cc
                Line 311, Patchset 20 (Latest): absl::InlinedVector<TlmFieldDebugAnnotation, 2> debug__fields;
                Chandranath Bhattacharyya . unresolved

                Consider changing to single underscore: `debug_fields`.

                Gerrit-Comment-Date: Sat, 22 Jun 2024 03:37:32 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Chandranath Bhattacharyya (Gerrit)

                unread,
                Jun 21, 2024, 11:39:43 PM (9 days ago) Jun 21
                to Myungsub Kim, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                Chandranath Bhattacharyya added 1 comment

                File base/trace_event/etw_interceptor_win.cc
                Line 309, Patchset 20 (Latest): // Add debug annotations.
                // There cannot be more that 2 debug annotations.

                absl::InlinedVector<TlmFieldDebugAnnotation, 2> debug__fields;
                Chandranath Bhattacharyya . unresolved
                nit: Can consider using a named constant to explain what `2` means:
                ```cpp
                // Add debug annotations.
                static constexpr int kMaxDebugAnnotations = 2;
                absl::InlinedVector<TlmFieldDebugAnnotation, kMaxDebugAnnotations> debug__fields;
                ```
                Gerrit-Comment-Date: Sat, 22 Jun 2024 03:39:30 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Myungsub Kim (Gerrit)

                unread,
                Jun 22, 2024, 8:15:59 PM (9 days ago) Jun 22
                to Chandranath Bhattacharyya, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

                Myungsub Kim added 8 comments

                Patchset-level comments
                File-level comment, Patchset 21 (Latest):
                Myungsub Kim . resolved

                Updated per suggestions.

                File base/trace_event/etw_interceptor_win.cc
                Line 69, Patchset 19: absl::variant<std::string, uint64_t, int64_t, bool, double> value_;
                Etienne Pierre-Doray . resolved

                Could this be string_view? Considering pbzero::DebugAnnotation already has storage for the string and will outlive TlmFieldDebugAnnotation.

                Myungsub Kim

                If we can use std::string_view instead of std::string, it would been great as we don't have to copy but TlmField string has to be a null terminated string hence I couldn't use it as DebugAnnotation isn't null terminated.

                Etienne Pierre-Doray

                Ah I see.
                There is a size deliminted string TlgInCOUNTEDANSISTRING (found at https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/shared/TraceLoggingProvider.h)
                in_type_ = 23
                Could we add that as another TlmFieldWithConstants?

                Myungsub Kim
                From that header file,

                TlgInCOUNTEDANSISTRING means "size-prefixed MBCS char string".
                - TlgInBINARY means "size-prefixed binary data".
                - TlgInBINARY, TlgInCOUNTEDSTRING, and TlgInCOUNTEDANSISTRING are encoded as
                a little-endian UINT16 byte-count (not a char-count) followed by the data.

                So new class needs a Value with byte-count and data, string_view needs to be copied. It needs a buffer to hold byte-count and data.

                Etienne Pierre-Doray . resolved
                Myungsub Kim

                Done

                Line 174, Patchset 19: return provider_->EventEnd(metadata_, metadata_index_, &descriptors_[0],
                Etienne Pierre-Doray . resolved
                Myungsub Kim

                Thanks. Updated per suggestions.

                Line 204, Patchset 20: uint8_t descriptors_index_ = 2;

                absl::InlinedVector<EVENT_DATA_DESCRIPTOR, 6> descriptors_{2};
                Chandranath Bhattacharyya . resolved
                nit: Can consider using a named constant to express what `6` and `2` means:
                ```cpp
                static constexpr int kMaxPossibleDescriptors = 6;
                static constexpr int kMinPossibleDescriptors = 2;
                uint8_t descriptors_index_ = kMinPossibleDescriptors;
                absl::InlinedVector<EVENT_DATA_DESCRIPTOR, kMaxPossibleDescriptors>
                descriptors_{kMinPossibleDescriptors};
                ```
                Myungsub Kim

                Replace with consts.

                Line 309, Patchset 20: // Add debug annotations.

                // There cannot be more that 2 debug annotations.
                absl::InlinedVector<TlmFieldDebugAnnotation, 2> debug__fields;
                Chandranath Bhattacharyya . resolved
                nit: Can consider using a named constant to explain what `2` means:
                ```cpp
                // Add debug annotations.
                static constexpr int kMaxDebugAnnotations = 2;
                absl::InlinedVector<TlmFieldDebugAnnotation, kMaxDebugAnnotations> debug__fields;
                ```
                Myungsub Kim

                Fixed as suggested.

                Line 311, Patchset 20: absl::InlinedVector<TlmFieldDebugAnnotation, 2> debug__fields;
                Chandranath Bhattacharyya . resolved

                Consider changing to single underscore: `debug_fields`.

                Myungsub Kim

                Done

                File base/trace_event/trace_logging_minimal_win.h
                Line 349, Patchset 20: absl::variant<const char*, std::string_view> name_;
                Etienne Pierre-Doray . resolved

                The member can just be `std::string_view name_`
                And the constructors becomes

                ```
                explicit TlmFieldBase(const char* name) noexcept : name_(name, strlen(name)) {}
                ```

                Chandranath Bhattacharyya

                `string_view` already has a `(const char*)` constructor which does the `strlen` portion. So `name_(name)` should suffice.

                Myungsub Kim

                Done

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Bruce Dawson
                • Chandranath Bhattacharyya
                • Chris Davis
                • Etienne Pierre-Doray
                • Joe Laughlin
                • Todd Reifsteck
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                Gerrit-Change-Number: 5631658
                Gerrit-PatchSet: 21
                Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
                Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                Gerrit-Attention: Chandranath Bhattacharyya <cbha...@gmail.com>
                Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                Gerrit-Comment-Date: Sun, 23 Jun 2024 00:15:43 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Myungsub Kim <ms...@microsoft.com>
                Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
                Comment-In-Reply-To: Chandranath Bhattacharyya <cbha...@gmail.com>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Etienne Pierre-Doray (Gerrit)

                unread,
                Jun 25, 2024, 10:19:02 AM (6 days ago) Jun 25
                to Myungsub Kim, Chandranath Bhattacharyya, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                Etienne Pierre-Doray added 1 comment

                File base/trace_event/etw_interceptor_win.cc
                Line 69, Patchset 19: absl::variant<std::string, uint64_t, int64_t, bool, double> value_;
                Etienne Pierre-Doray . unresolved

                Could this be string_view? Considering pbzero::DebugAnnotation already has storage for the string and will outlive TlmFieldDebugAnnotation.

                Myungsub Kim

                If we can use std::string_view instead of std::string, it would been great as we don't have to copy but TlmField string has to be a null terminated string hence I couldn't use it as DebugAnnotation isn't null terminated.

                Etienne Pierre-Doray

                Ah I see.
                There is a size deliminted string TlgInCOUNTEDANSISTRING (found at https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/shared/TraceLoggingProvider.h)
                in_type_ = 23
                Could we add that as another TlmFieldWithConstants?

                Myungsub Kim
                From that header file,

                TlgInCOUNTEDANSISTRING means "size-prefixed MBCS char string".
                - TlgInBINARY means "size-prefixed binary data".
                - TlgInBINARY, TlgInCOUNTEDSTRING, and TlgInCOUNTEDANSISTRING are encoded as
                a little-endian UINT16 byte-count (not a char-count) followed by the data.

                So new class needs a Value with byte-count and data, string_view needs to be copied. It needs a buffer to hold byte-count and data.

                Etienne Pierre-Doray

                Reading the implementation of TraceLoggingAnsiString(), I think we can use TlgInCOUNTEDANSISTRING. The 'prefixed' size can be emitted as a distinct call to EventDataDescCreate (with a different address in memory):

                https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/shared/TraceLoggingProvider.h#L2700

                Something like this:

                ```
                // Class that represents an event field containing MBCS data
                class BASE_EXPORT TlmMbcsCountedStringField
                : public TlmFieldWithConstants<2, 23> // 2 data descriptor, Type =
                // TlgInCOUNTEDANSISTRING
                {
                public:
                // value is MBCS string (assumed to be in system's default code
                // page).
                TlmMbcsCountedStringField(const char* name, string_view value) noexcept
                : TlmFieldWithConstants(name),
                value_(value.data()),
                size_(value.size()) {}
                  string_view Value() const noexcept;
                  void FillEventDescriptor(EVENT_DATA_DESCRIPTOR* descriptors) const noexcept {
                EventDataDescCreate(&descriptors[0], &size_, 2);
                EventDataDescCreate(&descriptors[1], value_, value_.size());
                }
                 private:
                const char* value_;
                uint16_t size_;
                };
                ```
                Open in Gerrit

                Related details

                Attention is currently required from:
                • Bruce Dawson
                • Chandranath Bhattacharyya
                • Chris Davis
                • Joe Laughlin
                • Myungsub Kim
                • Todd Reifsteck
                Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                  Gerrit-Change-Number: 5631658
                  Gerrit-PatchSet: 21
                  Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                  Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                  Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                  Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                  Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                  Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                  Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                  Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                  Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                  Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                  Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
                  Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                  Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                  Gerrit-Attention: Chandranath Bhattacharyya <cbha...@gmail.com>
                  Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                  Gerrit-Comment-Date: Tue, 25 Jun 2024 14:18:43 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Myungsub Kim (Gerrit)

                  unread,
                  Jun 25, 2024, 11:35:08 AM (6 days ago) Jun 25
                  to Chandranath Bhattacharyya, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                  Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

                  Myungsub Kim added 1 comment

                  File base/trace_event/etw_interceptor_win.cc
                  Myungsub Kim

                  Hey, that's a good idea of using two descriptors approach, that is going to work for std::string_view. However, we still need to address other data types as they are also writing only their address so unless we have those data saved somewhere until EventEnd() is called, they will be lost. So, I can't separate them into individual classes, but I might change std::string to std::string_view with the existing code. Will that be Ok with you?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Bruce Dawson
                  • Chandranath Bhattacharyya
                  • Chris Davis
                  • Etienne Pierre-Doray
                  • Joe Laughlin
                  • Todd Reifsteck
                  Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
                  Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                  Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                  Gerrit-Attention: Chandranath Bhattacharyya <cbha...@gmail.com>
                  Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                  Gerrit-Comment-Date: Tue, 25 Jun 2024 15:34:52 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Etienne Pierre-Doray (Gerrit)

                  unread,
                  Jun 25, 2024, 11:41:33 AM (6 days ago) Jun 25
                  to Myungsub Kim, Chandranath Bhattacharyya, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                  Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                  Etienne Pierre-Doray added 1 comment

                  File base/trace_event/etw_interceptor_win.cc
                  Etienne Pierre-Doray

                  Ah right, you'd still need a container for all the fields.
                  At least we can avoid copying into a std::string doing this, sounds good!

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Bruce Dawson
                  • Chandranath Bhattacharyya
                  • Chris Davis
                  • Joe Laughlin
                  • Myungsub Kim
                  • Todd Reifsteck
                  Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
                  Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                  Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                  Gerrit-Attention: Chandranath Bhattacharyya <cbha...@gmail.com>
                  Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                  Gerrit-Comment-Date: Tue, 25 Jun 2024 15:41:19 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Myungsub Kim (Gerrit)

                  unread,
                  Jun 25, 2024, 12:27:18 PM (6 days ago) Jun 25
                  to Chandranath Bhattacharyya, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                  Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                  Myungsub Kim added 1 comment

                  File base/trace_event/etw_interceptor_win.cc
                  Line 69, Patchset 19: absl::variant<std::string, uint64_t, int64_t, bool, double> value_;
                  Etienne Pierre-Doray . resolved
                  Myungsub Kim

                  Just tried out with two descriptors but it did not work, etw event created with this method is erroring out on Windows side. I need to figure out. If it's okay, I'd like to check in the current iteration and take more time to figure it out.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Bruce Dawson
                  • Chandranath Bhattacharyya
                  • Chris Davis
                  • Joe Laughlin
                  • Myungsub Kim
                  • Todd Reifsteck
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Review
                  Gerrit-Comment-Date: Tue, 25 Jun 2024 16:27:00 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Myungsub Kim (Gerrit)

                  unread,
                  Jun 25, 2024, 3:47:17 PM (6 days ago) Jun 25
                  to Chandranath Bhattacharyya, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                  Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck
                  File base/trace_event/etw_interceptor_win.cc
                  Myungsub Kim

                  I looked little more, it turns out we can't use 2 descriptors idea. When you have 2, you are supposed to give out two data points, So it will not make a string counnted one. You are making two different data points instead of combined one.

                  Each data in the descriptor is a pointer to copy the data from. So it will not be the desired data we want. (string length + string),

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Bruce Dawson
                  • Chandranath Bhattacharyya
                  • Chris Davis
                  • Etienne Pierre-Doray
                  • Joe Laughlin
                  • Todd Reifsteck
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Review
                  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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                  Gerrit-Change-Number: 5631658
                  Gerrit-PatchSet: 21
                  Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                  Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                  Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                  Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                  Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                  Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                  Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                  Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                  Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                  Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                  Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
                  Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                  Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                  Gerrit-Attention: Chandranath Bhattacharyya <cbha...@gmail.com>
                  Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                  Gerrit-Comment-Date: Tue, 25 Jun 2024 19:47:02 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Chandranath Bhattacharyya (Gerrit)

                  unread,
                  Jun 26, 2024, 3:32:01 PM (5 days ago) Jun 26
                  to Myungsub Kim, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                  Attention needed from Bruce Dawson, Chris Davis, Etienne Pierre-Doray, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                  Chandranath Bhattacharyya added 1 comment

                  File base/trace_event/etw_interceptor_win.cc

                  if (!is_enabled_) {
                  return 0;
                  }
                  CHECK_NE(nullptr, provider_);
                  ULONG ret =
                  provider_->EventEnd(metadata_, metadata_index_, &descriptors_[0],
                  descriptors_index_, event_descriptor_);
                  provider_ = nullptr;
                  return ret;
                  }
                  Chandranath Bhattacharyya . unresolved

                  It will be good to move this function to private.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Bruce Dawson
                  • Chris Davis
                  • Etienne Pierre-Doray
                  • Joe Laughlin
                  • Myungsub Kim
                  • Todd Reifsteck
                  Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Review
                    • requirement is not satisfiedNo-Unresolved-Comments
                    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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                    Gerrit-Change-Number: 5631658
                    Gerrit-PatchSet: 21
                    Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                    Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                    Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                    Gerrit-Comment-Date: Wed, 26 Jun 2024 19:31:48 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Myungsub Kim (Gerrit)

                    unread,
                    Jun 26, 2024, 4:00:28 PM (5 days ago) Jun 26
                    to Chandranath Bhattacharyya, Eric Seckler, Etienne Pierre-Doray, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                    Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Etienne Pierre-Doray, Joe Laughlin and Todd Reifsteck

                    Myungsub Kim added 1 comment

                    File base/trace_event/etw_interceptor_win.cc
                    Line 185, Patchset 21: ULONG EventEnd() {

                    if (!is_enabled_) {
                    return 0;
                    }
                    CHECK_NE(nullptr, provider_);
                    ULONG ret =
                    provider_->EventEnd(metadata_, metadata_index_, &descriptors_[0],
                    descriptors_index_, event_descriptor_);
                    provider_ = nullptr;
                    return ret;
                    }
                    Chandranath Bhattacharyya . resolved

                    It will be good to move this function to private.

                    Myungsub Kim

                    Move to private and also removed the DCHECK and cleaning _provider as it's no longer accessible,

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Bruce Dawson
                    • Chandranath Bhattacharyya
                    • Chris Davis
                    • Etienne Pierre-Doray
                    • Joe Laughlin
                    • Todd Reifsteck
                    Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Review
                    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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                    Gerrit-Change-Number: 5631658
                    Gerrit-PatchSet: 22
                    Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                    Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                    Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Attention: Chandranath Bhattacharyya <cbha...@gmail.com>
                    Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                    Gerrit-Comment-Date: Wed, 26 Jun 2024 20:00:13 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    Comment-In-Reply-To: Chandranath Bhattacharyya <cbha...@gmail.com>
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Etienne Pierre-Doray (Gerrit)

                    unread,
                    Jun 26, 2024, 5:52:20 PM (5 days ago) Jun 26
                    to Myungsub Kim, Chandranath Bhattacharyya, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                    Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Joe Laughlin, Myungsub Kim and Todd Reifsteck

                    Etienne Pierre-Doray voted and added 2 comments

                    Votes added by Etienne Pierre-Doray

                    Code-Review+1

                    2 comments

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

                    LGTM

                    File base/trace_event/etw_interceptor_win.cc
                    Etienne Pierre-Doray

                    What do you get as error? Make sure TlmFieldDebugAnnotation::data_desc_count_ == 2.
                    I'm ok with landing as-is and iterate in a follow-up.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Bruce Dawson
                    • Chandranath Bhattacharyya
                    • Chris Davis
                    • Joe Laughlin
                    • Myungsub Kim
                    • Todd Reifsteck
                    Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement satisfiedCode-Review
                    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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                    Gerrit-Change-Number: 5631658
                    Gerrit-PatchSet: 22
                    Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                    Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                    Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Attention: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Attention: Chandranath Bhattacharyya <cbha...@gmail.com>
                    Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                    Gerrit-Comment-Date: Wed, 26 Jun 2024 21:52:05 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes
                    satisfied_requirement
                    open
                    diffy

                    Myungsub Kim (Gerrit)

                    unread,
                    Jun 26, 2024, 6:00:24 PM (5 days ago) Jun 26
                    to Etienne Pierre-Doray, Chandranath Bhattacharyya, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                    Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Joe Laughlin and Todd Reifsteck

                    Myungsub Kim added 2 comments

                    Patchset-level comments
                    Myungsub Kim . resolved

                    Thanks for the sign off. Off to submit...

                    File base/trace_event/etw_interceptor_win.cc
                    Myungsub Kim

                    Thanks for the review and sign off, I set it as 2. The issue is that, the descriptor isn't the target destination. It holds pointers to the address of data. So the end result isn't as expected like we were hoping such as (size + string data). Instead, Windows fails to copy the string as the first word on that address isn't size of the string. The test app I used to listening etw events stop responding with that field data.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Bruce Dawson
                    • Chandranath Bhattacharyya
                    • Chris Davis
                    • Joe Laughlin
                    • Todd Reifsteck
                    Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement satisfiedCode-Review
                    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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                    Gerrit-Change-Number: 5631658
                    Gerrit-PatchSet: 22
                    Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                    Gerrit-CC: Todd Reifsteck <todd...@microsoft.com>
                    Gerrit-Attention: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Attention: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Attention: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Attention: Chandranath Bhattacharyya <cbha...@gmail.com>
                    Gerrit-Attention: Todd Reifsteck <todd...@microsoft.com>
                    Gerrit-Comment-Date: Wed, 26 Jun 2024 22:00:11 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    open
                    diffy

                    Myungsub Kim (Gerrit)

                    unread,
                    Jun 26, 2024, 6:00:30 PM (5 days ago) Jun 26
                    to Etienne Pierre-Doray, Chandranath Bhattacharyya, Eric Seckler, Bruce Dawson, Todd Reifsteck, Chromium LUCI CQ, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
                    Attention needed from Bruce Dawson, Chandranath Bhattacharyya, Chris Davis, Joe Laughlin and Todd Reifsteck

                    Myungsub Kim voted Commit-Queue+2

                    Commit-Queue+2
                    Gerrit-Comment-Date: Wed, 26 Jun 2024 22:00:17 +0000
                    Gerrit-HasComments: No
                    Gerrit-Has-Labels: Yes
                    satisfied_requirement
                    open
                    diffy

                    Chromium LUCI CQ (Gerrit)

                    unread,
                    Jun 26, 2024, 6:16:58 PM (5 days ago) Jun 26
                    to Myungsub Kim, Etienne Pierre-Doray, Chandranath Bhattacharyya, Eric Seckler, Bruce Dawson, Todd Reifsteck, Joe Laughlin, Chris Davis, chromium...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org

                    Chromium LUCI CQ submitted the change

                    Change information

                    Commit message:
                    etw payload support

                    This patch adds support to emit legacy trace arguments into ETW events
                    by converting these arguments into additional ETW fields.

                    Implementation:
                    TlmFieldBase class was renamed to TlmFieldWithConstants class and
                    new TlmFieldBase was added to handle various TlmField classes.

                    TlmFieldDebugAnnotation class was added to handle legacy trace macro payloads to convert
                    to etw field data.
                    This class will generate various etw data unlike other TlmFieldClass
                    that handles a specific data type.

                    Delegate for TrackEventStateTracker was modified to take SequenceState
                    to access debug annotation name from it.
                    This was done without modifying Perfetto SDK but perhaps we can change the SDK
                    to pass SequenceState directly to ETWInterceptor::Delegate::OnTrackEvent() instead.
                    Fixed: 347050839
                    Change-Id: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                    Reviewed-by: Eric Seckler <esec...@chromium.org>
                    Reviewed-by: Etienne Pierre-Doray <etie...@chromium.org>
                    Commit-Queue: Myungsub Kim <ms...@microsoft.com>
                    Cr-Commit-Position: refs/heads/main@{#1320058}
                    Files:
                    • M base/trace_event/etw_interceptor_win.cc
                    • M base/trace_event/trace_logging_minimal_win.cc
                    • M base/trace_event/trace_logging_minimal_win.h
                    Change size: L
                    Delta: 3 files changed, 331 insertions(+), 44 deletions(-)
                    Branch: refs/heads/main
                    Submit Requirements:
                    • requirement satisfiedCode-Review: +1 by Etienne Pierre-Doray, +1 by Eric Seckler
                    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: I430a10eb5b5a45ff179c30c775f5550b1915d7d5
                    Gerrit-Change-Number: 5631658
                    Gerrit-PatchSet: 23
                    Gerrit-Owner: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-Reviewer: Bruce Dawson <bruce...@chromium.org>
                    Gerrit-Reviewer: Chris Davis <chrd...@microsoft.com>
                    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                    Gerrit-Reviewer: Eric Seckler <esec...@chromium.org>
                    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
                    Gerrit-Reviewer: Joe Laughlin <jo...@microsoft.com>
                    Gerrit-Reviewer: Myungsub Kim <ms...@microsoft.com>
                    Gerrit-CC: Chandranath Bhattacharyya <cbha...@gmail.com>
                    open
                    diffy
                    satisfied_requirement
                    Reply all
                    Reply to author
                    Forward
                    0 new messages