mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-25 22:00:32 +00:00
core: improve formatting of allocator dumps
This patch uses the 'Hex_range' and 'Number_of_bytes' utilities to make the formatted output of 'Allocator_avl_base' better readable.
This commit is contained in:
parent
d56374e4b9
commit
48d1141917
@ -12,6 +12,7 @@
|
|||||||
* under the terms of the GNU Affero General Public License version 3.
|
* under the terms of the GNU Affero General Public License version 3.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <util/string.h>
|
||||||
#include <base/allocator_avl.h>
|
#include <base/allocator_avl.h>
|
||||||
|
|
||||||
void Genode::Allocator_avl_base::print(Genode::Output & out) const
|
void Genode::Allocator_avl_base::print(Genode::Output & out) const
|
||||||
@ -24,9 +25,10 @@ void Genode::Allocator_avl_base::print(Genode::Output & out) const
|
|||||||
|
|
||||||
_addr_tree.for_each([&] (Block const & b)
|
_addr_tree.for_each([&] (Block const & b)
|
||||||
{
|
{
|
||||||
print(out, " Block: [", Hex(b.addr()), ",", Hex(b.addr() + b.size()),
|
print(out, " Block: ", Hex_range<addr_t>(b.addr(), b.size()), " "
|
||||||
"] ", "size=", Hex(b.size()), " avail=", Hex(b.avail()), " ",
|
"size=", Number_of_bytes(b.size()), " "
|
||||||
"max_avail=", Hex(b.max_avail()), "\n");
|
"avail=", Number_of_bytes(b.avail()), " "
|
||||||
|
"max_avail=", Number_of_bytes(b.max_avail()), "\n");
|
||||||
mem_size += b.size();
|
mem_size += b.size();
|
||||||
mem_avail += b.avail();
|
mem_avail += b.avail();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user