Add conditionally compiled mechanism to "show buffers" to give a list of the currently allocated buffers, with a trace for each one of the calls that led to its creation.

This commit is contained in:
counterpoint
2015-11-11 09:03:48 +00:00
parent 72072778de
commit 1fc6b00211
3 changed files with 140 additions and 3 deletions

View File

@ -43,7 +43,8 @@
* 29/05/14 Mark Riddoch Add Filter support
* 16/10/14 Mark Riddoch Add show eventq
* 05/03/15 Massimiliano Pinto Added enable/disable feedback
* 27/05/15 Martin Brampton Add show persistent [server]
* 27/05/15 Martin Brampton Add show persistent [server]
* 06/11/15 Martin Brampton Add show buffers (conditional compilation)
*
* @endverbatim
*/
@ -60,6 +61,7 @@
#include <atomic.h>
#include <server.h>
#include <spinlock.h>
#include <buffer.h>
#include <dcb.h>
#include <poll.h>
#include <users.h>
@ -107,6 +109,12 @@ static void telnetdShowUsers(DCB *);
* The subcommands of the show command
*/
struct subcommand showoptions[] = {
#if defined(BUFFER_TRACE)
{ "buffers", 0, dprintAllBuffers,
"Show all buffers with backtrace",
"Show all buffers with backtrace",
{0, 0, 0} },
#endif
{ "dcbs", 0, dprintAllDCBs,
"Show all descriptor control blocks (network connections)",
"Show all descriptor control blocks (network connections)",