Skip to content

Commit 5103de3

Browse files
committed
Add server_loop logs
1 parent 9bc0e94 commit 5103de3

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/coreclr/vm/ceemain.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,10 @@ void EEStartupHelper()
715715
}
716716
#endif
717717

718+
#ifdef LOGGING
719+
InitializeLogging();
720+
#endif
721+
718722
#ifdef FEATURE_PERFTRACING
719723
DiagnosticServerAdapter::Initialize();
720724
DiagnosticServerAdapter::PauseForDiagnosticsMonitor();
@@ -735,10 +739,6 @@ void EEStartupHelper()
735739

736740
InitGSCookie();
737741

738-
#ifdef LOGGING
739-
InitializeLogging();
740-
#endif
741-
742742
#ifdef FEATURE_PERFMAP
743743
PerfMap::Initialize();
744744
InitThreadManagerPerfMapData();

src/native/eventpipe/ds-server.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static volatile uint32_t _server_shutting_down_state = 0;
2121
static ep_rt_wait_event_handle_t _server_resume_runtime_startup_event = { 0 };
2222
static bool _server_disabled = false;
2323
static volatile bool _is_paused_for_startup = false;
24+
static volatile bool _server_loop_initialized = false;
2425

2526
static
2627
inline
@@ -113,6 +114,10 @@ server_warning_callback (
113114
}
114115

115116
static size_t server_loop_tick (void* data) {
117+
if (!_server_loop_initialized) {
118+
_server_loop_initialized = true;
119+
DS_LOG_INFO_0 ("DiagnosticServer - IPC server loop initialized.");
120+
}
116121
if (server_volatile_load_shutting_down_state ())
117122
return 1; // done
118123
DiagnosticsIpcStream *stream = ds_ipc_stream_factory_get_next_available_stream (server_warning_callback);
@@ -122,10 +127,13 @@ static size_t server_loop_tick (void* data) {
122127
ds_rt_auto_trace_signal ();
123128

124129
DiagnosticsIpcMessage message;
125-
if (!ds_ipc_message_init (&message))
130+
if (!ds_ipc_message_init (&message)) {
131+
DS_LOG_INFO_0 ("DiagnosticServer - Failed to initialize IPC message.");
126132
return 0; // continue
133+
}
127134

128135
if (!ds_ipc_message_initialize_stream (&message, stream)) {
136+
DS_LOG_INFO_0 ("DiagnosticServer - Failed to initialize IPC message from stream.");
129137
ds_ipc_message_send_error (stream, DS_IPC_E_BAD_ENCODING);
130138
ds_ipc_stream_free (stream);
131139
ds_ipc_message_fini (&message);
@@ -135,7 +143,7 @@ static size_t server_loop_tick (void* data) {
135143
if (ep_rt_utf8_string_compare (
136144
(const ep_char8_t *)ds_ipc_header_get_magic_ref (ds_ipc_message_get_header_ref (&message)),
137145
(const ep_char8_t *)DOTNET_IPC_V1_MAGIC) != 0) {
138-
146+
DS_LOG_INFO_0 ("DiagnosticServer - Received IPC message with unknown magic.");
139147
ds_ipc_message_send_error (stream, DS_IPC_E_UNKNOWN_MAGIC);
140148
ds_ipc_stream_free (stream);
141149
ds_ipc_message_fini (&message);

0 commit comments

Comments
 (0)