-
Notifications
You must be signed in to change notification settings - Fork 2
! for some reason some template names are not found #54
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
base: master
Are you sure you want to change the base?
Conversation
|
Hi Mihai, thank you for another fix! I guess the PR can be approved, but I'd like to have some more info on the issue before merging it.
Thanks 👍 |
|
Hi @MetanoKid As far as i'm debugging this, in this function: there are plenty instantiations that have PrimaryTemplateSymbolKey and SpecializationSymbolKey 0 (zero) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Mihai!
I'm afraid GitHub doesn't notify when a comment gets updated and I didn't come back to you sooner. I really apologize.
In the meantime, I tried compiling Unreal Engine from source (because it's a huge project with a lot of templates) in Visual Studio 16.5.2 and 16.7.3, but I wasn't able to reproduce the issue you mention.
However, I tried forcing it by stopping vcperf in the middle of a compilation instead of waiting for it to finish, and that helped me reproduce it.
Long story short, TemplateInstantiation activities are recorded as templates get compiled, but they contain an identifier for that template (PrimaryTemplateSymbolKey and SpecializationSymbolKey, as reported by the SDK) and not its string representation. To get that info, we must wait for SymbolName events to happen.
Indeed, if these SymbolName events don't get emitted, we'll have these entries in the timeline report, which is what I expected when I asked you about it:

Because the SDK didn't emit the expected SymbolName events, we can't really know which template they refer to.
With that in mind, please check my suggestion in the inline comment and tell me what you think about it.
Thank you for your time and interest once again 🙂
| auto itSpecializationTemplateName = m_symbolNames.find(pair.second.Specialization); | ||
| assert(itSpecializationTemplateName != m_symbolNames.end()); | ||
|
|
||
| if (itSpecializationTemplateName != m_symbolNames.end()) | ||
| { | ||
| templateName = itSpecializationTemplateName->second; | ||
| } | ||
| else | ||
| { | ||
| templateName = "Unknown"; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about not registering the Unknown template name at all and switching to this?
auto itSpecializationTemplateName = m_symbolNames.find(pair.second.Specialization);
if (itSpecializationTemplateName == m_symbolNames.end())
{
// a TemplateInstantiation activity has been recorded but its related SymbolName hasn't been emitted
// we can't know which template it refers to, so we can only skip it
continue;
}
After all, it won't be correctly registered in the BuildTimeline.json report either.
And this way users won't have an entry listed Unknown with the accumulated time of (probably) unrelated templates.

Unfortunately is not easy to create a simple reproducible case.
It seems that SpecializationID is 0.
I will try to look more into this.