diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-08-12 15:09:37 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2023-03-09 04:13:23 +0100 |
commit | 4c038e1d01dd74d28e689ef588a2a2d05682d039 (patch) | |
tree | 132052485b9f17e43782bb2f61ec86da57e4ac16 | |
parent | a41bd22349416e60b826a7398716201809311675 (diff) |
[NOT FOR MERGE] dump vty talloc report also to stdoutneels/talloc_report_to_stdout
Change-Id: I037c9d2e6fa6b3175f452dd0ba4816e3710c8959
-rw-r--r-- | src/vty/talloc_ctx_vty.c | 11 |
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, |