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

[Profiler] Properly initialize appDomainId #6630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,23 +232,21 @@ void AllocationsProvider::OnAllocation(std::chrono::nanoseconds timestamp,

// TODO: we need to check that threads are not jumping from one AppDomain to the other too frequently
// because we might be receiving this event 1 second after it has been emitted
// It this is the case, we should simply set the AppDomainId to -1 all the time.
// It this is the case, we should simply set the AppDomainId to 0 all the time.
AppDomainID appDomainId;
if (SUCCEEDED(_pCorProfilerInfo->GetThreadAppDomain(threadInfo->GetClrThreadId(), &appDomainId)))
{
rawSample.AppDomainId = appDomainId;
}
else
{
rawSample.AppDomainId = -1;
rawSample.AppDomainId = 0;
}
}
else // create a fake IThreadInfo that wraps the OS thread id (no name, no profiler thread id)
{
rawSample.ThreadInfo = std::make_shared<FrameworkThreadInfo>(threadId);

// TODO: do we need to set to -1?
// rawSample.AppDomainId = -1;
rawSample.AppDomainId = 0;
}

// rawSample.AllocationSize = objectSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,13 @@ void ContentionProvider::AddContentionSample(std::chrono::nanoseconds timestamp,
}
else
{
rawSample.AppDomainId = -1;
rawSample.AppDomainId = 0;
}
}
else // create a fake IThreadInfo that wraps the OS thread id (no name, no profiler thread id)
{
rawSample.ThreadInfo = std::make_shared<FrameworkThreadInfo>(threadId);

// TODO: do we need to set to -1?
//rawSample.AppDomainId = -1;
rawSample.AppDomainId = 0;
}
}

Expand Down
Loading