File 3046-Add-sys_debug-option-for-debugging-the-state-machine.patch of Package erlang
From 20b1437bb3965c73e6e432aededa95a7dae66101 Mon Sep 17 00:00:00 2001
From: Raimo Niskanen <raimo@erlang.org>
Date: Mon, 11 Mar 2024 11:24:14 +0100
Subject: [PATCH 16/22] Add sys_debug option for debugging the state machine
---
lib/kernel/src/gen_tcp_socket.erl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/kernel/src/gen_tcp_socket.erl b/lib/kernel/src/gen_tcp_socket.erl
index d074eed586..60546e36f2 100644
--- a/lib/kernel/src/gen_tcp_socket.erl
+++ b/lib/kernel/src/gen_tcp_socket.erl
@@ -676,7 +676,13 @@ cancel_monitor(MRef) ->
%% -------------------------------------------------------------------------
+%% Undocumented option for debugging the state machine
+%% that mustn't be counted on
+setopts(?MODULE_socket(Server, _Socket), [{sys_trace,T}]) ->
+ sys:trace(Server, T);
+%%
setopts(?MODULE_socket(Server, _Socket), [{active,Active}]) ->
+ %% Optimized implementation
call(Server, {setopt_active,Active});
setopts(?MODULE_socket(Server, _Socket), Opts) when is_list(Opts) ->
try internalize_setopts(Opts) of
--
2.35.3