Skip to content
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
16 changes: 8 additions & 8 deletions src/coreclr/nativeaot/Runtime/clretwallmain.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ inline ULONG FireEtwDestroyGCHandle(
inline BOOL EventEnabledExceptionThrown_V1(void) {return EventPipeEventEnabledExceptionThrown_V1();}

inline ULONG FireEtwExceptionThrown_V1(
wchar_t* ExceptionType,
wchar_t* ExceptionMessage,
const WCHAR* ExceptionType,
const WCHAR* ExceptionMessage,
void* ExceptionEIP,
const unsigned int ExceptionHRESULT,
const unsigned short ExceptionFlags,
Expand Down Expand Up @@ -70,7 +70,7 @@ inline ULONG FireEtwGCAllocationTick_V2(
const unsigned short ClrInstanceID,
const unsigned __int64 AllocationAmount64,
void* TypeID,
wchar_t* TypeName,
const WCHAR* TypeName,
const unsigned int HeapIndex,
const GUID * ActivityId = nullptr,
const GUID * RelatedActivityId = nullptr
Expand All @@ -91,7 +91,7 @@ inline ULONG FireEtwGCAllocationTick_V3(
const unsigned short ClrInstanceID,
const unsigned __int64 AllocationAmount64,
void* TypeID,
wchar_t* TypeName,
const WCHAR* TypeName,
const unsigned int HeapIndex,
void* Address,
const GUID * ActivityId = nullptr,
Expand Down Expand Up @@ -561,15 +561,15 @@ inline ULONG FireEtwModuleLoad_V2(
const unsigned __int64 AssemblyID,
const unsigned int ModuleFlags,
const unsigned int Reserved1,
wchar_t* ModuleILPath,
wchar_t* ModuleNativePath,
const WCHAR* ModuleILPath,
const WCHAR* ModuleNativePath,
const unsigned short ClrInstanceID,
const GUID* ManagedPdbSignature,
const unsigned int ManagedPdbAge,
wchar_t* ManagedPdbBuildPath,
const WCHAR* ManagedPdbBuildPath,
const GUID* NativePdbSignature,
const unsigned int NativePdbAge,
wchar_t* NativePdbBuildPath,
const WCHAR* NativePdbBuildPath,
const GUID * ActivityId = nullptr,
const GUID * RelatedActivityId = nullptr
)
Expand Down
16 changes: 8 additions & 8 deletions src/coreclr/nativeaot/Runtime/clreventpipewriteevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ ULONG EventPipeWriteEventDestroyGCHandle(
);
BOOL EventPipeEventEnabledExceptionThrown_V1(void);
ULONG EventPipeWriteEventExceptionThrown_V1(
const wchar_t* ExceptionType,
const wchar_t* ExceptionMessage,
const WCHAR* ExceptionType,
const WCHAR* ExceptionMessage,
const void* ExceptionEIP,
const unsigned int ExceptionHRESULT,
const unsigned short ExceptionFlags,
Expand All @@ -39,7 +39,7 @@ ULONG EventPipeWriteEventGCAllocationTick_V2(
const unsigned short ClrInstanceID,
const unsigned __int64 AllocationAmount64,
const void* TypeID,
const wchar_t* TypeName,
const WCHAR* TypeName,
const unsigned int HeapIndex,
const GUID * ActivityId = nullptr,
const GUID * RelatedActivityId = nullptr
Expand All @@ -51,7 +51,7 @@ ULONG EventPipeWriteEventGCAllocationTick_V3(
const unsigned short ClrInstanceID,
const unsigned __int64 AllocationAmount64,
const void* TypeID,
const wchar_t* TypeName,
const WCHAR* TypeName,
const unsigned int HeapIndex,
const void* Address,
const GUID * ActivityId = nullptr,
Expand Down Expand Up @@ -296,15 +296,15 @@ ULONG EventPipeWriteEventModuleLoad_V2(
const unsigned __int64 AssemblyID,
const unsigned int ModuleFlags,
const unsigned int Reserved1,
const wchar_t* ModuleILPath,
const wchar_t* ModuleNativePath,
const WCHAR* ModuleILPath,
const WCHAR* ModuleNativePath,
const unsigned short ClrInstanceID,
const GUID* ManagedPdbSignature,
const unsigned int ManagedPdbAge,
const wchar_t* ManagedPdbBuildPath,
const WCHAR* ManagedPdbBuildPath,
const GUID* NativePdbSignature,
const unsigned int NativePdbAge,
const wchar_t* NativePdbBuildPath,
const WCHAR* NativePdbBuildPath,
const GUID * ActivityId = nullptr,
const GUID * RelatedActivityId = nullptr
);
Expand Down
34 changes: 17 additions & 17 deletions src/coreclr/nativeaot/Runtime/eventpipe/dotnetruntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bool ResizeBuffer(BYTE *&buffer, size_t& size, size_t currLen, size_t newSize, b

// shipping criteria: no EVENTPIPE-NATIVEAOT-TODO left in the codebase
// @TODO - Events need to be audited
const WCHAR* DotNETRuntimeName = L"Microsoft-Windows-DotNETRuntime";
const WCHAR* DotNETRuntimeName = W("Microsoft-Windows-DotNETRuntime");
EventPipeProvider *EventPipeProviderDotNETRuntime = nullptr;
EventPipeEvent *EventPipeEventDestroyGCHandle = nullptr;
EventPipeEvent *EventPipeEventExceptionThrown_V1 = nullptr;
Expand Down Expand Up @@ -177,8 +177,8 @@ BOOL EventPipeEventEnabledExceptionThrown_V1(void)
}

ULONG EventPipeWriteEventExceptionThrown_V1(
const wchar_t* ExceptionType,
const wchar_t* ExceptionMessage,
const WCHAR* ExceptionType,
const WCHAR* ExceptionMessage,
const void* ExceptionEIP,
const unsigned int ExceptionHRESULT,
const unsigned short ExceptionFlags,
Expand All @@ -196,8 +196,8 @@ ULONG EventPipeWriteEventExceptionThrown_V1(
bool fixedBuffer = true;
bool success = true;

if (!ExceptionType) { ExceptionType = L"NULL"; }
if (!ExceptionMessage) { ExceptionMessage = L"NULL"; }
if (!ExceptionType) { ExceptionType = W("NULL"); }
if (!ExceptionMessage) { ExceptionMessage = W("NULL"); }
success &= WriteToBuffer(ExceptionType, buffer, offset, size, fixedBuffer);
success &= WriteToBuffer(ExceptionMessage, buffer, offset, size, fixedBuffer);
success &= WriteToBuffer(ExceptionEIP, buffer, offset, size, fixedBuffer);
Expand Down Expand Up @@ -274,7 +274,7 @@ ULONG EventPipeWriteEventGCAllocationTick_V2(
const unsigned short ClrInstanceID,
const unsigned __int64 AllocationAmount64,
const void* TypeID,
const wchar_t* TypeName,
const WCHAR* TypeName,
const unsigned int HeapIndex,
const GUID * ActivityId,
const GUID * RelatedActivityId)
Expand All @@ -289,7 +289,7 @@ ULONG EventPipeWriteEventGCAllocationTick_V2(
bool fixedBuffer = true;
bool success = true;

if (!TypeName) { TypeName = L"NULL"; }
if (!TypeName) { TypeName = W("NULL"); }
success &= WriteToBuffer(AllocationAmount, buffer, offset, size, fixedBuffer);
success &= WriteToBuffer(AllocationKind, buffer, offset, size, fixedBuffer);
success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
Expand Down Expand Up @@ -325,7 +325,7 @@ ULONG EventPipeWriteEventGCAllocationTick_V3(
const unsigned short ClrInstanceID,
const unsigned __int64 AllocationAmount64,
const void* TypeID,
const wchar_t* TypeName,
const WCHAR* TypeName,
const unsigned int HeapIndex,
const void* Address,
const GUID * ActivityId,
Expand All @@ -341,7 +341,7 @@ ULONG EventPipeWriteEventGCAllocationTick_V3(
bool fixedBuffer = true;
bool success = true;

if (!TypeName) { TypeName = L"NULL"; }
if (!TypeName) { TypeName = W("NULL"); }
success &= WriteToBuffer(AllocationAmount, buffer, offset, size, fixedBuffer);
success &= WriteToBuffer(AllocationKind, buffer, offset, size, fixedBuffer);
success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
Expand Down Expand Up @@ -1458,15 +1458,15 @@ ULONG EventPipeWriteEventModuleLoad_V2(
const unsigned __int64 AssemblyID,
const unsigned int ModuleFlags,
const unsigned int Reserved1,
const wchar_t* ModuleILPath,
const wchar_t* ModuleNativePath,
const WCHAR* ModuleILPath,
const WCHAR* ModuleNativePath,
const unsigned short ClrInstanceID,
const GUID* ManagedPdbSignature,
const unsigned int ManagedPdbAge,
const wchar_t* ManagedPdbBuildPath,
const WCHAR* ManagedPdbBuildPath,
const GUID* NativePdbSignature,
const unsigned int NativePdbAge,
const wchar_t* NativePdbBuildPath,
const WCHAR* NativePdbBuildPath,
const GUID * ActivityId,
const GUID * RelatedActivityId)
{
Expand All @@ -1480,10 +1480,10 @@ ULONG EventPipeWriteEventModuleLoad_V2(
bool fixedBuffer = true;
bool success = true;

if (!ModuleILPath) { ModuleILPath = L"NULL"; }
if (!ModuleNativePath) { ModuleNativePath = L"NULL"; }
if (!ManagedPdbBuildPath) { ManagedPdbBuildPath = L"NULL"; }
if (!NativePdbBuildPath) { NativePdbBuildPath = L"NULL"; }
if (!ModuleILPath) { ModuleILPath = W("NULL"); }
if (!ModuleNativePath) { ModuleNativePath = W("NULL"); }
if (!ManagedPdbBuildPath) { ManagedPdbBuildPath = W("NULL"); }
if (!NativePdbBuildPath) { NativePdbBuildPath = W("NULL"); }
success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer);
success &= WriteToBuffer(AssemblyID, buffer, offset, size, fixedBuffer);
success &= WriteToBuffer(ModuleFlags, buffer, offset, size, fixedBuffer);
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/nativeaot/Runtime/gctoclreventsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ void GCToCLREventSink::FireGCStart_V2(uint32_t count, uint32_t depth, uint32_t r
{
LIMITED_METHOD_CONTRACT;

#ifdef FEATURE_ETW
#ifdef FEATURE_EVENT_TRACE
ETW::GCLog::ETW_GC_INFO gcStartInfo;
gcStartInfo.GCStart.Count = count;
gcStartInfo.GCStart.Depth = depth;
gcStartInfo.GCStart.Reason = static_cast<ETW::GCLog::ETW_GC_INFO::GC_REASON>(reason);
gcStartInfo.GCStart.Type = static_cast<ETW::GCLog::ETW_GC_INFO::GC_TYPE>(type);
ETW::GCLog::FireGcStart(&gcStartInfo);
#endif // FEATURE_ETW
#endif // FEATURE_EVENT_TRACE
}

void GCToCLREventSink::FireGCGenerationRange(uint8_t generation, void* rangeStart, uint64_t rangeUsedLength, uint64_t rangeReservedLength)
Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/nativeaot/Runtime/inc/CommonTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ using std::size_t;
using std::uintptr_t;
using std::intptr_t;


#ifdef TARGET_WINDOWS
typedef wchar_t WCHAR;
#define W(str) L##str
#else
typedef char16_t WCHAR;
#define W(str) u##str
#endif
typedef void * HANDLE;

typedef uint32_t UInt32_BOOL; // windows 4-byte BOOL, 0 -> false, everything else -> true
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ extern "C" UInt32_BOOL CloseHandle(HANDLE handle)
return success ? UInt32_TRUE : UInt32_FALSE;
}

REDHAWK_PALEXPORT HANDLE REDHAWK_PALAPI PalCreateEventW(_In_opt_ LPSECURITY_ATTRIBUTES pEventAttributes, UInt32_BOOL manualReset, UInt32_BOOL initialState, _In_opt_z_ const wchar_t* pName)
REDHAWK_PALEXPORT HANDLE REDHAWK_PALAPI PalCreateEventW(_In_opt_ LPSECURITY_ATTRIBUTES pEventAttributes, UInt32_BOOL manualReset, UInt32_BOOL initialState, _In_opt_z_ const WCHAR* pName)
{
UnixEvent event = UnixEvent(manualReset, initialState);
if (!event.Initialize())
Expand Down