Skip to content

Intern Stack Definitions Once Per Usage Instead of Once Per Definition - #1136

Merged
Brian Robbins (brianrob) merged 1 commit into
microsoft:masterfrom
brianrob:stack_interning
Mar 23, 2020
Merged

Brian Robbins (brianrob) merged 1 commit into
microsoft:masterfrom
brianrob:stack_interning

Conversation

@brianrob

Copy link
Copy Markdown
Member

ETW stacks are logged as a set of separate events which are then correlated with the data events that they correspond to. Construction of stacks and correlation with their data events occurs during TraceLog creation. There are "stack definition" events, and then references to the stack definitions. Stack references are 1:1 with their data events. Stack definitions are 1:N where N is the number of references to the stack. It is also important to know that stack definitions are not specific to a thread and do not contain the thread information as part of the stack. This is done during construction of the TraceLog.

Prior to this change, the data structure that holds stack references assumed that all usages of a single reference came from the same thread. It appears this may have been true at one point, but is no longer true. To solve this problem, this change interns the stack for each entry in the list, which allows us to ensure that the stack frame that represents the thread is correct on each intern operation, and is then property correlated with its data event.

@brianrob

Copy link
Copy Markdown
Member Author

cc: Maoni Stephens (@Maoni0), thanks for reporting this!

@Maoni0

Copy link
Copy Markdown
Contributor

thanks so much for fixing this, Brian Robbins (@brianrob)!

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