summaryrefslogtreecommitdiff
path: root/lib/tools/test
diff options
context:
space:
mode:
authorJohn Högberg <john@erlang.org>2020-01-08 10:14:18 +0100
committerJohn Högberg <john@erlang.org>2020-01-08 10:14:18 +0100
commit52412c598ad67786032d17762e8655ad3d6771b5 (patch)
treeb9cceca12d75f29df0e79fa7cbcef2690c31cc02 /lib/tools/test
parent817980e6adf0f32bc7c71dc724b6d87282c7c4ef (diff)
parent608230af6227c9a49bf64380a3e7acf34dc24c0b (diff)
downloaderlang-52412c598ad67786032d17762e8655ad3d6771b5.tar.gz
Merge branch 'john/erts/cleanup-allocator-statistics/OTP-16327'
* john/erts/cleanup-allocator-statistics/OTP-16327: erts: Include block types in allocation statistics instrument: Include allocation types in carrier statistics
Diffstat (limited to 'lib/tools/test')
-rw-r--r--lib/tools/test/instrument_SUITE.erl22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl
index f474669836..c1a5921e04 100644
--- a/lib/tools/test/instrument_SUITE.erl
+++ b/lib/tools/test/instrument_SUITE.erl
@@ -194,23 +194,19 @@ verify_carriers_output(#{ histogram_start := HistStart,
%% Do the carriers look alright?
CarrierSet = ordsets:from_list(AllCarriers),
Verified = [C || {AllocType,
+ InPool,
TotalSize,
UnscannedSize,
- AllocatedSize,
- AllocatedCount,
- InPool,
+ Allocations,
FreeBlockHist} = C <- CarrierSet,
is_atom(AllocType),
+ is_boolean(InPool),
is_integer(TotalSize), TotalSize >= 1,
is_integer(UnscannedSize), UnscannedSize < TotalSize,
UnscannedSize >= 0,
- is_integer(AllocatedSize), AllocatedSize < TotalSize,
- AllocatedSize >= 0,
- is_integer(AllocatedCount), AllocatedCount =< AllocatedSize,
- AllocatedCount >= 0,
- is_boolean(InPool),
+ is_list(Allocations),
tuple_size(FreeBlockHist) =:= HistWidth,
- carrier_block_check(AllocatedCount, FreeBlockHist)],
+ carrier_block_check(Allocations, FreeBlockHist)],
[] = ordsets:subtract(CarrierSet, Verified),
%% Do we have at least as many carriers as we've generated?
@@ -229,8 +225,12 @@ verify_carriers_output(#{ histogram_start := HistStart,
verify_carriers_output(#{}, {error, not_enabled}) ->
ok.
-carrier_block_check(AllocCount, FreeHist) ->
- %% A carrier must contain at least one block, and th. number of free blocks
+carrier_block_check(Allocations, FreeHist) ->
+ AllocCount = lists:foldl(fun({_Type, Count, _Size}, Acc) ->
+ Count + Acc
+ end, 0, Allocations),
+
+ %% A carrier must contain at least one block, and the number of free blocks
%% must not exceed the number of allocated blocks + 1.
FreeCount = hist_sum(FreeHist),