Skip to content

Add --session-name flag to record-trace#296

Merged
beaubelgrave merged 1 commit into
microsoft:mainfrom
utpilla:utpilla/Add-session-name-flag-to-record-trace
Jun 17, 2026
Merged

Add --session-name flag to record-trace#296
beaubelgrave merged 1 commit into
microsoft:mainfrom
utpilla:utpilla/Add-session-name-flag-to-record-trace

Conversation

@utpilla

@utpilla utpilla commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Addresses #289 (comment)

Changes

Adds an optional --session-name <name> flag to record-trace that sets the ETW/perf session name used for recording. Defaults to "record-trace" when omitted, preserving current behavior.

Motivation

record-trace previously hardcoded the session name "record-trace". On Windows, after the GUID-from-name fix (#289), the session name determines the session's identity:

  • A fixed name (the default) means one record-trace ETW session per machine at a time, but a new run automatically reclaims a session left behind by a crashed one.
  • A unique name (e.g. per-PID) lets multiple record-trace ETW sessions run side by side.

On Linux the name has no such constraint. perf sessions are scoped per PID/CPU, so concurrent runs already work regardless of name. The flag is primarily a Windows concurrency control and reads as a harmless session label on Linux.

This flag lets users opt into concurrent recording on Windows when they need it, while keeping the safe singleton + crash-recovery default for the common case.

@beaubelgrave beaubelgrave left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@beaubelgrave beaubelgrave merged commit 598ac71 into microsoft:main Jun 17, 2026
15 checks passed
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