diff --git a/src/coreclr/scripts/genEventPipe.py b/src/coreclr/scripts/genEventPipe.py index 37acc30361803b..a7d3a6021cdb12 100644 --- a/src/coreclr/scripts/genEventPipe.py +++ b/src/coreclr/scripts/genEventPipe.py @@ -181,11 +181,9 @@ def generateClrEventPipeWriteEventsImpl( eventPipeCallbackCastExpr = "" if target_cpp: eventPipeCallbackCastExpr = "reinterpret_cast" - else: - eventPipeCallbackCastExpr = "(EventPipeCallback)" if runtimeFlavor.mono: - WriteEventImpl.append("void " + callbackName + "(const uint8_t *, unsigned long, uint8_t, uint64_t, uint64_t, EventFilterDescriptor *, void *);\n\n") + WriteEventImpl.append("void EP_CALLBACK_CALLTYPE " + callbackName + "(const uint8_t *, unsigned long, uint8_t, uint64_t, uint64_t, EventFilterDescriptor *, void *);\n\n") if extern: WriteEventImpl.append('extern "C" ') WriteEventImpl.append( diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/AssemblyInfo.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/AssemblyInfo.cs index 9d9f83d661591a..2c82ef4294e3ef 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/AssemblyInfo.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/AssemblyInfo.cs @@ -2,6 +2,4 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using Xunit; - -[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))] +using Xunit; \ No newline at end of file diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/AssemblyInfo.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/AssemblyInfo.cs index 5afed22cfac9f2..b06082c8be4e1c 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/AssemblyInfo.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/AssemblyInfo.cs @@ -5,5 +5,4 @@ using Xunit; [assembly: SkipOnCoreClr("System.Net.Tests are flaky and/or long running: https://github.com/dotnet/runtime/issues/131", ~RuntimeConfiguration.Release)] -[assembly: SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on Browser")] -[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))] +[assembly: SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on Browser")] \ No newline at end of file diff --git a/src/libraries/System.Runtime.Caching/tests/AssemblyInfo.cs b/src/libraries/System.Runtime.Caching/tests/AssemblyInfo.cs index 9d9f83d661591a..2c82ef4294e3ef 100644 --- a/src/libraries/System.Runtime.Caching/tests/AssemblyInfo.cs +++ b/src/libraries/System.Runtime.Caching/tests/AssemblyInfo.cs @@ -2,6 +2,4 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using Xunit; - -[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))] +using Xunit; \ No newline at end of file diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/AssemblyInfo.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/AssemblyInfo.cs index 9d9f83d661591a..2c82ef4294e3ef 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/AssemblyInfo.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/AssemblyInfo.cs @@ -2,6 +2,4 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using Xunit; - -[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))] +using Xunit; \ No newline at end of file diff --git a/src/libraries/System.Transactions.Local/tests/AssemblyInfo.cs b/src/libraries/System.Transactions.Local/tests/AssemblyInfo.cs index 9d9f83d661591a..2c82ef4294e3ef 100644 --- a/src/libraries/System.Transactions.Local/tests/AssemblyInfo.cs +++ b/src/libraries/System.Transactions.Local/tests/AssemblyInfo.cs @@ -2,6 +2,4 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using Xunit; - -[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))] +using Xunit; \ No newline at end of file diff --git a/src/mono/mono/eventpipe/ep-rt-mono-profiler-provider.c b/src/mono/mono/eventpipe/ep-rt-mono-profiler-provider.c index b18656b6b8bf21..2076a2748b6fea 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono-profiler-provider.c +++ b/src/mono/mono/eventpipe/ep-rt-mono-profiler-provider.c @@ -2965,6 +2965,7 @@ eventpipe_provider_callback ( } void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntimeMonoProfiler ( const uint8_t *source_id, unsigned long is_enabled, diff --git a/src/mono/mono/eventpipe/ep-rt-mono-runtime-provider.c b/src/mono/mono/eventpipe/ep-rt-mono-runtime-provider.c index 151dafced3e8e8..a7e1640f983805 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono-runtime-provider.c +++ b/src/mono/mono/eventpipe/ep-rt-mono-runtime-provider.c @@ -4336,6 +4336,7 @@ gc_heap_dump_trigger_callback (MonoProfiler *prof) } void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntime ( const uint8_t *source_id, unsigned long is_enabled, diff --git a/src/mono/mono/eventpipe/ep-rt-mono.c b/src/mono/mono/eventpipe/ep-rt-mono.c index e8a9d2640b7a89..9cf1cd687fab4b 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.c +++ b/src/mono/mono/eventpipe/ep-rt-mono.c @@ -889,6 +889,7 @@ ep_rt_mono_fini (void) } void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntimeRundown ( const uint8_t *source_id, unsigned long is_enabled, @@ -904,6 +905,7 @@ EventPipeEtwCallbackDotNETRuntimeRundown ( } void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntimePrivate ( const uint8_t *source_id, unsigned long is_enabled, @@ -919,6 +921,7 @@ EventPipeEtwCallbackDotNETRuntimePrivate ( } void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntimeStress ( const uint8_t *source_id, unsigned long is_enabled, diff --git a/src/mono/mono/eventpipe/ep-rt-mono.h b/src/mono/mono/eventpipe/ep-rt-mono.h index fdb4924ec06da6..3740f63d760da1 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.h +++ b/src/mono/mono/eventpipe/ep-rt-mono.h @@ -1920,6 +1920,7 @@ ep_rt_write_event_contention_stop ( */ void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntime ( const uint8_t *source_id, unsigned long is_enabled, @@ -1930,6 +1931,7 @@ EventPipeEtwCallbackDotNETRuntime ( void *callback_data); void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntimeRundown ( const uint8_t *source_id, unsigned long is_enabled, @@ -1940,6 +1942,7 @@ EventPipeEtwCallbackDotNETRuntimeRundown ( void *callback_data); void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntimePrivate ( const uint8_t *source_id, unsigned long is_enabled, @@ -1950,6 +1953,7 @@ EventPipeEtwCallbackDotNETRuntimePrivate ( void *callback_data); void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntimeStress ( const uint8_t *source_id, unsigned long is_enabled, @@ -1960,6 +1964,7 @@ EventPipeEtwCallbackDotNETRuntimeStress ( void *callback_data); void +EP_CALLBACK_CALLTYPE EventPipeEtwCallbackDotNETRuntimeMonoProfiler ( const uint8_t *source_id, unsigned long is_enabled, diff --git a/src/mono/mono/eventpipe/test/ep-provider-callback-dataqueue-tests.c b/src/mono/mono/eventpipe/test/ep-provider-callback-dataqueue-tests.c index 1b4597e3674321..32f7c7d00038ce 100644 --- a/src/mono/mono/eventpipe/test/ep-provider-callback-dataqueue-tests.c +++ b/src/mono/mono/eventpipe/test/ep-provider-callback-dataqueue-tests.c @@ -25,6 +25,7 @@ test_provider_callback_data_queue_setup (void) static void +EP_CALLBACK_CALLTYPE provider_callback ( const uint8_t *source_id, unsigned long is_enabled, diff --git a/src/mono/mono/eventpipe/test/ep-tests.c b/src/mono/mono/eventpipe/test/ep-tests.c index 20e6feae25d9b9..04c9c6190ef49f 100644 --- a/src/mono/mono/eventpipe/test/ep-tests.c +++ b/src/mono/mono/eventpipe/test/ep-tests.c @@ -360,7 +360,7 @@ test_enable_disable_default_provider_config (void) test_location = 2; - result = validate_default_provider_config ((EventPipeSession *)session_id); + result = validate_default_provider_config ((EventPipeSession *)(uintptr_t)session_id); ep_raise_error_if_nok (result == NULL); test_location = 3; @@ -409,7 +409,7 @@ test_enable_disable_multiple_default_provider_config (void) test_location = 2; - result = validate_default_provider_config ((EventPipeSession *)session_id_1); + result = validate_default_provider_config ((EventPipeSession *)(uintptr_t)session_id_1); ep_raise_error_if_nok (result == NULL); test_location = 3; @@ -441,7 +441,7 @@ test_enable_disable_multiple_default_provider_config (void) test_location = 5; - result = validate_default_provider_config ((EventPipeSession *)session_id_2); + result = validate_default_provider_config ((EventPipeSession *)(uintptr_t)session_id_2); ep_raise_error_if_nok (result == NULL); test_location = 6; @@ -491,7 +491,7 @@ test_enable_disable_provider_config (void) test_location = 2; - EventPipeSessionProviderList *provider_list = ep_session_get_providers ((EventPipeSession *)session_id); + EventPipeSessionProviderList *provider_list = ep_session_get_providers ((EventPipeSession *)(uintptr_t)session_id); EventPipeSessionProvider *session_provider = ep_session_provider_list_find_by_name (ep_session_provider_list_get_providers (provider_list), TEST_PROVIDER_NAME); ep_raise_error_if_nok (session_provider != NULL); @@ -572,7 +572,7 @@ test_enable_disable_provider_parse_default_config (void) test_location = 2; - result = validate_default_provider_config ((EventPipeSession *)session_id); + result = validate_default_provider_config ((EventPipeSession *)(uintptr_t)session_id); ep_raise_error_if_nok (result == NULL); test_location = 3; @@ -598,6 +598,7 @@ static bool provider_callback_data; static void +EP_CALLBACK_CALLTYPE provider_callback ( const uint8_t *source_id, unsigned long is_enabled, @@ -795,7 +796,7 @@ test_session_write_event (void) EventPipeEventPayload payload;; ep_event_payload_init (&payload, NULL, 0); - write_result = ep_session_write_event ((EventPipeSession *)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); + write_result = ep_session_write_event ((EventPipeSession *)(uintptr_t)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); ep_event_payload_fini (&payload); ep_raise_error_if_nok (write_result == true); @@ -848,14 +849,14 @@ test_session_write_event_seq_point (void) EventPipeEventPayload payload;; ep_event_payload_init (&payload, NULL, 0); - write_result = ep_session_write_event ((EventPipeSession *)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); + write_result = ep_session_write_event ((EventPipeSession *)(uintptr_t)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); ep_event_payload_fini (&payload); ep_raise_error_if_nok (write_result == true); test_location = 5; - ep_session_write_sequence_point_unbuffered ((EventPipeSession *)session_id); + ep_session_write_sequence_point_unbuffered ((EventPipeSession *)(uintptr_t)session_id); ep_on_exit: ep_disable (session_id); @@ -905,20 +906,20 @@ test_session_write_wait_get_next_event (void) EventPipeEventPayload payload;; ep_event_payload_init (&payload, NULL, 0); - write_result = ep_session_write_event ((EventPipeSession *)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); + write_result = ep_session_write_event ((EventPipeSession *)(uintptr_t)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); ep_event_payload_fini (&payload); ep_raise_error_if_nok (write_result == true); test_location = 5; - EventPipeEventInstance *event_instance = ep_session_get_next_event ((EventPipeSession *)session_id); + EventPipeEventInstance *event_instance = ep_session_get_next_event ((EventPipeSession *)(uintptr_t)session_id); ep_raise_error_if_nok (event_instance != NULL); test_location = 6; - event_instance = ep_session_get_next_event ((EventPipeSession *)session_id); + event_instance = ep_session_get_next_event ((EventPipeSession *)(uintptr_t)session_id); ep_raise_error_if_nok (event_instance == NULL); @@ -970,14 +971,14 @@ test_session_write_get_next_event (void) // Starts as signaled. // TODO: Is this expected behavior, just a way to notify observer that we are up and running? - uint32_t test = ep_rt_wait_event_wait ((ep_rt_wait_event_handle_t *)ep_session_get_wait_event ((EventPipeSession *)session_id), 0, false); + uint32_t test = ep_rt_wait_event_wait ((ep_rt_wait_event_handle_t *)ep_session_get_wait_event ((EventPipeSession *)(uintptr_t)session_id), 0, false); ep_raise_error_if_nok (test == 0); test_location = 5; EventPipeEventPayload payload;; ep_event_payload_init (&payload, NULL, 0); - write_result = ep_session_write_event ((EventPipeSession *)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); + write_result = ep_session_write_event ((EventPipeSession *)(uintptr_t)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); ep_event_payload_fini (&payload); ep_raise_error_if_nok (write_result == true); @@ -986,17 +987,17 @@ test_session_write_get_next_event (void) // TODO: Is this really the correct behavior, first write signals event, meaning that buffer will converted to read only // with just one event in it. - test = ep_rt_wait_event_wait ((ep_rt_wait_event_handle_t *)ep_session_get_wait_event ((EventPipeSession *)session_id), 0, false); + test = ep_rt_wait_event_wait ((ep_rt_wait_event_handle_t *)ep_session_get_wait_event ((EventPipeSession *)(uintptr_t)session_id), 0, false); ep_raise_error_if_nok (test == 0); test_location = 7; - EventPipeEventInstance *event_instance = ep_session_get_next_event ((EventPipeSession *)session_id); + EventPipeEventInstance *event_instance = ep_session_get_next_event ((EventPipeSession *)(uintptr_t)session_id); ep_raise_error_if_nok (event_instance != NULL); test_location = 8; - event_instance = ep_session_get_next_event ((EventPipeSession *)session_id); + event_instance = ep_session_get_next_event ((EventPipeSession *)(uintptr_t)session_id); ep_raise_error_if_nok (event_instance == NULL); ep_on_exit: @@ -1047,7 +1048,7 @@ test_session_write_suspend_event (void) EventPipeEventPayload payload;; ep_event_payload_init (&payload, NULL, 0); - write_result = ep_session_write_event ((EventPipeSession *)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); + write_result = ep_session_write_event ((EventPipeSession *)(uintptr_t)session_id, ep_rt_thread_get_handle (), ep_event, &payload, NULL, NULL, NULL, NULL); ep_event_payload_fini (&payload); ep_raise_error_if_nok (write_result == true); diff --git a/src/native/eventpipe/ds-ipc.c b/src/native/eventpipe/ds-ipc.c index cfe1a2aa23425c..1256e3b00333cb 100644 --- a/src/native/eventpipe/ds-ipc.c +++ b/src/native/eventpipe/ds-ipc.c @@ -229,10 +229,18 @@ ipc_log_poll_handles (dn_vector_t *ipc_poll_handles) } DN_VECTOR_FOREACH_END; } +static +bool +EP_CALLBACK_CALLTYPE +ipc_stream_factory_callback (void) +{ + return ds_ipc_stream_factory_any_suspended_ports (); +} + bool ds_ipc_stream_factory_init (void) { - ep_ipc_stream_factory_callback_set (ds_ipc_stream_factory_any_suspended_ports); + ep_ipc_stream_factory_callback_set (ipc_stream_factory_callback); _ds_port_array = dn_vector_ptr_alloc (); return _ds_port_array != NULL; } diff --git a/src/native/eventpipe/ep-types-forward.h b/src/native/eventpipe/ep-types-forward.h index 308565900b5305..4e3b218291506d 100644 --- a/src/native/eventpipe/ep-types-forward.h +++ b/src/native/eventpipe/ep-types-forward.h @@ -175,9 +175,14 @@ typedef int64_t ep_system_timestamp_t; /* * EventPipe Callbacks. */ +#if defined(_WIN32) && defined(_M_IX86) +#define EP_CALLBACK_CALLTYPE __stdcall +#else +#define EP_CALLBACK_CALLTYPE +#endif // Define the event pipe callback to match the ETW callback signature. -typedef void (*EventPipeCallback)( +typedef void (EP_CALLBACK_CALLTYPE *EventPipeCallback)( const uint8_t *source_id, unsigned long is_enabled, uint8_t level, @@ -186,7 +191,7 @@ typedef void (*EventPipeCallback)( EventFilterDescriptor *filter_data, void *callback_data); -typedef void (*EventPipeSessionSynchronousCallback)( +typedef void (EP_CALLBACK_CALLTYPE *EventPipeSessionSynchronousCallback)( EventPipeProvider *provider, uint32_t event_id, uint32_t event_version, @@ -201,7 +206,7 @@ typedef void (*EventPipeSessionSynchronousCallback)( uintptr_t *stack_frames, void *additional_data); -typedef bool (*EventPipeIpcStreamFactorySuspendedPortsCallback)(void); +typedef bool (EP_CALLBACK_CALLTYPE *EventPipeIpcStreamFactorySuspendedPortsCallback)(void); #endif /* ENABLE_PERFTRACING */ #endif /* __EVENTPIPE_TYPES_FORWARD_H__ */ diff --git a/src/native/libs/Common/pal_compiler.h b/src/native/libs/Common/pal_compiler.h index 8a94cb64cccdd9..31d45a0c385be1 100644 --- a/src/native/libs/Common/pal_compiler.h +++ b/src/native/libs/Common/pal_compiler.h @@ -57,6 +57,14 @@ do_abort_unless (bool condition, const char* fmt, ...) #endif #endif // PALEXPORT +#ifndef PAL_CALLBACK_CALLTYPE +#if defined(_WIN32) && defined(_M_IX86) +#define PAL_CALLBACK_CALLTYPE __stdcall +#else +#define PAL_CALLBACK_CALLTYPE +#endif +#endif // PAL_CALLBACK_CALLTYPE + #ifndef EXTERN_C #ifdef __cplusplus #define EXTERN_C extern "C" diff --git a/src/native/libs/System.Globalization.Native/pal_calendarData.h b/src/native/libs/System.Globalization.Native/pal_calendarData.h index c6465791f7294e..f6cfbdef448a9f 100644 --- a/src/native/libs/System.Globalization.Native/pal_calendarData.h +++ b/src/native/libs/System.Globalization.Native/pal_calendarData.h @@ -67,7 +67,7 @@ typedef enum } CalendarDataType; // the function pointer definition for the callback used in EnumCalendarInfo -typedef void (*EnumCalendarInfoCallback)(const UChar*, const void*); +typedef void (PAL_CALLBACK_CALLTYPE *EnumCalendarInfoCallback)(const UChar*, const void*); PALEXPORT int32_t GlobalizationNative_GetCalendars(const UChar* localeName, CalendarId* calendars,