<PackageReference Include="$(MicrosoftNETCoreRuntimeICUTransportPackage)" PrivateAssets="all" Version="$(MicrosoftNETCoreRuntimeICUTransportVersion)" GeneratePathProperty="true" />
</ItemGroup>
+ <!-- CI specific build options -->
+ <ItemGroup Condition="'$(ContinuousIntegrationBuild)' == 'true' and ('$(TargetsOSX)' == 'true')">
+ <_MonoCMakeArgs Include="-DENABLE_WERROR=1"/>
+ </ItemGroup>
+
<!-- Sanity checks -->
<Target Name="CheckEnv">
<Error Condition="'$(TargetstvOS)' == 'true' and '$(Platform)' != 'x64' and '$(Platform)' != 'arm64'" Text="Error: Invalid platform for $(TargetOS): $(Platform)." />
typedef MonoThreadStart ep_rt_thread_start_func;
typedef mono_thread_start_return_t ep_rt_thread_start_func_return_t;
-typedef MonoNativeThreadId ep_rt_thread_id_t;
typedef EventPipeThreadHolder * (*ep_rt_thread_holder_alloc_func)(void);
typedef void (*ep_rt_thread_holder_free_func)(EventPipeThreadHolder *thread_holder);
static
inline
-size_t
+ep_rt_thread_id_t
ep_rt_current_thread_get_id (void)
{
#ifdef EP_RT_MONO_USE_STATIC_RUNTIME
- return MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ());
+ return mono_native_thread_id_get ();
#else
- return MONO_NATIVE_THREAD_ID_TO_UINT (ep_rt_mono_func_table_get ()->ep_rt_mono_native_thread_id_get ());
+ return ep_rt_mono_func_table_get ()->ep_rt_mono_native_thread_id_get ();
#endif
}
static
inline
-size_t
+ep_rt_thread_id_t
ep_rt_thread_get_id (ep_rt_thread_handle_t thread_handle)
{
- return MONO_NATIVE_THREAD_ID_TO_UINT (mono_thread_info_get_tid (thread_handle));
+ return mono_thread_info_get_tid (thread_handle);
+}
+
+static
+inline
+uint64_t
+ep_rt_thread_id_t_to_uint64_t (ep_rt_thread_id_t thread_id)
+{
+ return (uint64_t)MONO_NATIVE_THREAD_ID_TO_UINT (thread_id);
+}
+
+static
+inline
+ep_rt_thread_id_t
+ep_rt_uint64_t_to_thread_id_t (uint64_t thread_id)
+{
+ return MONO_UINT_TO_NATIVE_THREAD_ID (thread_id);
}
static
typedef struct _rt_mono_lock_internal_t ep_rt_lock_handle_t;
typedef ep_rt_lock_handle_t ep_rt_spin_lock_handle_t;
+typedef MonoNativeThreadId ep_rt_thread_id_t;
+
#endif /* ENABLE_PERFTRACING */
#endif /* __EVENTPIPE_RT_TYPES_MONO_H__ */
static MonoFDHandleCallback fds_callback[MONO_FDTYPE_COUNT];
static mono_lazy_init_t fds_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
+#ifndef DISABLE_ASSERT_MESSAGES
static const gchar *types_str[] = {
"File",
"Console",
"Socket",
NULL
};
+#endif
static void
fds_remove (gpointer data)
return_val_if_nok (error, -1);
return mono_security_core_clr_class_level (klass);
}
-#endif
int
ves_icall_RuntimeFieldInfo_get_core_clr_security_level (MonoReflectionFieldHandle rfield, MonoError *error)
MonoMethod *method = MONO_HANDLE_GETVAL (rfield, method);
return mono_security_core_clr_method_level (method, TRUE);
}
+#endif
MonoStringHandle
ves_icall_System_Reflection_RuntimeAssembly_get_fullname (MonoReflectionAssemblyHandle assembly, MonoError *error)
}
#endif /* HOST_WIN32 */
+#ifndef ENABLE_NETCORE
gpointer
ves_icall_System_Reflection_RuntimeModule_GetHINSTANCE (MonoImage *image, MonoError *error)
{
return mono_icall_module_get_hinstance (image);
}
+#endif
void
ves_icall_System_Reflection_RuntimeModule_GetPEKind (MonoImage *image, gint32 *pe_kind, gint32 *machine, MonoError *error)
}
if (first_set < 0) {
- SGEN_LOG (6, "Ptrfree descriptor %p, size: %ld", (void*)desc, (long)stored_size);
+ SGEN_LOG (6, "Ptrfree descriptor %" PRIu64 ", size: %zu", (uint64_t)desc, stored_size);
if (stored_size <= MAX_RUNLEN_OBJECT_SIZE && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE)
return DESC_TYPE_SMALL_PTRFREE | stored_size;
return DESC_TYPE_COMPLEX_PTRFREE;
/* we know the 2-word header is ptr-free */
if (last_set < BITMAP_NUM_BITS + OBJECT_HEADER_WORDS && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) {
desc = DESC_TYPE_BITMAP | ((*bitmap >> OBJECT_HEADER_WORDS) << LOW_TYPE_BITS);
- SGEN_LOG (6, "Largebitmap descriptor %p, size: %ld, last set: %d", (void*)desc, (long)stored_size, last_set);
+ SGEN_LOG (6, "Largebitmap descriptor %" PRIu64 ", size: %zu, last set: %d", (uint64_t)desc, stored_size, last_set);
return desc;
}
*/
if (first_set < 256 && num_set < 256 && (first_set + num_set == last_set + 1)) {
desc = DESC_TYPE_RUN_LENGTH | stored_size | (first_set << 16) | (num_set << 24);
- SGEN_LOG (6, "Runlen descriptor %p, size: %ld, first set: %d, num set: %d", (void*)desc, (long)stored_size, first_set, num_set);
+ SGEN_LOG (6, "Runlen descriptor %" PRIu64 ", size: %zu, first set: %d, num set: %d", (uint64_t)desc, stored_size, first_set, num_set);
return desc;
}
}
ds_rt_auto_trace_init ();
ds_rt_auto_trace_launch ();
- ep_rt_thread_id_t thread_id = 0;
+ ep_rt_thread_id_t thread_id = ep_rt_uint64_t_to_thread_id_t (0);
if (!ep_rt_thread_create ((void *)server_thread, NULL, EP_THREAD_TYPE_SERVER, (void *)&thread_id)) {
// Failed to create IPC thread.
if (buffer_manager->current_event == NULL)
break;
- size_t capture_thread_id = ep_thread_get_os_thread_id (ep_buffer_get_writer_thread (buffer_manager->current_buffer));
+ uint64_t capture_thread_id = ep_thread_get_os_thread_id (ep_buffer_get_writer_thread (buffer_manager->current_buffer));
EventPipeBufferList *buffer_list = buffer_manager->current_buffer_list;
(EventPipeEventInstance *)buffer->current,
ep_event,
proc_number,
- (thread == NULL) ? ep_rt_current_thread_get_id () : ep_rt_thread_get_id (thread),
+ ep_rt_thread_id_t_to_uint64_t((thread == NULL) ? ep_rt_current_thread_get_id () : ep_rt_thread_get_id (thread)),
data_dest,
ep_event_payload_get_size (payload),
(thread == NULL) ? NULL : activity_id,
instance = ep_event_metdata_event_alloc (
config->metadata_event,
ep_rt_current_processor_get_number (),
- ep_rt_current_thread_get_id (),
+ ep_rt_thread_id_t_to_uint64_t (ep_rt_current_thread_get_id ()),
instance_payload,
instance_payload_size,
NULL /* pActivityId */,
ep_event_get_event_version (ep_event_instance->ep_event));
if (characters_written > 0 && characters_written < EP_ARRAY_SIZE (buffer))
- ep_json_file_write_event_data (json_file, ep_event_instance->timestamp, (ep_rt_thread_id_t)(ep_event_instance->thread_id), buffer, &ep_event_instance->stack_contents);
+ ep_json_file_write_event_data (json_file, ep_event_instance->timestamp, ep_rt_uint64_t_to_thread_id_t (ep_event_instance->thread_id), buffer, &ep_event_instance->stack_contents);
}
#else
void
#include "ep.h"
#include "ep-event-instance.h"
#include "ep-rt.h"
+#include <inttypes.h>
#ifdef EP_CHECKED_BUILD
json_file_write_string (json_file, buffer);
}
- characters_written = ep_rt_utf8_string_snprintf (buffer, EP_ARRAY_SIZE (buffer), "\"Thread (%ld)\"]},", (uint64_t)thread_id);
+ characters_written = ep_rt_utf8_string_snprintf (buffer, EP_ARRAY_SIZE (buffer), "\"Thread (%" PRIu64 ")\"]},", ep_rt_thread_id_t_to_uint64_t (thread_id));
if (characters_written > 0 && characters_written < EP_ARRAY_SIZE (buffer))
json_file_write_string (json_file, buffer);
}
ep_rt_processors_get_count (void);
static
-size_t
+ep_rt_thread_id_t
ep_rt_current_thread_get_id (void);
static
ep_rt_thread_get_handle (void);
static
-size_t
+ep_rt_thread_id_t
ep_rt_thread_get_id (ep_rt_thread_handle_t thread_handle);
static
+uint64_t
+ep_rt_thread_id_t_to_uint64_t (ep_rt_thread_id_t thread_id);
+
+static
+ep_rt_thread_id_t
+ep_rt_uint64_t_to_thread_id_t (uint64_t thread_id);
+
+static
bool
ep_rt_thread_has_started (ep_rt_thread_handle_t thread_handle);
if (!ep_rt_wait_event_is_valid (&_thread_shutdown_event))
EP_ASSERT (!"Unable to create sample profiler event.");
- ep_rt_thread_id_t thread_id = 0;
+ ep_rt_thread_id_t thread_id = ep_rt_uint64_t_to_thread_id_t (0);
if (!ep_rt_thread_create (sampling_thread, NULL, EP_THREAD_TYPE_SAMPLING, &thread_id))
EP_ASSERT (!"Unable to create sample profiler thread.");
if (!ep_rt_wait_event_is_valid (&session->rt_thread_shutdown_event))
EP_ASSERT (!"Unable to create IPC stream flushing thread shutdown event.");
- ep_rt_thread_id_t thread_id = 0;
+ ep_rt_thread_id_t thread_id = ep_rt_uint64_t_to_thread_id_t (0);
if (!ep_rt_thread_create ((void *)streaming_thread, (void *)session, EP_THREAD_TYPE_SESSION, &thread_id))
EP_ASSERT (!"Unable to create IPC stream flushing thread.");
}
ep_rt_spin_lock_alloc (&instance->rt_lock);
ep_raise_error_if_nok (ep_rt_spin_lock_is_valid (&instance->rt_lock));
- instance->os_thread_id = ep_rt_current_thread_get_id ();
+ instance->os_thread_id = ep_rt_thread_id_t_to_uint64_t (ep_rt_current_thread_get_id ());
memset (instance->session_state, 0, sizeof (instance->session_state));
EP_SPIN_LOCK_ENTER (&_ep_threads_lock, section1)
ep_rt_spin_lock_handle_t rt_lock;
// This is initialized when the Thread object is first constructed and remains
// immutable afterwards.
- size_t os_thread_id;
+ uint64_t os_thread_id;
// The EventPipeThreadHolder maintains one count while the thread is alive
// and each session's EventPipeBufferList maintains one count while it
// exists.
EP_DEFINE_GETTER(EventPipeThread *, thread, EventPipeSession *, rundown_session);
EP_DEFINE_SETTER(EventPipeThread *, thread, EventPipeSession *, rundown_session);
EP_DEFINE_GETTER_REF(EventPipeThread *, thread, ep_rt_spin_lock_handle_t *, rt_lock);
-EP_DEFINE_GETTER(EventPipeThread *, thread, size_t, os_thread_id);
+EP_DEFINE_GETTER(EventPipeThread *, thread, uint64_t, os_thread_id);
EP_DEFINE_GETTER_REF(EventPipeThread *, thread, int32_t *, ref_count);
EventPipeThread *