Skip to content

Add process_start_key() to read ProcessStartKey from extended data#271

Merged
kylereedmsft merged 4 commits intomasterfrom
users/suvenka/processStartKey
Mar 9, 2026
Merged

Add process_start_key() to read ProcessStartKey from extended data#271
kylereedmsft merged 4 commits intomasterfrom
users/suvenka/processStartKey

Conversation

@vmurthysuhas
Copy link
Copy Markdown
Contributor

Add support for reading EVENT_HEADER_EXT_TYPE_PROCESS_START_KEY from ETW extended data items, enabled via EVENT_ENABLE_PROPERTY_PROCESS_START_KEY. The ProcessStartKey uniquely identifies a process instance across a boot session (unlike PID which can be recycled).

Changes:

  • Native C++: schema::process_start_key() in schema.hpp
  • Managed .NET: TryGetProcessStartKey() on IEventRecordMetadata/EventRecordMetadata
  • Test support: extended_data_builder::add_process_start_key()
  • New example: UserTrace008_ProcessStartKey.cs

Add support for reading EVENT_HEADER_EXT_TYPE_PROCESS_START_KEY from
ETW extended data items, enabled via EVENT_ENABLE_PROPERTY_PROCESS_START_KEY.
The ProcessStartKey uniquely identifies a process instance across a boot
session (unlike PID which can be recycled).

Changes:
- Native C++: schema::process_start_key() in schema.hpp
- Managed .NET: TryGetProcessStartKey() on IEventRecordMetadata/EventRecordMetadata
- Test support: extended_data_builder::add_process_start_key()
- New example: UserTrace008_ProcessStartKey.cs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vmurthysuhas vmurthysuhas force-pushed the users/suvenka/processStartKey branch from b282cf5 to 73060aa Compare March 7, 2026 00:32
The CI runner has .NET SDK 10.0.x pre-installed, which fails to resolve
the .NET 8.0 AppHost packs needed by the NetCore project. Pin the SDK
to the 8.0.x feature band using global.json with rollForward=latestFeature,
and add the setup-dotnet action to install the matching SDK on CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vmurthysuhas vmurthysuhas force-pushed the users/suvenka/processStartKey branch from 73060aa to a16f78a Compare March 7, 2026 00:36
Copy link
Copy Markdown
Member

@kylereedmsft kylereedmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some notes. Need to be extra careful with pointers.

- Add null check on DataPtr before dereference in schema.hpp and
  EventRecordMetadata.hpp
- Change add_process_start_key to take const ULONG64& so caller
  owns the lifetime of the pointed-to object

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kylereedmsft
kylereedmsft previously approved these changes Mar 7, 2026
Copy link
Copy Markdown
Member

@kylereedmsft kylereedmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add some unit tests. Approving this.

- Native tests: build/pack, raw value roundtrip, schema read, not-present case
- Managed tests: TryGetProcessStartKey roundtrip, not-present case
- Add AddProcessStartKey to RecordBuilder and record_builder for test support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kylereedmsft kylereedmsft merged commit c40eee4 into master Mar 9, 2026
6 checks passed
@kylereedmsft kylereedmsft deleted the users/suvenka/processStartKey branch March 9, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants