File 0664-Remove-HiPE-info-from-system_information.erl.patch of Package erlang

From 80df31514b3dcf8bd86d30fd35586147c4b37f39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@dashbit.co>
Date: Sat, 4 Feb 2023 16:46:18 +0100
Subject: [PATCH] Remove HiPE info from system_information.erl

---
 lib/runtime_tools/src/system_information.erl  | 40 -------------------
 .../test/system_information_SUITE.erl         |  1 -
 2 files changed, 41 deletions(-)

diff --git a/lib/runtime_tools/src/system_information.erl b/lib/runtime_tools/src/system_information.erl
index 507071fa2f..3743b641d9 100644
--- a/lib/runtime_tools/src/system_information.erl
+++ b/lib/runtime_tools/src/system_information.erl
@@ -38,7 +38,6 @@
          application/1, application/2,
          environment/0, environment/1,
          module/1, module/2,
-         modules/1,
          sanity_check/0]).
 
 %% gen_server callbacks
@@ -124,10 +123,6 @@ module(M) when is_atom(M) -> module(M, []).
 module(M, Opts) when is_atom(M), is_list(Opts) ->
     gen_server:call(?SERVER, {module, M, Opts}, infinity).
 
-modules(Opt) when is_atom(Opt) ->
-    gen_server:call(?SERVER, {modules, Opt}, infinity).
-
-
 -spec sanity_check() -> ok | {failed, Failures} when
       Application :: atom(),
       ApplicationVersion :: string(),
@@ -190,12 +185,6 @@ handle_call({module, M, Opts}, _From, #state{ report = Report } = S) ->
     print_modules_from_code(M, Mods, Opts),
     {reply, ok, S};
 
-handle_call({modules, native}, _From, #state{ report = Report } = S) ->
-    Codes = get_native_modules_from_code(get_value([code],Report)),
-    io:format("~p~n", [Codes]),
-    {reply, ok, S};
-
-
 handle_call(_Request, _From, State) ->
     {reply, ok, State}.
 
@@ -249,31 +238,6 @@ find_modules(M, [{M, _}=Info|Ms]) -> [Info|find_modules(M,Ms)];
 find_modules(M, [_|Ms]) -> find_modules(M, Ms);
 find_modules(_, []) -> [].
 
-get_native_modules_from_code([{application, {App, Info}}|Cs]) ->
-    case get_native_modules(get_value([modules], Info)) of
-	[] -> get_native_modules_from_code(Cs);
-	Mods ->
-	    Path = get_value([path], Info),
-	    Vsn  = get_value([vsn], Info),
-	    [{App, Vsn, Path, Mods}|get_native_modules_from_code(Cs)]
-    end;
-get_native_modules_from_code([{code, Info}|Cs]) ->
-    case get_native_modules(get_value([modules], Info)) of
-	[] -> get_native_modules_from_code(Cs);
-	Mods ->
-	    Path = get_value([path], Info),
-	    [{Path, Mods}|get_native_modules_from_code(Cs)]
-    end;
-get_native_modules_from_code([]) -> [].
-
-get_native_modules([]) -> [];
-get_native_modules([{Mod, Info}|Ms]) ->
-    case proplists:get_value(native, Info) of
-	false -> get_native_modules(Ms);
-	_     -> [Mod|get_native_modules(Ms)]
-    end.
-
-
 %% print information
 
 print_applications([{application, App}|Apps], Opts) ->
@@ -320,14 +284,12 @@ print_module_from_code(M, {Path, [{M,ModInfo}]}) ->
     io:format(" from path \"~ts\" (no application):~n", [Path]),
     io:format("     - compiler: ~s~n", [get_value([compiler], ModInfo)]),
     io:format("     -      md5: ~s~n", [get_value([md5], ModInfo)]),
-    io:format("     -   native: ~w~n", [get_value([native], ModInfo)]),
     io:format("     -   loaded: ~w~n", [get_value([loaded], ModInfo)]),
     ok;
 print_module_from_code(M, {App,Vsn,Path,[{M,ModInfo}]}) ->
     io:format(" from path \"~ts\" (~w-~s):~n", [Path,App,Vsn]),
     io:format("     - compiler: ~s~n", [get_value([compiler], ModInfo)]),
     io:format("     -      md5: ~s~n", [get_value([md5], ModInfo)]),
-    io:format("     -   native: ~w~n", [get_value([native], ModInfo)]),
     io:format("     -   loaded: ~w~n", [get_value([loaded], ModInfo)]),
     ok.
 
@@ -335,7 +297,6 @@ print_module({Mod, ModInfo}) ->
     io:format("   - ~w:~n", [Mod]),
     io:format("     - compiler: ~s~n", [get_value([compiler], ModInfo)]),
     io:format("     -      md5: ~s~n", [get_value([md5], ModInfo)]),
-    io:format("     -   native: ~w~n", [get_value([native], ModInfo)]),
     io:format("     -   loaded: ~w~n", [get_value([loaded], ModInfo)]),
     ok.
 
@@ -571,7 +532,6 @@ emit_module_info(EmitChunk, Beam) ->
 
     EmitChunk("{~w,["
                   "{loaded,~w},"
-                  "{native,false},"
                   "{compiler,~w},"
                   "{md5,~w}"
               "]}",
diff --git a/lib/runtime_tools/test/system_information_SUITE.erl b/lib/runtime_tools/test/system_information_SUITE.erl
index b8a8ca9a39..6870d95b40 100644
--- a/lib/runtime_tools/test/system_information_SUITE.erl
+++ b/lib/runtime_tools/test/system_information_SUITE.erl
@@ -293,7 +293,6 @@ validate_loaded_report() ->
     ok = system_information:application(kernel,[full]),
     ok = system_information:module(gen_server),
     ok = system_information:module(gen_server,[full]),
-    ok = system_information:modules(native),
     ok.
 
 
-- 
2.35.3

openSUSE Build Service is sponsored by