Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.
Merged
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
8 changes: 6 additions & 2 deletions ReleaseNotes.tmp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Version [[version]]
#274 Use thread based buffers for performance improvement (fix)
#283 Add visited class/method to summary entity (feature)
#307 add -version to args
#305 add corclr_profiler_path support
#303 support for test cases and theories during track by test
#295 exclude assembly by attribute (feature)
#288 report (to console) if can't ready body of method (diag)
#287 fix crash
#283 Add visited class/method to summary entity (feature)
#274 Use thread based buffers for performance improvement (fix)

Version 4.5.3723
#244 support ApplicationUnderTest.Launch to propagate required OPENCOVER environment variables (feature)
Expand Down
14 changes: 13 additions & 1 deletion main/OpenCover.Profiler/ProfilerCommunication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ void ProfilerCommunication::ThreadCreated(ThreadID threadID, DWORD osThreadID){
m_visitmap[osThreadID] = p;
}

MSG_SendVisitPoints_Request* ProfilerCommunication::GetVisitMapForOSThread(ULONG osThreadID){
try {
return m_visitmap[osThreadID];
}
catch (...){
auto p = new MSG_SendVisitPoints_Request();
::ZeroMemory(p, sizeof(MSG_SendVisitPoints_Request));
m_visitmap[osThreadID] = p;
}
return m_visitmap[osThreadID];
}

void ProfilerCommunication::ThreadDestroyed(ThreadID threadID){
ATL::CComCritSecLock<ATL::CComAutoCriticalSection> lock(m_critThreads);
ULONG osThreadId = m_threadmap[threadID];
Expand All @@ -128,7 +140,7 @@ void ProfilerCommunication::SendRemainingThreadBuffers(){
void ProfilerCommunication::AddVisitPointToThreadBuffer(ULONG uniqueId, MSG_IdType msgType)
{
DWORD osThreadId = ::GetCurrentThreadId();
auto pVisitPoints = m_visitmap[osThreadId];
auto pVisitPoints = GetVisitMapForOSThread(osThreadId);
pVisitPoints->points[pVisitPoints->count].UniqueId = (uniqueId | msgType);
if (++pVisitPoints->count == VP_BUFFER_SIZE)
{
Expand Down
2 changes: 2 additions & 0 deletions main/OpenCover.Profiler/ProfilerCommunication.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class ProfilerCommunication
std::unordered_map<ThreadID, ULONG> m_threadmap;
std::unordered_map<ULONG, MSG_SendVisitPoints_Request*> m_visitmap;

MSG_SendVisitPoints_Request* GetVisitMapForOSThread(ULONG osThread);

private:

class CommunicationException : std::exception
Expand Down