#ifndef __GCENV_BASE_INCLUDED__
+#include <cstdint>
+
//
// This macro returns val rounded up as necessary to be a multiple of alignment; alignment must be a power of 2
//
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-void EventPipeAdapter_Initialize() {}
+void EventPipe_Initialize() {}
-bool DiagnosticServerAdapter_Initialize() { return false; }
-void DiagnosticServerAdapter_PauseForDiagnosticsMonitor() {}
+bool DiagnosticServer_Initialize() { return false; }
+void DiagnosticServer_PauseForDiagnosticsMonitor() {}
-void EventPipeAdapter_FinishInitialize() {}
+void EventPipe_FinishInitialize() {}
void EventPipe_ThreadShutdown() { }
-void EventPipeAdapter_Shutdown() {}
-bool DiagnosticServerAdapter_Shutdown() { return false; }
+void EventPipe_Shutdown() {}
+bool DiagnosticServer_Shutdown() { return false; }
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-#include "eventpipeadapter.h"
-#include "diagnosticserveradapter.h"
+#include <eventpipe/ep.h>
+#include <eventpipe/ep-rt-aot.h>
+#include <eventpipe/ds-server.h>
-void EventPipeAdapter_Initialize() { EventPipeAdapter::Initialize(); }
+void EventPipe_Initialize() { ep_init(); }
-bool DiagnosticServerAdapter_Initialize() { return DiagnosticServerAdapter::Initialize(); }
-void DiagnosticServerAdapter_PauseForDiagnosticsMonitor() { DiagnosticServerAdapter::PauseForDiagnosticsMonitor();}
+bool DiagnosticServer_Initialize() { return ds_server_init(); }
+void DiagnosticServer_PauseForDiagnosticsMonitor() { ds_server_pause_for_diagnostics_monitor(); }
-void EventPipeAdapter_FinishInitialize() { EventPipeAdapter::FinishInitialize(); }
+void EventPipe_FinishInitialize() { ep_finish_init(); }
void EventPipe_ThreadShutdown() { ep_rt_aot_thread_exited(); }
-void EventPipeAdapter_Shutdown() { EventPipeAdapter::Shutdown(); }
-bool DiagnosticServerAdapter_Shutdown() { return DiagnosticServerAdapter::Shutdown(); }
+void EventPipe_Shutdown() { ep_shutdown(); }
+bool DiagnosticServer_Shutdown() { return ds_server_shutdown(); }
#define EVENTPIPE_INTERFACE_H
// Initialize EventPipe
-void EventPipeAdapter_Initialize();
+void EventPipe_Initialize();
// Initialize DS
-bool DiagnosticServerAdapter_Initialize();
-void DiagnosticServerAdapter_PauseForDiagnosticsMonitor();
+bool DiagnosticServer_Initialize();
+void DiagnosticServer_PauseForDiagnosticsMonitor();
-
-void EventPipeAdapter_FinishInitialize();
+void EventPipe_FinishInitialize();
void EventPipe_ThreadShutdown();
-void EventPipeAdapter_Shutdown();
-bool DiagnosticServerAdapter_Shutdown();
+void EventPipe_Shutdown();
+bool DiagnosticServer_Shutdown();
void EventTracing_Initialize();
#endif //EVENTPIPE_INTERFACE_H
\ No newline at end of file
#include <sal.h>
#include <stdarg.h>
+#ifdef TARGET_UNIX
+#include <pthread.h>
+#endif
+
#include "CommonTypes.h"
#include "CommonMacros.h"
#include "gcenv.structs.h" // CRITICAL_SECTION
#ifndef __StackFrameIterator_h__
#define __StackFrameIterator_h__
+#include "CommonMacros.h"
#include "ICodeManager.h"
+#include "PalRedhawk.h" // NATIVE_CONTEXT
+#include "regdisplay.h"
+
+#include "forward_declarations.h"
struct ExInfo;
typedef DPTR(ExInfo) PTR_ExInfo;
EHEnumState m_state;
};
+class StackFrameIterator;
EXTERN_C FC_BOOL_RET FASTCALL RhpSfiInit(StackFrameIterator* pThis, PAL_LIMITED_CONTEXT* pStackwalkCtx, CLR_BOOL instructionFault);
EXTERN_C FC_BOOL_RET FASTCALL RhpSfiNext(StackFrameIterator* pThis, uint32_t* puExCollideClauseIdx, CLR_BOOL* pfUnwoundReversePInvoke);
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#ifndef DIAGNOSTIC_SERVER_ADAPTER_H
-#define DIAGNOSTIC_SERVER_ADAPTER_H
-
-#if defined(FEATURE_PERFTRACING)
-
-#include <eventpipe/ds-server.h>
-
-class DiagnosticServerAdapter final
-{
-public:
- static inline bool Initialize()
- {
- return ds_server_init();
- }
-
- static inline bool Shutdown()
- {
- return ds_server_shutdown();
- }
-
- NOINLINE static void PauseForDiagnosticsMonitor()
- {
- return ds_server_pause_for_diagnostics_monitor();
- }
-
- static void ResumeRuntimeStartup()
- {
- return ds_server_resume_runtime_startup();
- }
-
- static bool IsPausedInRuntimeStartup()
- {
- return ds_server_is_paused_in_startup();
- }
-};
-
-#endif // FEATURE_PERFTRACING
-
-#endif // DIAGNOSTIC_SERVER_ADAPTER_H
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-#include "common.h"
-#include "eventpipeadapter.h"
+#include "CommonTypes.h"
+#include "CommonMacros.h"
+#include "PalRedhawk.h"
-#ifdef FEATURE_PERFTRACING
+#include <eventpipe/ep.h>
-#include "gcenv.h"
-#include "regdisplay.h"
-#include "StackFrameIterator.h"
-#include "thread.h"
-#include "SpinLock.h"
+#ifdef FEATURE_PERFTRACING
struct EventPipeEventInstanceData;
struct EventPipeSessionInfo;
EXTERN_C NATIVEAOT_API uint64_t __cdecl RhEventPipeInternal_Enable(
- LPCWSTR outputFile,
+ const WCHAR* outputFile,
EventPipeSerializationFormat format,
uint32_t circularBufferSizeInMB,
/* COR_PRF_EVENTPIPE_PROVIDER_CONFIG */ const void * pProviders,
}
EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_CreateProvider(
- LPCWSTR providerName,
+ const WCHAR* providerName,
EventPipeCallback pCallbackFunc,
void* pCallbackContext)
{
return 0;
}
-EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_GetProvider(LPCWSTR providerName)
+EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_GetProvider(const WCHAR* providerName)
{
return 0;
}
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-#include "eventpipeadapter.h"
+#include "CommonTypes.h"
+#include "CommonMacros.h"
+#include "PalRedhawk.h"
#ifdef FEATURE_PERFTRACING
{
}
-EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogExceptionThrown(LPCWSTR exceptionTypeName, LPCWSTR exceptionMessage, void* faultingIP, HRESULT hresult)
+EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogExceptionThrown(const WCHAR* exceptionTypeName, const WCHAR* exceptionMessage, void* faultingIP, HRESULT hresult)
{
}
list(APPEND AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES
${RUNTIME_DIR}/eventpipeinternal.cpp
${RUNTIME_DIR}/eventpipeadapter.h
- ${RUNTIME_DIR}/diagnosticserveradapter.h
${RUNTIME_DIR}/EnabledEventPipeInterface.cpp
${RUNTIME_DIR}/runtimeeventinternal.cpp
)
// @TODO: Audit native events in NativeAOT Runtime
#include <common.h>
-#include "eventpipeadapter.h"
-#include "eventtrace_context.h"
-#include "gcheaputilities.h"
+#include <gcenv.h>
+
+#include <eventpipeadapter.h>
+#include <eventtrace_context.h>
+#include <gcheaputilities.h>
#ifndef ERROR_WRITE_FAULT
#define ERROR_WRITE_FAULT 29L
bool DotNETRuntimeProvider_IsEnabled(unsigned char level, unsigned long long keyword)
{
- if (!EventPipeAdapter::Enabled())
+ if (!ep_enabled())
return false;
EVENTPIPE_TRACE_CONTEXT& context = MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context.EventPipeProvider;
#include <eventpipe/ep-event-payload.h>
#include <eventpipe/ep-buffer-manager.h>
-#include "gcenv.h"
-#include "regdisplay.h"
-#include "StackFrameIterator.h"
-#include "thread.h"
-#include "holder.h"
-#include "SpinLock.h"
+#include "CommonTypes.h"
class EventPipeAdapter final
{
public:
- static inline void Initialize()
- {
- CONTRACTL
- {
- NOTHROW;
- }
- CONTRACTL_END;
-
- ep_init();
- }
-
- static inline EventPipeProvider * CreateProvider(LPCWSTR providerName, EventPipeCallback callback, void* pCallbackContext = nullptr)
+ static inline EventPipeProvider * CreateProvider(const WCHAR* providerName, EventPipeCallback callback, void* pCallbackContext = nullptr)
{
ep_char8_t *providerNameUTF8 = ep_rt_utf16_to_utf8_string(reinterpret_cast<const ep_char16_t *>(providerName), -1);
EventPipeProvider * provider = ep_create_provider (providerNameUTF8, callback, pCallbackContext);
return provider;
}
- static inline void DeleteProvider (EventPipeProvider * provider)
- {
- ep_delete_provider (provider);
- }
-
-
- static inline void FinishInitialize()
- {
- CONTRACTL
- {
- NOTHROW;
- }
- CONTRACTL_END;
-
- ep_finish_init();
- }
-
- static inline void Shutdown()
- {
- ep_shutdown();
- }
-
- static inline bool Enabled()
- {
- STATIC_CONTRACT_NOTHROW;
- return ep_enabled();
- }
-
- static inline void Disable(EventPipeSessionID id)
- {
- CONTRACTL
- {
- NOTHROW;
- GC_TRIGGERS;
- MODE_ANY;
- }
- CONTRACTL_END;
-
- ep_disable(id);
- }
-
- static inline EventPipeProvider * GetProvider (LPCWSTR providerName)
- {
- CONTRACTL
- {
- NOTHROW;
- GC_NOTRIGGER;
- MODE_ANY;
- }
- CONTRACTL_END;
-
- if (!providerName)
- return NULL;
-
- ep_char8_t *providerNameUTF8 = ep_rt_utf16_to_utf8_string(reinterpret_cast<const ep_char16_t *>(providerName), -1);
- EventPipeProvider * provider = ep_get_provider (providerNameUTF8);
- ep_rt_utf8_string_free(providerNameUTF8);
- return provider;
- }
-
static inline EventPipeEvent * AddEvent(
EventPipeProvider *provider,
uint32_t eventID,
#include "common.h"
#include "eventpipeadapter.h"
-
-#include "gcenv.h"
-#include "regdisplay.h"
-#include "StackFrameIterator.h"
-#include "thread.h"
-#include "SpinLock.h"
+#include "PalRedhawk.h"
#ifdef FEATURE_PERFTRACING
void *ProviderID;
unsigned int EventID;
unsigned int ThreadID;
- LARGE_INTEGER TimeStamp;
+ int64_t TimeStamp;
GUID ActivityId;
GUID RelatedActivityId;
const uint8_t *Payload;
};
EXTERN_C NATIVEAOT_API uint64_t __cdecl RhEventPipeInternal_Enable(
- LPCWSTR outputFile,
+ const WCHAR* outputFile,
EventPipeSerializationFormat format,
uint32_t circularBufferSizeInMB,
/* COR_PRF_EVENTPIPE_PROVIDER_CONFIG */ const void * pProviders,
EXTERN_C NATIVEAOT_API void __cdecl RhEventPipeInternal_Disable(uint64_t sessionID)
{
- EventPipeAdapter::Disable(sessionID);
+ ep_disable(sessionID);
}
EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_CreateProvider(
- LPCWSTR providerName,
+ const WCHAR* providerName,
EventPipeCallback pCallbackFunc,
void* pCallbackContext)
{
return reinterpret_cast<intptr_t>(pEvent);
}
-EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_GetProvider(LPCWSTR providerName)
+EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_GetProvider(const WCHAR* providerName)
{
- EventPipeProvider* pProvider = EventPipeAdapter::GetProvider(providerName);
- return reinterpret_cast<intptr_t>(pProvider);
+ EventPipeProvider * provider = NULL;
+ if (providerName)
+ {
+ ep_char8_t *providerNameUTF8 = ep_rt_utf16_to_utf8_string(reinterpret_cast<const ep_char16_t *>(providerName), -1);
+ provider = ep_get_provider (providerNameUTF8);
+ ep_rt_utf8_string_free(providerNameUTF8);
+ }
+
+ return reinterpret_cast<intptr_t>(provider);
}
EXTERN_C NATIVEAOT_API void __cdecl RhEventPipeInternal_DeleteProvider(intptr_t provHandle)
if (provHandle != 0)
{
EventPipeProvider *pProvider = reinterpret_cast<EventPipeProvider *>(provHandle);
- EventPipeAdapter::DeleteProvider(pProvider);
+ ep_delete_provider(pProvider);
}
}
pInstance->ProviderID = ep_event_get_provider(ep_event_instance_get_ep_event(pNextInstance));
pInstance->EventID = ep_event_get_event_id(ep_event_instance_get_ep_event(pNextInstance));
pInstance->ThreadID = static_cast<uint32_t>(ep_event_get_event_id(ep_event_instance_get_ep_event(pNextInstance)));
- pInstance->TimeStamp.QuadPart = ep_event_instance_get_timestamp(pNextInstance);
+ pInstance->TimeStamp = ep_event_instance_get_timestamp(pNextInstance);
pInstance->ActivityId = *reinterpret_cast<const GUID *>(ep_event_instance_get_activity_id_cref(pNextInstance));
pInstance->RelatedActivityId = *reinterpret_cast<const GUID *>(ep_event_instance_get_related_activity_id_cref(pNextInstance));
pInstance->Payload = ep_event_instance_get_data(pNextInstance);
if (!session)
return false;
- return ep_rt_wait_event_set (ep_session_get_wait_event (session));
+ return ep_rt_wait_event_set (ep_session_get_wait_event (session));
}
EXTERN_C NATIVEAOT_API UInt32_BOOL __cdecl RhEventPipeInternal_WaitForSessionSignal(uint64_t sessionID, int32_t timeoutMs)
#include <cstddef>
#include <string.h>
+#ifdef TARGET_UNIX
+#include <pthread.h>
+#endif
+
+#include "rhassert.h"
#include "sal.h"
#include "gcenv.structs.h"
#include "gcenv.interlocked.h"
#ifndef _TARGETPTRS_H_
#define _TARGETPTRS_H_
-typedef DPTR(class MethodTable) PTR_EEType;
-
#ifdef TARGET_AMD64
typedef uint64_t UIntTarget;
#elif defined(TARGET_X86)
#error unexpected target architecture
#endif
-typedef PTR_UInt8 TgtPTR_UInt8;
-typedef PTR_UInt32 TgtPTR_UInt32;
typedef void * TgtPTR_Void;
-typedef PTR_EEType TgtPTR_EEType;
typedef class Thread * TgtPTR_Thread;
-typedef struct CORINFO_Object * TgtPTR_CORINFO_Object;
#endif // !_TARGETPTRS_H_
//
// This header contains binder-generated data structures that the runtime consumes.
//
+#include "daccess.h" // DPTR
#include "TargetPtrs.h"
class MethodTable;
#if defined(TARGET_X86) || defined(TARGET_AMD64)
+#include "PalRedhawkCommon.h" // Fp128
+
struct REGDISPLAY
{
PTR_UIntNative pRax;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-#include "eventpipeadapter.h"
+#include "gcenv.h"
#ifdef FEATURE_PERFTRACING
FireEtwThreadPoolIOPack(NativeOverlapped, Overlapped, ClrInstanceID);
}
-EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogExceptionThrown(LPCWSTR exceptionTypeName, LPCWSTR exceptionMessage, void* faultingIP, HRESULT hresult)
+EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogExceptionThrown(const WCHAR* exceptionTypeName, const WCHAR* exceptionMessage, void* faultingIP, HRESULT hresult)
{
FireEtwExceptionThrown_V1(exceptionTypeName,
exceptionMessage,
#ifdef FEATURE_PERFTRACING
// Initialize EventPipe
- EventPipeAdapter_Initialize();
+ EventPipe_Initialize();
// Initialize DS
- DiagnosticServerAdapter_Initialize();
- DiagnosticServerAdapter_PauseForDiagnosticsMonitor();
+ DiagnosticServer_Initialize();
+ DiagnosticServer_PauseForDiagnosticsMonitor();
#endif
#ifdef FEATURE_EVENT_TRACE
EventTracing_Initialize();
// Finish setting up rest of EventPipe - specifically enable SampleProfiler if it was requested at startup.
// SampleProfiler needs to cooperate with the GC which hasn't fully finished setting up in the first part of the
// EventPipe initialization, so this is done after the GC has been fully initialized.
- EventPipeAdapter_FinishInitialize();
+ EventPipe_FinishInitialize();
#endif
#ifndef USE_PORTABLE_HELPERS
#endif
#ifdef FEATURE_PERFTRACING
- EventPipeAdapter_Shutdown();
- DiagnosticServerAdapter_Shutdown();
+ EventPipe_Shutdown();
+ DiagnosticServer_Shutdown();
#endif
}
#endif
ThreadStore::DetachCurrentThread();
-
+
#ifdef FEATURE_PERFTRACING
EventPipe_ThreadShutdown();
#endif
#ifndef __thread_h__
#define __thread_h__
-#include "regdisplay.h"
#include "StackFrameIterator.h"
-
-#include "forward_declarations.h"
+#include "slist.h" // DefaultSListTraits
struct gc_alloc_context;
class RuntimeInstance;