From eb9a1281a2431ca354b21950643c2404baa88290 Mon Sep 17 00:00:00 2001 From: sanjam panda Date: Tue, 9 Jun 2026 11:47:30 +0000 Subject: [PATCH 1/3] [Eventpipe][S390X] Fix Session_Id for s390x while sending a StopTracingCommand the payload consists the session_id which is not passed in the correct endian order to ep_disable which in-turn keeps the tracing going on indefinitely --- src/native/eventpipe/ds-eventpipe-protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/eventpipe/ds-eventpipe-protocol.c b/src/native/eventpipe/ds-eventpipe-protocol.c index 7cf83b863737d7..43835f39ba4305 100644 --- a/src/native/eventpipe/ds-eventpipe-protocol.c +++ b/src/native/eventpipe/ds-eventpipe-protocol.c @@ -871,7 +871,7 @@ eventpipe_protocol_helper_stop_tracing ( ep_raise_error (); } - ep_disable (payload->session_id); + ep_disable (ep_rt_val_uint64_t((uint64_t)payload->session_id)); eventpipe_protocol_helper_send_stop_tracing_success (stream, payload->session_id); ds_ipc_stream_flush (stream); From e84715a9b5a861d33c2f9303f63d92594743d92c Mon Sep 17 00:00:00 2001 From: sanjam panda Date: Fri, 19 Jun 2026 07:23:30 +0000 Subject: [PATCH 2/3] add helper function for EventPipeStopTracingCommandPayload session_id --- src/native/eventpipe/ds-eventpipe-protocol.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/native/eventpipe/ds-eventpipe-protocol.c b/src/native/eventpipe/ds-eventpipe-protocol.c index 43835f39ba4305..d03fbf37f26f70 100644 --- a/src/native/eventpipe/ds-eventpipe-protocol.c +++ b/src/native/eventpipe/ds-eventpipe-protocol.c @@ -854,6 +854,15 @@ eventpipe_protocol_helper_send_start_tracing_success ( return result; } +static +uint8_t * +eventpipe_protocol_helper_stop_tracing_try_parse_payload(uint8_t *buffer, uint16_t buffer_len) +{ + uint64_t session_id = ep_rt_val_uint64_t(*(uint64_t*)buffer); + *(uint64_t*)buffer = session_id; + return buffer; +} + static bool eventpipe_protocol_helper_stop_tracing ( @@ -864,14 +873,14 @@ eventpipe_protocol_helper_stop_tracing ( bool result = false; EventPipeStopTracingCommandPayload *payload; - payload = (EventPipeStopTracingCommandPayload *)ds_ipc_message_try_parse_payload (message, NULL); + payload = (EventPipeStopTracingCommandPayload *)ds_ipc_message_try_parse_payload (message, eventpipe_protocol_helper_stop_tracing_try_parse_payload); if (!payload) { ds_ipc_message_send_error (stream, DS_IPC_E_BAD_ENCODING); ep_raise_error (); } - ep_disable (ep_rt_val_uint64_t((uint64_t)payload->session_id)); + ep_disable (payload->session_id); eventpipe_protocol_helper_send_stop_tracing_success (stream, payload->session_id); ds_ipc_stream_flush (stream); From a68c76b5429e27c6e673adf698970888f1486fb2 Mon Sep 17 00:00:00 2001 From: sanjam panda Date: Fri, 19 Jun 2026 18:28:51 +0000 Subject: [PATCH 3/3] change helper method and conform to other tryparse_payload methods --- src/native/eventpipe/ds-eventpipe-protocol.c | 29 +++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/native/eventpipe/ds-eventpipe-protocol.c b/src/native/eventpipe/ds-eventpipe-protocol.c index d03fbf37f26f70..335c34742d9536 100644 --- a/src/native/eventpipe/ds-eventpipe-protocol.c +++ b/src/native/eventpipe/ds-eventpipe-protocol.c @@ -156,6 +156,12 @@ eventpipe_collect_tracing5_command_try_parse_payload ( uint8_t *buffer, uint16_t buffer_len); +static +uint8_t * +eventpipe_protocol_helper_stop_tracing_try_parse_payload ( + uint8_t *buffer, + uint16_t buffer_len); + static bool eventpipe_protocol_helper_stop_tracing ( @@ -858,9 +864,24 @@ static uint8_t * eventpipe_protocol_helper_stop_tracing_try_parse_payload(uint8_t *buffer, uint16_t buffer_len) { - uint64_t session_id = ep_rt_val_uint64_t(*(uint64_t*)buffer); - *(uint64_t*)buffer = session_id; - return buffer; + EP_ASSERT (buffer != NULL); + + uint8_t * buffer_cursor = buffer; + uint32_t buffer_cursor_len = buffer_len; + + EventPipeStopTracingCommandPayload *instance = ep_rt_object_alloc (EventPipeStopTracingCommandPayload); + ep_raise_error_if_nok (instance != NULL); + + ep_raise_error_if_nok (ds_ipc_message_try_parse_uint64_t (&buffer_cursor, &buffer_cursor_len, &instance->session_id)); + +ep_on_exit: + ep_rt_byte_array_free (buffer); + return (uint8_t *)instance; + +ep_on_error: + ds_eventpipe_stop_tracing_command_payload_free (instance); + instance = NULL; + ep_exit_error_handler (); } static @@ -975,7 +996,7 @@ void ds_eventpipe_stop_tracing_command_payload_free (EventPipeStopTracingCommandPayload *payload) { ep_return_void_if_nok (payload != NULL); - ep_rt_byte_array_free ((uint8_t *)payload); + ep_rt_object_free (payload); } bool