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

Record StackTraceHiddenAttribute when collecting stacks and exceptions #7493

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

Conversation

schmittjoseph
Copy link
Member

@schmittjoseph schmittjoseph commented Oct 10, 2024

Summary

When collecting /stacks and /exceptions data, also record where the StackTraceHiddenAttribute is present. To keep PRs small and easier to review, this PR does not change the API surface, it is only focused on collecting this information and sending it to dotnet-monitor over event source. A follow up PR will expose this new information and add functional tests.

Note that we use a UINT32 to transmit this information over event source instead of a boolean. This is due to a bug in event source regarding the size of bools. A separate PR will be made to fix an existing instance of this elsewhere in dotnet-monitor.

Release Notes Entry

@schmittjoseph schmittjoseph changed the title [DO NOT REVIEW] Record StackTraceHiddenAttribute when collecting stacks and exceptions Record StackTraceHiddenAttribute when collecting stacks and exceptions Oct 10, 2024
@schmittjoseph schmittjoseph marked this pull request as ready for review October 10, 2024 20:45
@schmittjoseph schmittjoseph requested a review from a team as a code owner October 10, 2024 20:45
@@ -46,6 +46,7 @@ HRESULT StacksEventProvider::WriteClassData(ClassID classId, const ClassData& cl
static_cast<UINT64>(classData.GetModuleId()),
classData.GetToken(),
static_cast<UINT32>(classData.GetFlags()),
classData.GetStackTraceHidden(),
Copy link
Member Author

Choose a reason for hiding this comment

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

note: this relies on an implicit cast from bool to UINT32. If folks would prefer that this become an explicit static_cast<UINT32> let me know.

{
return Convert.ToBoolean(GetPayload<uint>(traceEvent, index));
}

public static T GetPayload<T>(this TraceEvent traceEvent, int index)
{
return (T)traceEvent.PayloadValue(index);
Copy link
Member Author

@schmittjoseph schmittjoseph Oct 10, 2024

Choose a reason for hiding this comment

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

note: I plan on updating this with a DEBUG check to prevent us accidentally calling it with <bool>. This will happen in a separate PR since we have an instance of using GetPayload<bool> elsewhere in dotnet-monitor that needs to get fixed first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant