
//*********************************************************************
//              Copyright (c) Microsoft Corporation.
//
//*********************************************************************

#pragma classflags("forceupdate")
#pragma AUTORECOVER
#pragma namespace("\\\\.\\root\\wmi")

[dynamic: ToInstance, Description("sqlclr"),
    Guid("{1E99FE90-A4FE-45E6-9DFD-A45041F02314}"), locale("MS\\0x409")]
class XeClrHostPkg: EventTrace
{
	
	[Description ("Enable flags") : amended,
	ValueDescriptions{
		"Events related to garbage collection.",
		"Events related to CLR memory managment.",
		"Events related to CLR initialization."
	} : amended,
	DefineValues{
		"ETW_XECLRHOSTPKG_GARBAGE_COLLECTION"
		,
		"ETW_XECLRHOSTPKG_MEMORY"
		,
		"ETW_XECLRHOSTPKG_INIT"
		},
	Values{
		"garbage_collection",
		"memory",
		"init"
		},
	ValueMap{
		"1",
		"2",
		"4"
		}
	]
	uint32 Flags;

};

	
[dynamic: ToInstance, Description("Threads are being suspended for a garbage collection"): Amended,
    Guid("{941A0FC3-4C6D-4149-A64D-C09DE8675086}"), locale("MS\\0x409"),
    DisplayName("gc_suspension"): Amended]
class XeClrHostPkg_gc_suspension: XeClrHostPkg
{
};

[dynamic: ToInstance, EventType(0), EventVersion(1)]
class gc_suspension: XeClrHostPkg_gc_suspension
{
	[WmiDataId(1), Description("FragmentId"): Amended,read] uint32 FragmentId;
	[WmiDataId(2), Description("RemainingLength"): Amended,read] uint32 RemainingLength;
	[WmiDataId(3), Description("ActivityId"): Amended,ActivityID, read, Extension("Guid")] guid ActivityId;
	[WmiDataId(4), Description("SequenceNumber"): Amended,read] uint32 SequenceNumber;
	[WmiDataId(5), read, 
				XEMapId(1),
				ValueMap { 
					"0", 
					"1" },
				Values { 
					"Begin", 
					"End" }
			] uint32 opcode;
};
		
[dynamic: ToInstance, Description("A memory allocation failed."): Amended,
    Guid("{EBAB8A18-5795-4F1D-9466-7AE9FC9F54C2}"), locale("MS\\0x409"),
    DisplayName("clr_allocation_failure"): Amended]
class XeClrHostPkg_clr_allocation_failure: XeClrHostPkg
{
};

[dynamic: ToInstance, EventType(0), EventVersion(1)]
class clr_allocation_failure: XeClrHostPkg_clr_allocation_failure
{
	[WmiDataId(1), Description("FragmentId"): Amended,read] uint32 FragmentId;
	[WmiDataId(2), Description("RemainingLength"): Amended,read] uint32 RemainingLength;
	[WmiDataId(3), Description("ActivityId"): Amended,ActivityID, read, Extension("Guid")] guid ActivityId;
	[WmiDataId(4), Description("SequenceNumber"): Amended,read] uint32 SequenceNumber;
	[WmiDataId(5), read] uint64 allocation_size;
	[WmiDataId(6), read, 
				XEMapId(2),
				ValueMap { 
					"0", 
					"1", 
					"2" },
				Values { 
					"Task Critical", 
					"Appdomain Critical", 
					"Process Critical" }
			] uint32 critical_level;
};
		
[dynamic: ToInstance, Description("A virtual memory allocation failed"): Amended,
    Guid("{7C352842-511F-4B8A-8A42-7AD2B4E4F668}"), locale("MS\\0x409"),
    DisplayName("clr_virtual_alloc_failure"): Amended]
class XeClrHostPkg_clr_virtual_alloc_failure: XeClrHostPkg
{
};

[dynamic: ToInstance, EventType(0), EventVersion(1)]
class clr_virtual_alloc_failure: XeClrHostPkg_clr_virtual_alloc_failure
{
	[WmiDataId(1), Description("FragmentId"): Amended,read] uint32 FragmentId;
	[WmiDataId(2), Description("RemainingLength"): Amended,read] uint32 RemainingLength;
	[WmiDataId(3), Description("ActivityId"): Amended,ActivityID, read, Extension("Guid")] guid ActivityId;
	[WmiDataId(4), Description("SequenceNumber"): Amended,read] uint32 SequenceNumber;
	[WmiDataId(5), read] uint64 allocation_size;
	[WmiDataId(6), read, 
				XEMapId(3),
				ValueMap { 
					"8192", 
					"4096" },
				Values { 
					"Virtual Reserve", 
					"Virtual Commit" }
			] uint32 allocation_type;
	[WmiDataId(7), read, 
				XEMapId(2),
				ValueMap { 
					"0", 
					"1", 
					"2" },
				Values { 
					"Task Critical", 
					"Appdomain Critical", 
					"Process Critical" }
			] uint32 critical_level;
};
		
[dynamic: ToInstance, Description("CLR initialization failed"): Amended,
    Guid("{97691C4F-044D-4205-A235-4EB4A5A66EBF}"), locale("MS\\0x409"),
    DisplayName("clr_init_failure"): Amended]
class XeClrHostPkg_clr_init_failure: XeClrHostPkg
{
};

[dynamic: ToInstance, EventType(0), EventVersion(1)]
class clr_init_failure: XeClrHostPkg_clr_init_failure
{
	[WmiDataId(1), Description("FragmentId"): Amended,read] uint32 FragmentId;
	[WmiDataId(2), Description("RemainingLength"): Amended,read] uint32 RemainingLength;
	[WmiDataId(3), Description("ActivityId"): Amended,ActivityID, read, Extension("Guid")] guid ActivityId;
	[WmiDataId(4), Description("SequenceNumber"): Amended,read] uint32 SequenceNumber;
	[WmiDataId(5), read, 
				XEMapId(4),
				ValueMap { 
					"0", 
					"1", 
					"2", 
					"3" },
				Values { 
					"None", 
					"Bad Installation", 
					"Recoverable", 
					"NonRecoverable" }
			] uint32 failure_type;
	[WmiDataId(6), read] uint32 failure_hresult;
	[WmiDataId(7), read] uint32 error_state;
};
		