From 7850511cf2b79839b916d68f68b437c4cdc87ad8 Mon Sep 17 00:00:00 2001 From: Stefani Seibold Date: Wed, 29 Apr 2015 18:26:36 +0200 Subject: [PATCH] do not show leaked info when no leaked bytes detected --- client/process.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/process.c b/client/process.c index 56500c6..f473a9a 100644 --- a/client/process.c +++ b/client/process.c @@ -942,19 +942,22 @@ static void _process_dump(struct process *process, int (*sortby)(const struct rb "Stack (%s):\n" " bytes used: %llu\n" " number of open allocations: %llu\n" - " total number of allocations: %llu\n" - " leaked allocations: %lu (%llu bytes)\n" - " tsc: %llu\n", + " total number of allocations: %llu\n", str_operation(stack->stack->operation), stack->bytes_used, stack->n_allocations, - stack->total_allocations, - stack->leaks, - stack->bytes_leaked, - stack->tsc + stack->total_allocations ) == -1) break; + if (stack->leaks) { + if (dump_printf( " leaked allocations: %lu (%llu bytes)\n", stack->leaks, stack->bytes_leaked) == -1) + break; + } + + if (dump_printf(" tsc: %llu\n", stack->tsc) == -1) + break; + process_dump_stack(process, stack); } }