File 0898-erts-Add-printouts-for-debugging-walltime-stats-test.patch of Package erlang

From f018c6f2584c57b5a052b915426b7f004aa70794 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Tue, 9 Jun 2020 10:08:18 +0200
Subject: [PATCH 14/18] erts: Add printouts for debugging walltime stats tests

---
 erts/emulator/test/statistics_SUITE.erl | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl
index 65a675e8d2..90fbedb94a 100644
--- a/erts/emulator/test/statistics_SUITE.erl
+++ b/erts/emulator/test/statistics_SUITE.erl
@@ -341,6 +341,21 @@ run_scheduler_wall_time_test(Type) ->
                                     Schedulers + DirtyCPUSchedulers
                         end,
 
+        Env = [io_lib:format("~s~n",[KV]) || KV <- os:getenv()],
+
+        ct:log("Env:~n~s",[Env]),
+
+        ct:log("Schedulers:               ~p~n"
+               "SchedulersOnline:         ~p~n"
+               "DirtyCPUSchedulers:       ~p~n"
+               "DirtyCPUSchedulersOnline: ~p~n"
+               "DirtyIOSchedulersOnline:  ~p~n",
+               [erlang:system_info(schedulers),
+                Schedulers,
+                erlang:system_info(dirty_cpu_schedulers),
+                DirtyCPUSchedulers,
+                DirtyIOSchedulers]),
+
         %% Let testserver and everyone else finish their work
         timer:sleep(1500),
         %% Empty load
@@ -376,7 +391,9 @@ run_scheduler_wall_time_test(Type) ->
                             || _ <- lists:seq(1, lists:max([1,DirtyCPUSchedulers div 2]))],
         HalfDirtyIOHogs = [StartDirtyHog(dirty_io)
                            || _ <- lists:seq(1, lists:max([1,DirtyIOSchedulers div 2]))],
-        HalfLoad = lists:sum(get_load(Type)) div TotLoadSchedulers,
+        HalfScheds = get_load(Type),
+        ct:log("HalfScheds: ~w",[HalfScheds]),
+        HalfLoad = lists:sum(HalfScheds) div TotLoadSchedulers,
         if Schedulers =:= 1, HalfLoad > 80 -> ok; %% Ok only one scheduler online and one hog
            %% We want roughly 50% load
            HalfLoad > 40, HalfLoad < 60 -> ok;
@@ -395,6 +412,7 @@ run_scheduler_wall_time_test(Type) ->
                            || _ <- lists:seq(1, (DirtyIOSchedulers+1) div 2),
                                    DirtyIOSchedulers =/= 1],
         FullScheds = get_load(Type),
+        ct:log("FullScheds: ~w",[FullScheds]),
         {false,_} = {lists:any(fun(Load) -> Load < 80 end, FullScheds),FullScheds},
         FullLoad = lists:sum(FullScheds) div TotLoadSchedulers,
         if FullLoad > 90 -> ok;
@@ -438,6 +456,7 @@ online_statistics(Stats) ->
     DirtyCPUSchedulersOnline = erlang:system_info(dirty_cpu_schedulers_online),
     DirtyIOSchedulersOnline = erlang:system_info(dirty_io_schedulers),
     SortedStats = lists:sort(Stats),
+    ct:pal("Stats: ~p~n", [SortedStats]),
     SchedulersStats =
         lists:sublist(SortedStats, 1, SchedulersOnline),
     DirtyCPUSchedulersStats =
-- 
2.26.2

openSUSE Build Service is sponsored by