diff --git a/lib/tools/src/lcnt.erl b/lib/tools/src/lcnt.erl index 3f443d0c5788..840e7621ecde 100644 --- a/lib/tools/src/lcnt.erl +++ b/lib/tools/src/lcnt.erl @@ -959,7 +959,7 @@ summate_stats([S|Ss], #stats{ tries = Tries, colls = Colls, time = Time, nt = Nt summate_histogram(Tup,undefined) when is_tuple(Tup) -> Tup; summate_histogram(undefined,Tup) when is_tuple(Tup) -> Tup; summate_histogram(Hs1,Hs2) -> - list_to_tuple([ A + B || {A,B} <- lists:zip(tuple_to_list(Hs1),tuple_to_list(Hs2))]). + list_to_tuple([A + B || A <- tuple_to_list(Hs1) && B <- tuple_to_list(Hs2)]). %% manipulators filter_locks_type(Locks, undefined) -> Locks; diff --git a/lib/tools/src/tprof.erl b/lib/tools/src/tprof.erl index 134e9c6596c7..23e161358778 100644 --- a/lib/tools/src/tprof.erl +++ b/lib/tools/src/tprof.erl @@ -1123,12 +1123,14 @@ format_impl(Device, {Type, Total, Inspected}) -> format_each(Device, Type, Total, Inspected). format_each(Device, call_count, _Total, Inspected) -> - {Widths, Lines} = lists:foldl( - fun ({Mod, {F, A}, Calls, _Value, _VPC, Percent}, {Widths, Ln}) -> - Line = [lists:flatten(io_lib:format("~tw:~tw/~w", [Mod, F, A])), - integer_to_list(Calls), float_to_list(Percent, [{decimals, 2}])], - NewWidths = [erlang:max(Old, New) || {Old, New} <- lists:zip([string:length(L) || L <- Line], Widths)], - {NewWidths, [Line | Ln]} + {Widths, Lines} = + lists:foldl( + fun ({Mod, {F, A}, Calls, _Value, _VPC, Percent}, {Widths, Ln}) -> + Line = [lists:flatten(io_lib:format("~tw:~tw/~w", [Mod, F, A])), + integer_to_list(Calls), float_to_list(Percent, [{decimals, 2}])], + NewWidths = [max(Old, New) || + Old <- [string:length(L) || L <- Line] && New <- Widths], + {NewWidths, [Line | Ln]} end, {[0, 5, 5], []}, Inspected), %% figure out formatting line @@ -1146,15 +1148,17 @@ format_labelled(Device, Label, Total, Inspected) -> %% The width of the value is either total or label ValueWidth = erlang:max(length(Label), length(integer_to_list(Total))), - {Widths, Lines} = lists:foldl( - fun ({Mod, {F, A}, Calls, Value, VPC, Percent}, {Widths, Ln}) -> - Line = [lists:flatten(io_lib:format("~tw:~tw/~w", [Mod, F, A])), - integer_to_list(Calls), integer_to_list(Value), - float_to_list(VPC, [{decimals, 2}]), - float_to_list(Percent, [{decimals, 2}])], - NewWidths = [erlang:max(Old, New) || {Old, New} <- lists:zip([string:length(L) || L <- Line], Widths)], - {NewWidths, [Line | Ln]} - end, {[0, 5, ValueWidth, 8, 5], []}, Inspected), + {Widths, Lines} = + lists:foldl( + fun ({Mod, {F, A}, Calls, Value, VPC, Percent}, {Widths, Ln}) -> + Line = [lists:flatten(io_lib:format("~tw:~tw/~w", [Mod, F, A])), + integer_to_list(Calls), integer_to_list(Value), + float_to_list(VPC, [{decimals, 2}]), + float_to_list(Percent, [{decimals, 2}])], + NewWidths = [max(Old, New) || + Old <- [string:length(L) || L <- Line] && New <- Widths], + {NewWidths, [Line | Ln]} + end, {[0, 5, ValueWidth, 8, 5], []}, Inspected), %% figure out formatting line Fmt = lists:flatten(io_lib:format("~~.~wts ~~~ws ~~~wts ~~~ws [~~~ws]~~n", Widths)),