do not show leaked info when no leaked bytes detected

This commit is contained in:
Stefani Seibold 2015-04-29 18:26:36 +02:00
parent eaab4f5aad
commit 7850511cf2

View File

@ -942,19 +942,22 @@ static void _process_dump(struct process *process, int (*sortby)(const struct rb
"Stack (%s):\n" "Stack (%s):\n"
" bytes used: %llu\n" " bytes used: %llu\n"
" number of open allocations: %llu\n" " number of open allocations: %llu\n"
" total number of allocations: %llu\n" " total number of allocations: %llu\n",
" leaked allocations: %lu (%llu bytes)\n"
" tsc: %llu\n",
str_operation(stack->stack->operation), str_operation(stack->stack->operation),
stack->bytes_used, stack->bytes_used,
stack->n_allocations, stack->n_allocations,
stack->total_allocations, stack->total_allocations
stack->leaks,
stack->bytes_leaked,
stack->tsc
) == -1) ) == -1)
break; 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); process_dump_stack(process, stack);
} }
} }