Skip to content

Commit fc68ce9

Browse files
authored
Merge pull request microsoft#196 from microsoft/dev/willxie/d2m
Merge develop to master for 1.0.31 release
2 parents cf03575 + e81780e commit fc68ce9

File tree

13 files changed

+113
-196
lines changed

13 files changed

+113
-196
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Please format the changes as follows:
77
+ BugFixes:
88
+ Updates:
99

10+
# 1.0.31
11+
+ BugFixes:
12+
+ Avoid deadlock within ProxyLogging when terminating logging.
13+
+ Fixed CLRIE to correctly emit ldloca instead of ldloc.
14+
1015
# 1.0.30
1116
+ New:
1217
+ Add configuration for InstrumentationMethod loglevels

build/Version.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-->
1313
<SemanticVersionMajor>1</SemanticVersionMajor>
1414
<SemanticVersionMinor>0</SemanticVersionMinor>
15-
<SemanticVersionPatch>30</SemanticVersionPatch>
15+
<SemanticVersionPatch>31</SemanticVersionPatch>
1616

1717
<FileVersionMajor>15</FileVersionMajor>
1818
<FileVersionMinor>1</FileVersionMinor>
@@ -30,15 +30,15 @@
3030
-->
3131
<ProxyFileVersionMajor>$(SemanticVersionMajor)</ProxyFileVersionMajor>
3232
<ProxyFileVersionMinor>0</ProxyFileVersionMinor>
33-
<ProxyFileVersionPatch>1</ProxyFileVersionPatch>
33+
<ProxyFileVersionPatch>2</ProxyFileVersionPatch>
3434
<ProxyFileVersion>$(ProxyFileVersionMajor).$(ProxyFileVersionMinor).$(ProxyFileVersionPatch)</ProxyFileVersion>
3535

3636
<!--
3737
Date when Semantic Version was changed.
3838
Update for every public release.
3939
Format is YYYY-MM-DD
4040
-->
41-
<SemanticVersionDate>2019-11-13</SemanticVersionDate>
41+
<SemanticVersionDate>2020-01-08</SemanticVersionDate>
4242

4343
<!--
4444
Build version is used to distinguish internally built NuGet packages.

src/Common.Lib/EventLoggingBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ HRESULT CEventLoggingBase::TerminateEventSource()
141141
// Allow thread to drain the queue
142142
if (m_hEventQueueThread)
143143
{
144-
WaitForSingleObject(m_hEventQueueThread, INFINITE);
144+
WaitForSingleObject(m_hEventQueueThread, 15 * 1000 /* 15 second timeout */);
145145
}
146146

147147
// Block scope used to release critical section before end of method.

src/InstrumentationEngine.ProfilerProxy.Lib/EventLogger.cpp

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ using namespace ProfilerProxy;
99
CEventLogger::CEventLogger() :
1010
m_initEventSource([=]() { return InitializeEventSource(_T("Instrumentation Engine Profiler Proxy")); })
1111
{
12+
Initialize();
1213
}
1314

1415
CEventLogger::~CEventLogger()
@@ -32,6 +33,36 @@ void CEventLogger::FormatAndAppendToQueue(_In_ WORD wType, _In_ LPCWSTR wszMessa
3233
AppendToQueue(wType, wszLogEntry);
3334
}
3435

36+
void CEventLogger::LogMessage(_In_ const WCHAR* wszMessage, ...)
37+
{
38+
IfNotInitRet(m_initEventSource);
39+
40+
va_list argptr;
41+
va_start(argptr, wszMessage);
42+
LogMessage(wszMessage, argptr);
43+
va_end(argptr);
44+
}
45+
46+
void CEventLogger::LogWarning(_In_ const WCHAR* wszMessage, ...)
47+
{
48+
IfNotInitRet(m_initEventSource);
49+
50+
va_list argptr;
51+
va_start(argptr, wszMessage);
52+
LogWarning(wszMessage, argptr);
53+
va_end(argptr);
54+
}
55+
56+
void CEventLogger::LogError(_In_ const WCHAR* wszError, ...)
57+
{
58+
IfNotInitRet(m_initEventSource);
59+
60+
va_list argptr;
61+
va_start(argptr, wszError);
62+
LogError(wszError, argptr);
63+
va_end(argptr);
64+
}
65+
3566
void CEventLogger::LogMessage(_In_ LPCWSTR wszMessage, _In_ va_list argptr)
3667
{
3768
FormatAndAppendToQueue(EVENTLOG_INFORMATION_TYPE, wszMessage, argptr);
@@ -61,8 +92,12 @@ void CEventLogger::LogError(_In_ LPCWSTR wszError, _In_ va_list argptr)
6192

6293
HRESULT CEventLogger::Shutdown()
6394
{
64-
HRESULT hr = TerminateEventSource();
65-
m_initEventSource.Reset();
95+
HRESULT hr = S_OK;
96+
if (m_initEventSource.IsSuccessful())
97+
{
98+
hr = TerminateEventSource();
99+
m_initEventSource.Reset();
100+
}
66101

67102
return hr;
68103
}

src/InstrumentationEngine.ProfilerProxy.Lib/EventLogger.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ namespace ProfilerProxy
2424

2525
HRESULT Initialize();
2626

27+
void LogMessage(_In_ const WCHAR* szMessage, ...);
28+
void LogWarning(_In_ const WCHAR* szMessage, ...);
29+
void LogError(_In_ const WCHAR* szError, ...);
30+
2731
void LogMessage(_In_ LPCWSTR wszMessage, _In_ va_list argptr);
2832
void LogWarning(_In_ LPCWSTR wszWarning, _In_ va_list argptr);
2933
void LogError(_In_ LPCWSTR wszError, _In_ va_list argptr);

src/InstrumentationEngine.ProfilerProxy.Lib/stdafx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#ifndef IfFailRet_Proxy
77
#define IfFailRet_Proxy(EXPR) \
8-
do { if (FAILED(hr = (EXPR))) { CProxyLogging::LogError(_T("IfFailRet(") _T(#EXPR) _T(") failed in function ") __FUNCTIONT__); return hr; } } while (false)
8+
do { if (FAILED(hr = (EXPR))) { eventLogger.LogError(_T("IfFailRet(") _T(#EXPR) _T(") failed in function ") __FUNCTIONT__); return hr; } } while (false)
99
#endif
1010

1111
#ifndef IfFailRetErrno_Proxy

src/InstrumentationEngine.ProfilerProxy/InstrumentationEngine.ProfilerProxy.vcxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,11 @@
111111
</ItemDefinitionGroup>
112112
<ItemGroup>
113113
<ClCompile Include="dllmain.cpp" />
114-
<ClCompile Include="ProxyLogging.cpp" />
115114
<ClCompile Include="stdafx.cpp">
116115
<PrecompiledHeader>Create</PrecompiledHeader>
117116
</ClCompile>
118117
</ItemGroup>
119118
<ItemGroup>
120-
<ClInclude Include="ProxyLogging.h" />
121119
<ClInclude Include="stdafx.h" />
122120
</ItemGroup>
123121
<ItemGroup>

src/InstrumentationEngine.ProfilerProxy/ProxyLogging.cpp

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/InstrumentationEngine.ProfilerProxy/ProxyLogging.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)