Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TraceParserGen to generate meaningful parser for WPF #1406

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

oatkins
Copy link

@oatkins oatkins commented Apr 6, 2021

This attempts to resolve #1351 and supports creating a parser for the Microsoft-Windows-WPF provider from the manifest at C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\wpf-etw.man.

See also #554.

Addresses various issues with the generated provider:

  • Enum should not be normalized it if's already PascalCase, so the normalizing logic is skipped if no "_" is present in a field name.
  • RegisterTemplate() seems not to exist; source.RegisterEventTemplate is apparently what was intended.
  • Task GUID constants were previously referenced but not generated.
  • Template class names were incorrectly referenced.

@ghost
Copy link

ghost commented Apr 6, 2021

CLA assistant check
All CLA requirements met.

@oatkins oatkins marked this pull request as ready for review April 6, 2021 21:59
@oatkins
Copy link
Author

oatkins commented Apr 8, 2021

See also #950 - need to make sure the problems resolved there are not reintroduced here.

@@ -276,8 +304,10 @@ private void GenerateTemplateDefs(TextWriter output)
state = ", state";
}

output.WriteLine(" return new {0}(action, {1}, {2}, \"{3}\", Guid.Empty, {4}, \"{5}\", ProviderGuid, ProviderName {6});",
templateClassName, evnt.Id, evnt.Task, TraceParserGen.ToCSharpName(evnt.TaskName), evnt.Opcode, TraceParserGen.ToCSharpName(evnt.OpcodeName), state);
var taskGuid = string.IsNullOrEmpty(evnt.TaskName) ? "Guid.Empty" : ToCSharpName(evnt.TaskName) + "TaskGuid";
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it check m_taskGuids?
If there is no "eventGUID" attributes in parsed manifest, I think it should return Guid.Empty.

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.

TraceParserGen: xxxTaskGuid not defined
2 participants