/// On any normal event log the event with activityTracker.CurrentActivityId
/// </summary>
internal class ActivityTracker
- {
+ {
/// <summary>
/// Called on work item begins. The activity name = providerName + activityName without 'Start' suffix.
var currentActivity = m_current.Value;
var fullActivityName = NormalizeActivityName(providerName, activityName, task);
-
+
var etwLog = TplEtwProvider.Log;
- if (etwLog.Debug)
+ if (etwLog.Debug)
{
etwLog.DebugFacilityMessage("OnStartEnter", fullActivityName);
etwLog.DebugFacilityMessage("OnStartEnterActivityState", ActivityInfo.LiveActivities(currentActivity));
// Remember the current ID so we can log it
activityId = newActivity.ActivityId;
- if (etwLog.Debug)
+ if (etwLog.Debug)
{
etwLog.DebugFacilityMessage("OnStartRetActivityState", ActivityInfo.LiveActivities(newActivity));
etwLog.DebugFacilityMessage1("OnStartRet", activityId.ToString(), relatedActivityId.ToString());
var fullActivityName = NormalizeActivityName(providerName, activityName, task);
var etwLog = TplEtwProvider.Log;
- if (etwLog.Debug)
+ if (etwLog.Debug)
{
etwLog.DebugFacilityMessage("OnStopEnter", fullActivityName);
etwLog.DebugFacilityMessage("OnStopEnterActivityState", ActivityInfo.LiveActivities(m_current.Value));
}
- for (; ;) // This is a retry loop.
+ for (; ; ) // This is a retry loop.
{
ActivityInfo currentActivity = m_current.Value;
ActivityInfo newCurrentActivity = null; // if we have seen any live activities (orphans), at he first one we have seen.
[System.Security.SecuritySafeCritical]
public void Enable()
{
- if (m_current == null)
+ if (m_current == null)
{
m_current = new AsyncLocal<ActivityInfo>(ActivityChanging);
}
}
-
+
/// <summary>
/// An activity tracker is a singleton, this is how you get the one and only instance.
/// </summary>
}
}
- public static string Path(ActivityInfo activityInfo)
+ public static string Path(ActivityInfo activityInfo)
{
if (activityInfo == null)
return ("");
return Path(activityInfo.m_creator) + "/" + activityInfo.m_uniqueId;
}
- public override string ToString()
+ public override string ToString()
{
string dead = "";
if (m_stopped != 0)
- dead = ",DEAD";
- return m_name + "(" + Path(this) + dead + ")";
+ dead = ",DEAD";
+ return m_name + "(" + Path(this) + dead + ")";
}
public static string LiveActivities(ActivityInfo list)
[System.Security.SecuritySafeCritical]
private unsafe void CreateActivityPathGuid(out Guid idRet, out int activityPathGuidOffset)
{
- fixed (Guid* outPtr = &idRet)
+ fixed (Guid* outPtr = &idRet)
{
int activityPathGuidOffsetStart = 0;
if (m_creator != null)
activityPathGuidOffsetStart = m_creator.m_activityPathGuidOffset;
idRet = m_creator.m_guid;
}
- else
+ else
{
// TODO FIXME - differentiate between AD inside PCL
int appDomainID = 0;
{
if (endPtr <= ptr + 2) // I need at least 2 bytes
return 13;
-
+
// Write out the prefix code nibble and the length nibble
- WriteNibble(ref ptr, endPtr, (uint) NumberListCodes.PrefixCode);
+ WriteNibble(ref ptr, endPtr, (uint)NumberListCodes.PrefixCode);
}
// The rest is the same for overflow and non-overflow case
WriteNibble(ref ptr, endPtr, (uint)NumberListCodes.MultiByte1 + (len - 1));
#endregion // CreateGuidForActivityPath
readonly internal string m_name; // The name used in the 'start' and 'stop' APIs to help match up
- readonly long m_uniqueId; // a small number that makes this activity unique among its siblings
+ readonly long m_uniqueId; // a small number that makes this activity unique among its siblings
internal readonly Guid m_guid; // Activity Guid, it is basically an encoding of the Path() (see CreateActivityPathGuid)
internal readonly int m_activityPathGuidOffset; // Keeps track of where in m_guid the causality path stops (used to generated child GUIDs)
internal readonly int m_level; // current depth of the Path() of the activity (used to keep recursion under control)
if (cur == null || prev.m_activityIdToRestore != cur.ActivityId)
{
EventSource.SetCurrentThreadActivityId(prev.m_activityIdToRestore);
- return;
+ return;
}
}
{
// We found a live activity (typically the first time), set it to that.
if (cur.m_stopped == 0)
- {
+ {
EventSource.SetCurrentThreadActivityId(cur.ActivityId);
return;
}
/// </summary>
private static void RemoveReferencesToListenerInEventSources(EventListener listenerToRemove)
{
+#if !ES_BUILD_STANDALONE
+ Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock));
+#endif
// Foreach existing EventSource in the appdomain
foreach (WeakReference eventSourceRef in s_EventSources)
{
EventSource_TaskCollision = Tasks {0} and {1} are defined with the same value ({2}).
EventSource_IllegalKeywordsValue = Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000).
EventSource_KeywordCollision = Keywords {0} and {1} are defined with the same value ({2}).
-EventSource_EventChannelOutOfRange = Channel {0} has a value of [1} which is outside the legal range (16-254).
+EventSource_EventChannelOutOfRange = Channel {0} has a value of {1} which is outside the legal range (16-254).
EventSource_ChannelTypeDoesNotMatchEventChannelValue = Channel {0} does not match event channel value {1}.
EventSource_MaxChannelExceeded = Attempt to define more than the maximum limit of 8 channels for a provider.
EventSource_DuplicateStringKey = Multiple definitions for string "{0}".
EventSource_IncorrentlyAuthoredTypeInfo = Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group
EventSource_NotSupportedCustomSerializedData = Enumerables of custom-serialized data are not supported
EventSource_StopsFollowStarts = An event with stop suffix must follow a corresponding event with a start suffix.
+EventSource_NoRelatedActivityId = EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId.
+EventSource_VarArgsParameterMismatch = The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly.
; ExecutionEngineException
ExecutionEngine_InvalidAttribute = Attribute cannot have multiple definitions.
}
#endif
- //****************************************************************************************
- //
-
- virtual IApplicationSecurityDescriptor* GetSecurityDescriptor() { LIMITED_METHOD_CONTRACT; return NULL; }
-
-
//****************************************************************************************
// Get the class init lock. The method is limited to friends because inappropriate use
// will cause deadlocks in the system
static HRESULT NotifyProfilerShutdown();
#endif // PROFILING_SUPPORTED
- IApplicationSecurityDescriptor* GetSecurityDescriptor()
- {
- LIMITED_METHOD_CONTRACT;
-
- return NULL;
- }
-
//****************************************************************************************
// return the dev path
#ifdef FEATURE_FUSION
//
//========================================================================
-HCIMPL2(void, JIT_DelegateSecurityCheck_Internal, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd)
+NOINLINE HCIMPL2(void, JIT_DelegateSecurityCheck_Internal, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd)
{
FCALL_CONTRACT;
}
HCIMPLEND
+#include <optsmallperfcritical.h>
/*************************************************************/
HCIMPL2(void, JIT_DelegateSecurityCheck, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd)
{
HCCALL2(JIT_DelegateSecurityCheck_Internal, delegateHnd, calleeMethodHnd);
}
HCIMPLEND
+#include <optdefault.h>
/*************************************************************/
//Make sure to allow check of 0 for COMPlus_Security_AlwaysInsertCallout
-HCIMPL4(void, JIT_MethodAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check)
+NOINLINE HCIMPL4(void, JIT_MethodAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check)
{
FCALL_CONTRACT;
HCIMPLEND
+#include <optsmallperfcritical.h>
/*************************************************************/
//Make sure to allow check of 0 for COMPlus_Security_AlwaysInsertCallout
HCIMPL4(void, JIT_MethodAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check)
HCCALL4(JIT_MethodAccessCheck_Internal, callerMethodHnd, calleeMethodHnd, calleeTypeHnd, check);
}
HCIMPLEND
+#include <optdefault.h>
// Slower checks (including failure paths) for determining if a method has runtime access to a field
-HCIMPL3(void, JIT_FieldAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check)
+NOINLINE HCIMPL3(void, JIT_FieldAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check)
{
FCALL_CONTRACT;
}
HCIMPLEND
+#include <optsmallperfcritical.h>
// Check to see if a method has runtime access to a field
HCIMPL3(void, JIT_FieldAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check)
{
HCCALL3(JIT_FieldAccessCheck_Internal, callerMethodHnd, calleeFieldHnd, check);
}
HCIMPLEND
+#include <optdefault.h>
// Slower checks (including failure paths) for determining if a method has runtime access to a type
-HCIMPL3(void, JIT_ClassAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check)
+NOINLINE HCIMPL3(void, JIT_ClassAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check)
{
FCALL_CONTRACT;
}
HCIMPLEND
+#include <optsmallperfcritical.h>
// Check to see if a method has runtime access to a type
HCIMPL3(void, JIT_ClassAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check)
{
HCCALL3(JIT_ClassAccessCheck_Internal, callerMethodHnd, calleeClassHnd, check);
}
HCIMPLEND
+#include <optdefault.h>
NOINLINE HCIMPL2(void, JIT_Security_Prolog_Framed, CORINFO_METHOD_HANDLE methHnd_, OBJECTREF* ppFrameSecDesc)
{
#include <optdefault.h>
/*************************************************************/
-HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HANDLE methHnd_)
+NOINLINE HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HANDLE methHnd_)
{
FCALL_CONTRACT;
}
HCIMPLEND
+#include <optsmallperfcritical.h>
/*************************************************************/
HCIMPL1(void, JIT_VerificationRuntimeCheck, CORINFO_METHOD_HANDLE methHnd_)
{
}
HCIMPLEND
+#include <optdefault.h>