aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-08-12 15:09:37 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-03-09 04:13:23 +0100
commit4c038e1d01dd74d28e689ef588a2a2d05682d039 (patch)
tree132052485b9f17e43782bb2f61ec86da57e4ac16
parenta41bd22349416e60b826a7398716201809311675 (diff)
[NOT FOR MERGE] dump vty talloc report also to stdoutneels/talloc_report_to_stdout
-rw-r--r--src/vty/talloc_ctx_vty.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c
index ea8ebe70..30fcf539 100644
--- a/src/vty/talloc_ctx_vty.c
+++ b/src/vty/talloc_ctx_vty.c
@@ -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,