[NOT FOR MERGE] dump vty talloc report also to stdout

Change-Id: I037c9d2e6fa6b3175f452dd0ba4816e3710c8959
This commit is contained in:
Neels Hofmeyr 2021-08-12 15:09:37 +02:00 committed by Neels Hofmeyr
parent a41bd22349
commit 4c038e1d01
1 changed files with 11 additions and 0 deletions

View File

@ -108,6 +108,8 @@ static void talloc_ctx_walk_cb(const void *chunk, int depth,
filter_bypass:
if (is_ref) {
printf("%*sreference to: %s\n",
depth * 2, "", chunk_name);
vty_out(vty, "%*sreference to: %s%s",
depth * 2, "", chunk_name, VTY_NEWLINE);
return;
@ -117,6 +119,10 @@ filter_bypass:
chunk_size = talloc_total_size(chunk);
if (depth == 0) {
printf("%stalloc report on '%s' "
"(total %6zu bytes in %3zu blocks)\n",
(max_depth < 0 ? "full " : ""), chunk_name,
chunk_size, chunk_blocks);
vty_out(vty, "%stalloc report on '%s' "
"(total %6zu bytes in %3zu blocks)%s",
(max_depth < 0 ? "full " : ""), chunk_name,
@ -124,6 +130,11 @@ filter_bypass:
return;
}
printf("%*s%-30s contains %6zu bytes "
"in %3zu blocks (ref %zu) %p\n", depth * 2, "",
chunk_name, chunk_size, chunk_blocks,
talloc_reference_count(chunk),
chunk);
vty_out(vty, "%*s%-30s contains %6zu bytes "
"in %3zu blocks (ref %zu) %p%s", depth * 2, "",
chunk_name, chunk_size, chunk_blocks,