--- libelwix/src/mem.c 2015/06/25 16:49:33 1.4.18.3 +++ libelwix/src/mem.c 2015/06/25 17:52:41 1.4.18.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: mem.c,v 1.4.18.3 2015/06/25 16:49:33 misho Exp $ +* $Id: mem.c,v 1.4.18.5 2015/06/25 17:52:41 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -775,13 +775,23 @@ xdump_show(u_int size, u_int act, u_int inact) /* * mpool_xdump() - Dump elwix memory pool statistics * + * @fmt = format string + * @... = argument(s) * return: none */ void -mpool_xdump() +mpool_xdump(const char *fmt, ...) { - printf("\n%s(%d)\n------------------------------------------------------------\n", - __func__, __LINE__); + va_list lst; + + if (fmt) { + va_start(lst, fmt); + vprintf(fmt, lst); + va_end(lst); + } else + printf("\n%s(%d)\n", __func__, __LINE__); + + printf("------------------------------------------------------------\n"); printf( " ELWIX memory pool ::\n" "\t- quotas Current/Real/Max = %lu/%lu/%lu\n" "\t- calls Alloc/Free/Cache = %lu/%lu/%lu\n"