Skip to content

Commit c21da68

Browse files
committed
Merge branch 'bmk/kernel/20230112/solaris_host_analyzis' into maint
2 parents 31d5f6c + 7ddc956 commit c21da68

File tree

1 file changed

+43
-25
lines changed

1 file changed

+43
-25
lines changed

lib/kernel/test/kernel_test_lib.erl

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,35 +1785,36 @@ analyze_and_print_solaris_host_info(Version) ->
17851785
NumPhysCPU, NumVCPU,
17861786
SysConf, MemSz,
17871787
str_num_schedulers()]),
1788-
io:format("TS Scale Factor: ~w~n"
1789-
"TS Extra Platform Label: ~s~n",
1790-
[timetrap_scale_factor(), Label]),
1791-
MemFactor =
1788+
AddMemFactor =
17921789
try string:tokens(MemSz, [$ ]) of
17931790
[SzStr, "Mega" ++ _] ->
17941791
try list_to_integer(SzStr) of
1795-
Sz when Sz > 8192 ->
1792+
Sz when Sz > 16384 ->
17961793
0;
1797-
Sz when Sz > 4096 ->
1794+
Sz when Sz > 8192 ->
17981795
1;
1796+
Sz when Sz > 4096 ->
1797+
4;
17991798
Sz when Sz > 2048 ->
1800-
2;
1799+
8;
18011800
_ ->
1802-
5
1801+
12
18031802
catch
18041803
_:_:_ ->
18051804
10
18061805
end;
18071806
[SzStr, "Giga" ++ _] ->
18081807
try list_to_integer(SzStr) of
1809-
Sz when Sz > 8 ->
1808+
Sz when Sz > 16 ->
18101809
0;
1811-
Sz when Sz > 4 ->
1810+
Sz when Sz > 8 ->
18121811
1;
1812+
Sz when Sz > 4 ->
1813+
4;
18131814
Sz when Sz > 2 ->
1814-
2;
1815+
8;
18151816
_ ->
1816-
5
1817+
12
18171818
catch
18181819
_:_:_ ->
18191820
10
@@ -1824,19 +1825,36 @@ analyze_and_print_solaris_host_info(Version) ->
18241825
_:_:_ ->
18251826
10
18261827
end,
1827-
{try erlang:system_info(schedulers) of
1828-
1 ->
1829-
10;
1830-
2 ->
1831-
5;
1832-
N when (N =< 6) ->
1833-
2;
1834-
_ ->
1835-
1
1836-
catch
1837-
_:_:_ ->
1838-
10
1839-
end + MemFactor + AddLabelFactor, []}.
1828+
%% We don't really have enough info about the CPU to calculate the
1829+
%% base factor based on that, so we just use the number of schedulers.
1830+
BaseFactor =
1831+
try erlang:system_info(schedulers) of
1832+
1 ->
1833+
12;
1834+
2 ->
1835+
8;
1836+
N when (N =:= 3) orelse (N =:= 4) ->
1837+
4;
1838+
N when (N =< 6) ->
1839+
3;
1840+
_ ->
1841+
2
1842+
catch
1843+
_:_:_ ->
1844+
12
1845+
end,
1846+
TSScaleFactor = ts_scale_factor(),
1847+
io:format("Factor calc:"
1848+
"~n Base Factor: ~w"
1849+
"~n Label Factor: ~w"
1850+
"~n Mem Factor: ~w"
1851+
"~n TS Scale Factor: ~w"
1852+
"~n TS Extra Platform Label: ~s"
1853+
"~n~n",
1854+
[BaseFactor, AddLabelFactor, AddMemFactor,
1855+
TSScaleFactor, Label]),
1856+
{BaseFactor + AddMemFactor + AddLabelFactor + TSScaleFactor,
1857+
[{label, Label}]}.
18401858

18411859
analyze_and_print_win_host_info(Version) ->
18421860
Label = ts_extra_platform_label(),

0 commit comments

Comments
 (0)